[stable/oauth2-proxy] Add posibility for using environment values ins… (#20029)

* [stable/oauth2-proxy] Add posibility for using environment values instead of secrets

Signed-off-by: Thomas Borup <tbo@trifork.com>

* Renamed variable and flipped boolean value to avoid double negation

Signed-off-by: Thomas Borup <tbo@trifork.com>
This commit is contained in:
Thomas Borup
2020-01-28 23:04:14 -08:00
committed by GitHub
parent f5ff60c9e9
commit 6078fe10f1
5 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: oauth2-proxy
version: 2.1.1
version: 2.2.1
apiVersion: v1
appVersion: 4.0.0
home: https://pusher.github.io/oauth2_proxy/
+1
View File
@@ -107,6 +107,7 @@ Parameter | Description | Default
`tolerations` | list of node taints to tolerate | `[]`
`securityContext.enabled` | enable Kubernetes security context | `false`
`securityContext.runAsNonRoot` | make sure that the container runs as a non-root user | `true`
`proxyVarsAsSecrets` | choose between environment values or secrets for setting up OAUTH2_PROXY variables. When set to false, remember to add the variables OAUTH2_PROXY_CLIENT_ID, OAUTH2_PROXY_CLIENT_SECRET, OAUTH2_PROXY_COOKIE_SECRET in extraEnv | `true`
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
@@ -65,6 +65,7 @@ spec:
{{- if .Values.htpasswdFile.enabled }}
- --htpasswd-file=/etc/oauth2_proxy/htpasswd/users.txt
{{- end }}
{{- if .Values.proxyVarsAsSecrets }}
env:
- name: OAUTH2_PROXY_CLIENT_ID
valueFrom:
@@ -81,6 +82,7 @@ spec:
secretKeyRef:
name: {{ template "oauth2-proxy.secretName" . }}
key: cookie-secret
{{- end }}
{{- if .Values.extraEnv }}
{{ toYaml .Values.extraEnv | indent 8 }}
{{- end }}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- if not .Values.config.existingSecret }}
{{- if and (not .Values.config.existingSecret) (.Values.proxyVarsAsSecrets) }}
apiVersion: v1
kind: Secret
metadata:
+3
View File
@@ -116,6 +116,9 @@ 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