From ac4adabb0a7a7deea4bb3f07865e0d64b3cf2c1d Mon Sep 17 00:00:00 2001 From: Spike Curtis Date: Tue, 31 Jan 2023 10:35:32 +0400 Subject: [PATCH] feat: set service account name in helm (#5913) Signed-off-by: Spike Curtis --- helm/templates/coder.yaml | 4 ++-- helm/templates/rbac.yaml | 4 ++-- helm/values.yaml | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/helm/templates/coder.yaml b/helm/templates/coder.yaml index a93b332c13..d385c19aa2 100644 --- a/helm/templates/coder.yaml +++ b/helm/templates/coder.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: coder + name: {{ .Values.coder.serviceAccount.name | quote }} annotations: {{ toYaml .Values.coder.serviceAccount.annotations | nindent 4 }} labels: {{- include "coder.labels" . | nindent 4 }} @@ -26,7 +26,7 @@ spec: labels: {{- include "coder.labels" . | nindent 8 }} spec: - serviceAccountName: coder + serviceAccountName: {{ .Values.coder.serviceAccount.name | quote }} restartPolicy: Always {{- with .Values.coder.image.pullSecrets }} imagePullSecrets: diff --git a/helm/templates/rbac.yaml b/helm/templates/rbac.yaml index ede94b4e76..d11ac555c5 100644 --- a/helm/templates/rbac.yaml +++ b/helm/templates/rbac.yaml @@ -16,10 +16,10 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - name: coder + name: {{ .Values.coder.serviceAccount.name | quote }} subjects: - kind: ServiceAccount - name: coder + name: {{ .Values.coder.serviceAccount.name | quote }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role diff --git a/helm/values.yaml b/helm/values.yaml index ce2a2df5c5..b6ef1aa1a1 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -47,6 +47,8 @@ coder: workspacePerms: true # coder.serviceAccount.annotations -- The Coder service account annotations. annotations: {} + # coder.serviceAccount.name -- The service account name + name: coder # coder.env -- The environment variables to set for Coder. These can be used # to configure all aspects of `coder server`. Please see `coder server --help`