From f67e1410965a3bd5b1bc52bc9eb8c23c6dadafa4 Mon Sep 17 00:00:00 2001 From: zwangsheng <2213335496@qq.com> Date: Mon, 28 Nov 2022 16:08:55 +0800 Subject: [PATCH] [KYUUBI #3860] [K8S] Add service account name in values.yaml to config kyuubi's serviceAccountName in helm template file ### _Why are the changes needed?_ For kyuubi run in kubernetes, kyuubi need permissions to create/list/delete pods. Kubernetes provides serviceAccountName for quick configuration of permissions(Get details in [RBAC](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)). Add `serviceAccoutName` to the values.yaml file to help users add configurations without changing the template file. ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request ![WX20221128-114911](https://user-images.githubusercontent.com/52876270/204190111-b463239f-0427-4197-b3b4-e2a3a0bdf7ad.png) Closes #3860 from zwangsheng/kubernetes/serviceAccount. Closes #3860 e87bcb69 [zwangsheng] [K8S] Add service account name in values.yaml for kyuubi's serviceAccountName Authored-by: zwangsheng <2213335496@qq.com> Signed-off-by: Cheng Pan --- docker/helm/templates/kyuubi-deployment.yaml | 3 +++ docker/helm/values.yaml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/docker/helm/templates/kyuubi-deployment.yaml b/docker/helm/templates/kyuubi-deployment.yaml index a11ad51e9..eca757fff 100644 --- a/docker/helm/templates/kyuubi-deployment.yaml +++ b/docker/helm/templates/kyuubi-deployment.yaml @@ -35,6 +35,9 @@ spec: app: {{ template "kyuubi.name" . }} release: {{ .Release.Name }} spec: + {{- if .Values.serviceAccount }} + serviceAccountName: {{ .Values.serviceAccount.name }} + {{- end}} containers: - name: kyuubi-server image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/docker/helm/values.yaml b/docker/helm/values.yaml index 2477e0e01..59c29bfb8 100644 --- a/docker/helm/values.yaml +++ b/docker/helm/values.yaml @@ -28,6 +28,10 @@ image: # Overrides the image tag whose default is the chart appVersion. tag: "master-snapshot" +# ServiceAccount used for Kyuubi create/list/delete pod in kubernetes +serviceAccount: + name: default + probe: liveness: enabled: true