-
Notifications
You must be signed in to change notification settings - Fork 58
feat(charts/authentik): Support Service accounts for authentik #321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,13 +38,21 @@ spec: | |
| {{- end }} | ||
| {{- end }} | ||
| spec: | ||
| {{- 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 }} | ||
|
Comment on lines
+41
to
+55
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might result in multiple |
||
| {{- with .Values.global.hostAliases }} | ||
| hostAliases: | ||
| {{- toYaml . | nindent 8 }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,27 @@ | ||||||||||||||||||
| {{- if .Values.server.serviceAccount.create }} | ||||||||||||||||||
| apiVersion: v1 | ||||||||||||||||||
| kind: ServiceAccount | ||||||||||||||||||
| metadata: | ||||||||||||||||||
| {{- if .Values.server.serviceAccount.name }} | ||||||||||||||||||
| name: {{ .Values.server.serviceAccount.name }} | ||||||||||||||||||
| {{- else }} | ||||||||||||||||||
| name: {{ template "authentik.server.fullname" . }} | ||||||||||||||||||
| {{- end }} | ||||||||||||||||||
| namespace: {{ $.Release.Namespace }} | ||||||||||||||||||
| labels: | ||||||||||||||||||
| {{- include "authentik.labels" (dict "context" . "component" .Values.worker.name) | nindent 4 }} | ||||||||||||||||||
| {{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.worker.podLabels) }} | ||||||||||||||||||
| {{- toYaml . | nindent 4 }} | ||||||||||||||||||
| {{- end }} | ||||||||||||||||||
| {{- if .Values.server.serviceAccount.labels }} | ||||||||||||||||||
| {{- toYaml .Values.server.serviceAccount.labels | nindent 4 }} | ||||||||||||||||||
| {{- end }} | ||||||||||||||||||
|
Comment on lines
+16
to
+18
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||
| {{- if .Values.server.serviceAccount.annotations }} | ||||||||||||||||||
| annotations: | ||||||||||||||||||
| {{ toYaml .Values.serviceAccount.annotations | indent 4 }} | ||||||||||||||||||
| {{- end }} | ||||||||||||||||||
|
Comment on lines
+19
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||
| {{- with .Values.server.imagePullSecrets | default .Values.global.imagePullSecrets }} | ||||||||||||||||||
| imagePullSecrets: | ||||||||||||||||||
| {{- toYaml . | nindent 2 }} | ||||||||||||||||||
| {{- end }} | ||||||||||||||||||
| {{- end }} | ||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,15 +38,19 @@ spec: | |
| {{- end }} | ||
| {{- end }} | ||
| spec: | ||
| {{- 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 }} | ||
|
Comment on lines
+41
to
+52
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as the server. Also this references server.serviceAccountName although we're templating the worker deployment here |
||
| serviceAccountName: {{ . }} | ||
| {{- else }} | ||
| {{- if .Values.serviceAccount.create }} | ||
| serviceAccountName: {{ include "authentik-remote-cluster.fullname" .Subcharts.serviceAccount }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- with .Values.global.hostAliases }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,27 @@ | ||||||||||||||||||||||||||||||||||||||||||
| {{- if .Values.worker.serviceAccount.create }} | ||||||||||||||||||||||||||||||||||||||||||
| apiVersion: v1 | ||||||||||||||||||||||||||||||||||||||||||
| kind: ServiceAccount | ||||||||||||||||||||||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||||||||||||||||||||||
| {{- if .Values.worker.serviceAccount.name }} | ||||||||||||||||||||||||||||||||||||||||||
| name: {{ .Values.worker.serviceAccount.name }} | ||||||||||||||||||||||||||||||||||||||||||
| {{- else }} | ||||||||||||||||||||||||||||||||||||||||||
| name: {{ template "authentik.server.fullname" . }} | ||||||||||||||||||||||||||||||||||||||||||
| {{- end }} | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+5
to
+9
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or us
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||
| namespace: {{ $.Release.Namespace }} | ||||||||||||||||||||||||||||||||||||||||||
| labels: | ||||||||||||||||||||||||||||||||||||||||||
| {{- include "authentik.labels" (dict "context" . "component" .Values.worker.name) | nindent 4 }} | ||||||||||||||||||||||||||||||||||||||||||
| {{- 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 }} | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+13
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. be more consequent with spaces,
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||
| {{- with .Values.worker.imagePullSecrets | default .Values.global.imagePullSecrets }} | ||||||||||||||||||||||||||||||||||||||||||
| imagePullSecrets: | ||||||||||||||||||||||||||||||||||||||||||
| {{- toYaml . | nindent 2 }} | ||||||||||||||||||||||||||||||||||||||||||
| {{- end }} | ||||||||||||||||||||||||||||||||||||||||||
| {{- end }} | ||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -378,9 +378,15 @@ server: | |
| # -- Alternative DNS policy for authentik server pods | ||
| dnsPolicy: "" | ||
|
|
||
| # -- serviceAccount to use for authentik server pods | ||
| # -- serviceAccount to use for authentik server pods used when serviceAccount.create is false | ||
| serviceAccountName: ~ | ||
|
|
||
| serviceAccount: | ||
| create: true | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This definitely shouldn't be true by default, especially since we're using authentik-remote-cluster by default. |
||
| # -- serviceAccount name if not provided will be generated using the fullname template | ||
| name: | ||
| labels: {} | ||
| annotations: {} | ||
|
|
||
| # -- authentik server pod-level security context | ||
| # @default -- `{}` (See [values.yaml]) | ||
| securityContext: {} | ||
|
|
@@ -757,8 +763,14 @@ worker: | |
| # -- Alternative DNS policy for authentik worker pods | ||
| dnsPolicy: "" | ||
|
|
||
| # -- serviceAccount to use for authentik worker pods. If set, overrides the value used when serviceAccount.create is true | ||
| # -- serviceAccount to use for authentik server pods used when serviceAccount.create is false | ||
| serviceAccountName: ~ | ||
| serviceAccount: | ||
| create: true | ||
| # -- serviceAccount name if not provided will be generated using the fullname template | ||
| name: | ||
| labels: {} | ||
| annotations: {} | ||
|
|
||
| # -- authentik worker pod-level security context | ||
| # @default -- `{}` (See [values.yaml]) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
withis a implizitif-> make that code more readableUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or better see worker: #321 (comment)