Skip to content

Commit

Permalink
feat: add support for custom initContainers
Browse files Browse the repository at this point in the history
Signed-off-by: uid54289 <120799552+uid54289@users.noreply.github.com>
  • Loading branch information
hqdncw authored and james-d-elliott committed Apr 19, 2024
1 parent 44c3968 commit 9fccf91
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/authelia/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ This documents the parameters in the chart values. As the chart values are quite
| pod.kind | Configures the kind of pod: StatefulSet, Deployment, DaemonSet | DaemonSet |
| pod.annotations | Adds annotations specifically to the pod | {} |
| pod.labels | Adds labels specifically to the pod | {} |
| pod.initContainers | Adds additional init containers specifically to the pod | [] |
| pod.replicas | Configures the replicas for Deployment's/statefulSet's | 1 |
| pod.revisionHistoryLimit | Configures the revisionHistoryLimit | 1 |
| pod.strategy.type | Configures the pods strategy/updateStrategy type | RollingUpdate |
Expand Down
13 changes: 13 additions & 0 deletions charts/authelia/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,19 @@ Renders a probe
{{- end -}}
{{- end -}}

{{/*
Renders a value that contains template.
Usage:
{{ include "authelia.snippets.render" ( dict "value" .Values.path.to.the.Value "context" $) }}
*/}}
{{- define "authelia.snippets.render" -}}
{{- if typeIs "string" .value }}
{{- tpl .value .context }}
{{- else }}
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}

{{/*
Returns the service port.
*/}}
Expand Down
3 changes: 3 additions & 0 deletions charts/authelia/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ spec:
serviceAccountName: {{ default (include "authelia.name" .) .Values.rbac.serviceAccountName }}
{{- end }}
enableServiceLinks: {{ .Values.pod.enableServiceLinks | default false }}
{{- if .Values.pod.initContainers }}
initContainers: {{- include "authelia.snippets.render" (dict "value" .Values.pod.initContainers "context" $) | nindent 8 }}
{{- end }}
containers:
- name: authelia
image: {{ include "authelia.image" . }}
Expand Down
6 changes: 6 additions & 0 deletions charts/authelia/values.local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ pod:
# labels:
# myLabel: 'myValue'

initContainers: []
# initContainers:
# - name: myapp-init
# image: busybox:1.36
# command: ['sh', '-c', 'echo The app is starting! && sleep 5']

replicas: 1
revisionHistoryLimit: 5
priorityClassName: ''
Expand Down
6 changes: 6 additions & 0 deletions charts/authelia/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ pod:
# labels:
# myLabel: 'myValue'

initContainers: []
# initContainers:
# - name: myapp-init
# image: busybox:1.36
# command: ['sh', '-c', 'echo The app is starting! && sleep 5']

replicas: 1
revisionHistoryLimit: 5
priorityClassName: ''
Expand Down

0 comments on commit 9fccf91

Please sign in to comment.