From e7eb02ccce59fed54f1471d82854fdd2ce115da4 Mon Sep 17 00:00:00 2001 From: Lars Larsson Date: Thu, 15 Sep 2022 12:16:46 +0200 Subject: [PATCH] feat(charts/dex): add optional initContainers to deployment. Signed-off-by: Lars Larsson --- charts/dex/Chart.yaml | 2 -- charts/dex/README.md | 1 + charts/dex/templates/deployment.yaml | 4 ++++ charts/dex/values.yaml | 4 ++++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/charts/dex/Chart.yaml b/charts/dex/Chart.yaml index 82383b6f..3f219aec 100644 --- a/charts/dex/Chart.yaml +++ b/charts/dex/Chart.yaml @@ -23,6 +23,4 @@ annotations: artifacthub.io/changes: | - kind: added description: "Common labels to all resources created by the chart" - artifacthub.io/images: | - name: dex - image: ghcr.io/dexidp/dex:v2.35.3 diff --git a/charts/dex/README.md b/charts/dex/README.md index cd7d7a74..1657ab83 100644 --- a/charts/dex/README.md +++ b/charts/dex/README.md @@ -124,6 +124,7 @@ ingress: | configSecret.create | bool | `true` | Enable creating a secret from the values passed to `config`. If set to false, name must point to an existing secret. | | configSecret.name | string | `""` | The name of the secret to mount as configuration in the pod. If not set and create is true, a name is generated using the fullname template. Must point to secret that contains at least a `config.yaml` key. | | config | object | `{}` | Application configuration. See the [official documentation](https://dexidp.io/docs/). | +| initContainers | list | `[]` | [Init Containers](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/). See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#containers) for details. | | volumes | list | `[]` | Additional storage [volumes](https://kubernetes.io/docs/concepts/storage/volumes/). See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#volumes-1) for details. | | volumeMounts | list | `[]` | Additional [volume mounts](https://kubernetes.io/docs/tasks/configure-pod-container/configure-volume-storage/). See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#volumes-1) for details. | | envFrom | list | `[]` | Additional environment variables mounted from [secrets](https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-environment-variables) or [config maps](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#configure-all-key-value-pairs-in-a-configmap-as-container-environment-variables). See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#environment-variables) for details. | diff --git a/charts/dex/templates/deployment.yaml b/charts/dex/templates/deployment.yaml index 1f3ad4b8..7c49552c 100644 --- a/charts/dex/templates/deployment.yaml +++ b/charts/dex/templates/deployment.yaml @@ -41,6 +41,10 @@ spec: hostAliases: {{- toYaml . | nindent 8 }} {{- end }} + {{- if .Values.initContainers }} + initContainers: + {{- toYaml .Values.initContainers |nindent 8 }} + {{- end }} containers: - name: {{ .Chart.Name }} securityContext: diff --git a/charts/dex/values.yaml b/charts/dex/values.yaml index 756d49ef..ccc85402 100644 --- a/charts/dex/values.yaml +++ b/charts/dex/values.yaml @@ -55,6 +55,10 @@ configSecret: # See the [official documentation](https://dexidp.io/docs/). config: {} +# -- [Init Containers](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/). +# See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#containers) for details. +initContainers: [] + # -- Additional storage [volumes](https://kubernetes.io/docs/concepts/storage/volumes/). # See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#volumes-1) for details. volumes: []