diff --git a/helm/oauth2-proxy/Chart.yaml b/helm/oauth2-proxy/Chart.yaml index 57e9ad97..65b915de 100644 --- a/helm/oauth2-proxy/Chart.yaml +++ b/helm/oauth2-proxy/Chart.yaml @@ -1,5 +1,5 @@ name: oauth2-proxy -version: 7.10.5 +version: 7.11.0 apiVersion: v2 appVersion: 7.8.1 home: https://oauth2-proxy.github.io/oauth2-proxy/ @@ -32,7 +32,7 @@ kubeVersion: ">=1.16.0-0" annotations: artifacthub.io/changes: | - kind: added - description: Add documentation to ensure Redis password consistency between sessionStorage and Redis sub chart is well explained + description: Add envFromExistingSecret value for loading environment variables from an existing secret links: - name: Github PR - url: https://github.com/oauth2-proxy/manifests/pull/283 + url: https://github.com/oauth2-proxy/manifests/pull/196 diff --git a/helm/oauth2-proxy/templates/deployment.yaml b/helm/oauth2-proxy/templates/deployment.yaml index 89b2f35f..ea401ce0 100644 --- a/helm/oauth2-proxy/templates/deployment.yaml +++ b/helm/oauth2-proxy/templates/deployment.yaml @@ -172,8 +172,13 @@ spec: lifecycle: {{ toYaml .Values.lifecycle | indent 10 }} {{- end }} + {{- with .Values.envFromExistingSecret }} + envFrom: + - secretRef: + name: {{ . }} + {{- end }} env: - {{- if .Values.proxyVarsAsSecrets }} + {{- if and (not .Values.envFromExistingSecret) .Values.proxyVarsAsSecrets }} - name: OAUTH2_PROXY_CLIENT_ID valueFrom: secretKeyRef: @@ -237,7 +242,7 @@ spec: {{- if .Values.extraEnv }} {{ tpl (toYaml .Values.extraEnv) . | indent 8 }} {{- end }} - {{- if .Values.envFrom }} + {{- if and (not .Values.envFromExistingSecret) .Values.envFrom }} envFrom: {{ tpl (toYaml .Values.envFrom) . | indent 8 }} {{- end }} diff --git a/helm/oauth2-proxy/values.yaml b/helm/oauth2-proxy/values.yaml index e9805ec2..a7eafa8d 100644 --- a/helm/oauth2-proxy/values.yaml +++ b/helm/oauth2-proxy/values.yaml @@ -107,6 +107,13 @@ envFrom: [] # - secretRef: # name: special-config-secret +# Import all environment variables from an existing secret. Will overwrite 'proxyVarsAsSecrets' and 'envFrom'. +envFromExistingSecret: "" + +# Whether to create a secret instead of plain environment values for configuring +# the client_id, client_secret and cookie_secret +proxyVarsAsSecrets: true + # -- Custom labels to add into metadata customLabels: {} @@ -245,9 +252,6 @@ tolerations: [] # Ref: https://kubernetes.io/docs/user-guide/node-selection/ nodeSelector: {} -# Whether to use secrets instead of environment values for setting up OAUTH2_PROXY variables -proxyVarsAsSecrets: true - # Configure Kubernetes liveness and readiness probes. # Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/ # Disable both when deploying with Istio 1.0 mTLS. https://istio.io/help/faq/security/#k8s-health-checks