Skip to content
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

feat: add support for custom initContainers #208

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/authelia/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,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 @@ -843,6 +843,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 @@ -89,6 +89,9 @@ spec:
{{- else }}
enableServiceLinks: false
{{- end }}
{{- 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 @@ -223,6 +223,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 @@ -221,6 +221,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