Skip to content

Commit 2583241

Browse files
Merge branch 'main' into security-context
2 parents c328b0c + 081d2a3 commit 2583241

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

helm/oauth2-proxy/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ Parameter | Description | Default
108108
`alphaConfig.metricsConfigData` | Arbitrary configuration data to append to the metrics section | `{}`
109109
`alphaConfig.configData` | Arbitrary configuration data to append | `{}`
110110
`alphaConfig.configFile` | Arbitrary configuration to append, treated as a Go template and rendered with the root context | `""`
111-
`alphaConfig.existingConfig` | existing Kubernetes configmap to use for the alpha configuration file. See [config template](https://github.com/oauth2-proxy/manifests/blob/master/helm/oauth2-proxy/templates/configmap-alpha.yaml) for the required values | `nil`
111+
`alphaConfig.existingConfig` | existing Kubernetes configmap to use for the alpha configuration file. See [config template](https://github.com/oauth2-proxy/manifests/blob/master/helm/oauth2-proxy/templates/secret-alpha.yaml) for the required values | `nil`
112+
`alphaConfig.existingSecret` | existing Kubernetes secret to use for the alpha configuration file. See [config template](https://github.com/oauth2-proxy/manifests/blob/master/helm/oauth2-proxy/templates/secret-alpha.yaml) for the required values | `nil`
112113
`customLabels` | Custom labels to add into metadata | `{}` |
113114
`config.google.adminEmail` | user impersonated by the google service account | `""`
114115
`config.google.useApplicationDefaultCredentials` | use the application-default credentials (i.e. Workload Identity on GKE) instead of providing a service account json | `false`

helm/oauth2-proxy/templates/deployment.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ spec:
2323
annotations:
2424
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
2525
{{- if .Values.alphaConfig.enabled }}
26-
checksum/alpha-config: {{ include (print $.Template.BasePath "/configmap-alpha.yaml") . | sha256sum }}
26+
checksum/alpha-config: {{ include (print $.Template.BasePath "/secret-alpha.yaml") . | sha256sum }}
2727
{{- end }}
2828
checksum/config-emails: {{ include (print $.Template.BasePath "/configmap-authenticated-emails-file.yaml") . | sha256sum }}
2929
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
@@ -76,7 +76,7 @@ spec:
7676
{{- end }}
7777
{{- if kindIs "map" .Values.extraArgs }}
7878
{{- range $key, $value := .Values.extraArgs }}
79-
{{- if $value }}
79+
{{- if not (kindIs "invalid" $value) }}
8080
- --{{ $key }}={{ tpl ($value | toString) $ }}
8181
{{- else }}
8282
- --{{ $key }}
@@ -300,10 +300,17 @@ spec:
300300
name: configmain
301301
{{- end }}
302302
{{- if .Values.alphaConfig.enabled }}
303+
{{- if .Values.alphaConfig.existingConfig }}
303304
- configMap:
304305
defaultMode: 420
305-
name: {{ if .Values.alphaConfig.existingConfig }}{{ .Values.alphaConfig.existingConfig }}{{ else }}{{ template "oauth2-proxy.fullname" . }}-alpha{{ end }}
306+
name: {{ .Values.alphaConfig.existingConfig }}
306307
name: configalpha
308+
{{- else }}
309+
- secret:
310+
defaultMode: 420
311+
secretName: {{ if .Values.alphaConfig.existingSecret }}{{ .Values.alphaConfig.existingSecret }}{{ else }}{{ template "oauth2-proxy.fullname" . }}-alpha{{ end }}
312+
name: configalpha
313+
{{- end }}
307314
{{- end }}
308315
{{- if ne (len .Values.extraVolumes) 0 }}
309316
{{ toYaml .Values.extraVolumes | indent 6 }}

helm/oauth2-proxy/templates/configmap-alpha.yaml renamed to helm/oauth2-proxy/templates/secret-alpha.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
{{- if .Values.alphaConfig.enabled }}
2-
{{- if not .Values.alphaConfig.existingConfig }}
1+
{{-
2+
if and
3+
.Values.alphaConfig.enabled
4+
(not .Values.alphaConfig.existingConfig)
5+
(not .Values.alphaConfig.existingSecret)
6+
}}
37
apiVersion: v1
4-
kind: ConfigMap
8+
kind: Secret
59
metadata:
610
{{- if .Values.alphaConfig.annotations }}
711
annotations: {{- toYaml .Values.alphaConfig.annotations | nindent 4 }}
@@ -11,7 +15,7 @@ metadata:
1115
{{- include "oauth2-proxy.labels" . | indent 4 }}
1216
name: {{ template "oauth2-proxy.fullname" . }}-alpha
1317
namespace: {{ template "oauth2-proxy.namespace" $ }}
14-
data:
18+
stringData:
1519
oauth2_proxy.yml: |
1620
---
1721
server:
@@ -33,4 +37,3 @@ data:
3337
{{- tpl .Values.alphaConfig.configFile $ | nindent 4 }}
3438
{{- end }}
3539
{{- end }}
36-
{{- end }}

helm/oauth2-proxy/values.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ alphaConfig:
6161
# Arbitrary configuration to append
6262
# This is treated as a Go template and rendered with the root context
6363
configFile: ""
64-
# Use an existing config map (see configmap-alpha.yaml for required fields)
64+
# Use an existing config map (see secret-alpha.yaml for required fields)
6565
existingConfig: ~
66+
# Use an existing secret
67+
existingSecret: ~
6668

6769
image:
6870
repository: "quay.io/oauth2-proxy/oauth2-proxy"

0 commit comments

Comments
 (0)