feat(charts/authentik): Support Service accounts for authentik#321
feat(charts/authentik): Support Service accounts for authentik#321ryanfaircloth wants to merge 1 commit intogoauthentik:mainfrom
Conversation
This will allow the use of container secret intrfaces
rissson
left a comment
There was a problem hiding this comment.
We already support setting a custom service account. As such I'm not inclined to accept this PR.
| {{- if .Values.server.serviceAccount.create }} | ||
| {{- if .Values.server.serviceAccount.name }} | ||
| serviceAccountName: {{ .Values.server.serviceAccount.name }} | ||
| {{- else }} | ||
| serviceAccountName: {{ template "authentik.server.fullname" . }} | ||
| {{- end }} | ||
| {{- else }} | ||
| {{- with .Values.server.imagePullSecrets | default .Values.global.imagePullSecrets }} | ||
| imagePullSecrets: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- with .Values.server.serviceAccountName }} | ||
| serviceAccountName: {{ . }} | ||
| {{- end }} | ||
| {{- end }} |
There was a problem hiding this comment.
This might result in multiple serviceAccountName being set. Also, it removes imagePullSecrets when no service account is set
| {{- if .Values.worker.serviceAccount.create }} | ||
| {{- if .Values.worker.serviceAccount.name }} | ||
| serviceAccountName: {{ .Values.worker.serviceAccount.name }} | ||
| {{- else }} | ||
| serviceAccountName: {{ template "authentik.server.fullname" . }} | ||
| {{- end }} | ||
| {{- else }} | ||
| {{- with .Values.worker.imagePullSecrets | default .Values.global.imagePullSecrets }} | ||
| imagePullSecrets: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.worker.serviceAccountName }} | ||
| {{- end }} | ||
| {{- with .Values.server.serviceAccountName }} |
There was a problem hiding this comment.
Same as the server. Also this references server.serviceAccountName although we're templating the worker deployment here
| serviceAccountName: ~ | ||
|
|
||
| serviceAccount: | ||
| create: true |
There was a problem hiding this comment.
This definitely shouldn't be true by default, especially since we're using authentik-remote-cluster by default.
wrenix
left a comment
There was a problem hiding this comment.
Is really hard to read that code.
| {{- if .Values.server.serviceAccount.name }} | ||
| serviceAccountName: {{ .Values.server.serviceAccount.name }} |
There was a problem hiding this comment.
with is a implizit if -> make that code more readable
| {{- if .Values.server.serviceAccount.name }} | |
| serviceAccountName: {{ .Values.server.serviceAccount.name }} | |
| {{- with .Values.server.serviceAccount.name }} | |
| serviceAccountName: {{ . }} |
| {{- if .Values.server.serviceAccount.annotations }} | ||
| annotations: | ||
| {{ toYaml .Values.serviceAccount.annotations | indent 4 }} | ||
| {{- end }} |
There was a problem hiding this comment.
| {{- if .Values.server.serviceAccount.annotations }} | |
| annotations: | |
| {{ toYaml .Values.serviceAccount.annotations | indent 4 }} | |
| {{- end }} | |
| {{- with .Values.server.serviceAccount.annotations }} | |
| annotations: | |
| {{- toYaml . | nindent 4 }} | |
| {{- end }} |
There was a problem hiding this comment.
with is a implizit if -> make that code more readable
| {{- if .Values.server.serviceAccount.labels }} | ||
| {{- toYaml .Values.server.serviceAccount.labels | nindent 4 }} | ||
| {{- end }} |
There was a problem hiding this comment.
| {{- if .Values.server.serviceAccount.labels }} | |
| {{- toYaml .Values.server.serviceAccount.labels | nindent 4 }} | |
| {{- end }} | |
| {{- with .Values.server.serviceAccount.labels }} | |
| {{- toYaml . | nindent 4 }} | |
| {{- end }} |
There was a problem hiding this comment.
with is a implizit if -> make that code more readable
| {{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.worker.podLabels) }} | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| {{- if .Values.worker.serviceAccount.labels }} | ||
| {{- toYaml .Values.worker.serviceAccount.labels | nindent 4 }} | ||
| {{- end }} | ||
| {{- if .Values.worker.serviceAccount.annotations }} | ||
| annotations: | ||
| {{ toYaml .Values.serviceAccount.annotations | indent 4 }} | ||
| {{- end }} |
There was a problem hiding this comment.
be more consequent with spaces, {{- vs. {{, if vs. with and nindent vs. indent.
| {{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.worker.podLabels) }} | |
| {{- toYaml . | nindent 4 }} | |
| {{- end }} | |
| {{- if .Values.worker.serviceAccount.labels }} | |
| {{- toYaml .Values.worker.serviceAccount.labels | nindent 4 }} | |
| {{- end }} | |
| {{- if .Values.worker.serviceAccount.annotations }} | |
| annotations: | |
| {{ toYaml .Values.serviceAccount.annotations | indent 4 }} | |
| {{- end }} | |
| {{- with (mergeOverwrite (dict) .Values.global.podLabels) .Values.worker.podLabels) }} | |
| {{- toYaml . | nindent 4 }} | |
| {{- end }} | |
| {{- with .Values.worker.serviceAccount.labels }} | |
| {{- toYaml . | nindent 4 }} | |
| {{- end }} | |
| {{- with .Values.worker.serviceAccount.annotations }} | |
| annotations: | |
| {{- toYaml . | nindent 4 }} | |
| {{- end }} |
| {{- if .Values.worker.serviceAccount.name }} | ||
| name: {{ .Values.worker.serviceAccount.name }} | ||
| {{- else }} | ||
| name: {{ template "authentik.server.fullname" . }} | ||
| {{- end }} |
There was a problem hiding this comment.
Or us with instatt of if
| {{- if .Values.worker.serviceAccount.name }} | |
| name: {{ .Values.worker.serviceAccount.name }} | |
| {{- else }} | |
| name: {{ template "authentik.server.fullname" . }} | |
| {{- end }} | |
| name: {{ .Values.worker.serviceAccount.name | default (template "authentik.server.fullname" .) }} |
This will allow the use of container secret intrfaces