feat: set service account name in helm (#5913)

Signed-off-by: Spike Curtis <spike@coder.com>
This commit is contained in:
Spike Curtis 2023-01-31 10:35:32 +04:00 committed by GitHub
parent 5290d5b14a
commit ac4adabb0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -3,7 +3,7 @@
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: coder name: {{ .Values.coder.serviceAccount.name | quote }}
annotations: {{ toYaml .Values.coder.serviceAccount.annotations | nindent 4 }} annotations: {{ toYaml .Values.coder.serviceAccount.annotations | nindent 4 }}
labels: labels:
{{- include "coder.labels" . | nindent 4 }} {{- include "coder.labels" . | nindent 4 }}
@ -26,7 +26,7 @@ spec:
labels: labels:
{{- include "coder.labels" . | nindent 8 }} {{- include "coder.labels" . | nindent 8 }}
spec: spec:
serviceAccountName: coder serviceAccountName: {{ .Values.coder.serviceAccount.name | quote }}
restartPolicy: Always restartPolicy: Always
{{- with .Values.coder.image.pullSecrets }} {{- with .Values.coder.image.pullSecrets }}
imagePullSecrets: imagePullSecrets:

View File

@ -16,10 +16,10 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding kind: RoleBinding
metadata: metadata:
name: coder name: {{ .Values.coder.serviceAccount.name | quote }}
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: coder name: {{ .Values.coder.serviceAccount.name | quote }}
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: Role kind: Role

View File

@ -47,6 +47,8 @@ coder:
workspacePerms: true workspacePerms: true
# coder.serviceAccount.annotations -- The Coder service account annotations. # coder.serviceAccount.annotations -- The Coder service account annotations.
annotations: {} annotations: {}
# coder.serviceAccount.name -- The service account name
name: coder
# coder.env -- The environment variables to set for Coder. These can be used # 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` # to configure all aspects of `coder server`. Please see `coder server --help`