From 9697fa91b2e9b6ee2e465910743a972c18699105 Mon Sep 17 00:00:00 2001 From: muzuke <92723634+muzuke@users.noreply.github.com> Date: Sat, 8 Jan 2022 18:15:38 +0200 Subject: [PATCH] feat(charts/dex): Add support for secret referencing on env variables fixes #53 Signed-off-by: muzuke <92723634+muzuke@users.noreply.github.com> --- charts/dex/Chart.yaml | 4 ++-- charts/dex/README.md | 3 ++- charts/dex/templates/deployment.yaml | 3 +++ charts/dex/values.yaml | 16 ++++++++++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/charts/dex/Chart.yaml b/charts/dex/Chart.yaml index 4b60437d..2852b86b 100644 --- a/charts/dex/Chart.yaml +++ b/charts/dex/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 type: application name: dex -version: 0.6.4 +version: 0.6.5 appVersion: "2.30.0" kubeVersion: ">=1.14.0-0" description: OpenID Connect (OIDC) identity and OAuth 2.0 provider with pluggable connectors. @@ -22,7 +22,7 @@ maintainers: annotations: artifacthub.io/changes: | - kind: added - description: "`strategy` value to control the Dex deployment strategy" + description: "`envVars` value to allow secret referencing on environment variables" artifacthub.io/images: | - name: dex image: ghcr.io/dexidp/dex:v2.30.0 diff --git a/charts/dex/README.md b/charts/dex/README.md index 9e67e46d..fad7e4e0 100644 --- a/charts/dex/README.md +++ b/charts/dex/README.md @@ -1,6 +1,6 @@ # dex -![version: 0.6.4](https://img.shields.io/badge/version-0.6.4-informational?style=flat-square) ![type: application](https://img.shields.io/badge/type-application-informational?style=flat-square) ![app version: 2.30.0](https://img.shields.io/badge/app%20version-2.30.0-informational?style=flat-square) ![kube version: >=1.14.0-0](https://img.shields.io/badge/kube%20version->=1.14.0--0-informational?style=flat-square) [![artifact hub](https://img.shields.io/badge/artifact%20hub-dex-informational?style=flat-square)](https://artifacthub.io/packages/helm/dex/dex) +![version: 0.6.5](https://img.shields.io/badge/version-0.6.5-informational?style=flat-square) ![type: application](https://img.shields.io/badge/type-application-informational?style=flat-square) ![app version: 2.30.0](https://img.shields.io/badge/app%20version-2.30.0-informational?style=flat-square) ![kube version: >=1.14.0-0](https://img.shields.io/badge/kube%20version->=1.14.0--0-informational?style=flat-square) [![artifact hub](https://img.shields.io/badge/artifact%20hub-dex-informational?style=flat-square)](https://artifacthub.io/packages/helm/dex/dex) OpenID Connect (OIDC) identity and OAuth 2.0 provider with pluggable connectors. @@ -127,6 +127,7 @@ ingress: | 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. | | env | object | `{}` | Additional environment variables passed directly to containers. See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#environment-variables) for details. | +| envVars | list | `[]` | Similar to env but with support for all possible configurations. See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#environment-variables) for details. | | serviceAccount.create | bool | `true` | Enable service account creation. | | serviceAccount.annotations | object | `{}` | Annotations to be added to the service account. | | serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template. | diff --git a/charts/dex/templates/deployment.yaml b/charts/dex/templates/deployment.yaml index 86c0f148..57481787 100644 --- a/charts/dex/templates/deployment.yaml +++ b/charts/dex/templates/deployment.yaml @@ -68,6 +68,9 @@ spec: - name: {{ $key }} value: {{ $value | quote }} {{- end }} + {{- with .Values.envVars }} + {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.envFrom }} envFrom: {{- toYaml . | nindent 12 }} diff --git a/charts/dex/values.yaml b/charts/dex/values.yaml index e9f453c5..10e45f41 100644 --- a/charts/dex/values.yaml +++ b/charts/dex/values.yaml @@ -67,6 +67,22 @@ envFrom: [] # See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#environment-variables) for details. env: {} +# -- Similar to env but with support for all possible configurations. +# See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#environment-variables) for details. +envVars: [] +# - name: SOME_ENV_VAR +# value: value +# - name: SOME_ENV_VAR2 +# valueFrom: +# secretKeyRef: +# name: secret-name +# key: secret-key +# - name: SOME_ENV_VAR3 +# valueFrom: +# configMapKeyRef: +# name: config-map-name +# key: config-map-key + serviceAccount: # -- Enable service account creation. create: true