diff --git a/charts/authelia/Chart.yaml b/charts/authelia/Chart.yaml index 1bdfb32..420f520 100644 --- a/charts/authelia/Chart.yaml +++ b/charts/authelia/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: authelia -version: 0.9.0-beta2 +version: 0.9.0-beta3 kubeVersion: ">= 1.13.0-0" description: Authelia is a Single Sign-On Multi-Factor portal for web apps type: application diff --git a/charts/authelia/README.md b/charts/authelia/README.md index 55ac2f3..219fa32 100644 --- a/charts/authelia/README.md +++ b/charts/authelia/README.md @@ -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 | diff --git a/charts/authelia/templates/_helpers.tpl b/charts/authelia/templates/_helpers.tpl index 02cd68a..0f5bcd2 100644 --- a/charts/authelia/templates/_helpers.tpl +++ b/charts/authelia/templates/_helpers.tpl @@ -61,7 +61,7 @@ Returns true if pod is stateful. {{- true -}} {{- else if and (not (and (.Values.configMap.storage.mysql) (.Values.configMap.storage.mysql.enabled))) (not (and (.Values.configMap.storage.postgres) (.Values.configMap.storage.postgres.enabled))) -}} {{- true -}} - {{- else if not (and (.Values.configMap.authentication_backend) (.Values.configMap.authentication_backend.ldap.enabled)) -}} + {{- else if or (not .Values.configMap.authentication_backend) (not .Values.configMap.authentication_backend.ldap.enabled) (and .Values.configMap.authentication_backend.file.enabled (not .Values.configMap.authentication_backend.file.watch)) -}} {{- true -}} {{- end -}} {{- end -}} @@ -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. */}} diff --git a/charts/authelia/templates/deployment.yaml b/charts/authelia/templates/deployment.yaml index 29a914a..73091cd 100644 --- a/charts/authelia/templates/deployment.yaml +++ b/charts/authelia/templates/deployment.yaml @@ -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" . }} diff --git a/charts/authelia/values.local.yaml b/charts/authelia/values.local.yaml index b658707..0c41971 100644 --- a/charts/authelia/values.local.yaml +++ b/charts/authelia/values.local.yaml @@ -106,7 +106,7 @@ ingress: tls: enabled: true secret: 'authelia-tls' - + hostNameOverride: '' # hostNameOverride: 'example.com' traefikCRD: @@ -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: '' diff --git a/charts/authelia/values.yaml b/charts/authelia/values.yaml index e5081a9..e768d78 100644 --- a/charts/authelia/values.yaml +++ b/charts/authelia/values.yaml @@ -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: ''