Skip to content

Commit 6fe774e

Browse files
authored
Pass oauth2-proxy config through helm templating (#132)
Signed-off-by: Jan-Otto Kröpke <[email protected]>
1 parent 3500132 commit 6fe774e

File tree

6 files changed

+29
-8
lines changed

6 files changed

+29
-8
lines changed

helm/oauth2-proxy/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: oauth2-proxy
2-
version: 6.8.0
2+
version: 6.9.0
33
apiVersion: v2
44
appVersion: 7.4.0
55
home: https://oauth2-proxy.github.io/oauth2-proxy/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
extraEnv:
2+
- name: TEST_ENV_VAR_2
3+
value: '{{ $.Release.Name }}'
4+
ingress:
5+
enabled: true
6+
hosts:
7+
- "{{ $.Release.Name }}.local"
8+
tls:
9+
- hosts:
10+
- "{{ $.Release.Name }}.local"
11+
oauth2-proxy:
12+
checkDeprecation: false
13+
config:
14+
clientSecret: '{{ $.Release.Name }}'
15+
configFile: |
16+
oidc_issuer_url = "https://{{ $.Release.Name }}/dex"
17+
18+
pass_authorization_header: "true"
19+
20+
extraArgs:
21+
pass-authorization-header: "{{ $.Values.pass_authorization_header }}"

helm/oauth2-proxy/templates/configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ metadata:
1212
{{- include "oauth2-proxy.labels" . | indent 4 }}
1313
name: {{ template "oauth2-proxy.fullname" . }}
1414
data:
15-
oauth2_proxy.cfg: {{ .Values.config.configFile | quote }}
15+
oauth2_proxy.cfg: {{ tpl .Values.config.configFile $ | quote }}
1616
{{- end }}
1717
{{- end }}

helm/oauth2-proxy/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ spec:
7373
{{- if kindIs "map" .Values.extraArgs }}
7474
{{- range $key, $value := .Values.extraArgs }}
7575
{{- if $value }}
76-
- --{{ $key }}={{ $value }}
76+
- --{{ $key }}={{ tpl $value $ }}
7777
{{- else }}
7878
- --{{ $key }}
7979
{{- end }}

helm/oauth2-proxy/templates/ingress.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ spec:
2121
{{- end }}
2222
rules:
2323
{{- range $host := .Values.ingress.hosts }}
24-
- host: {{ $host | quote }}
24+
- host: {{ tpl $host $ | quote }}
2525
http:
2626
paths:
2727
{{- if $extraPaths }}
@@ -35,6 +35,6 @@ spec:
3535
{{- end -}}
3636
{{- if .Values.ingress.tls }}
3737
tls:
38-
{{ toYaml .Values.ingress.tls | indent 4 }}
38+
{{ tpl (toYaml .Values.ingress.tls) $ | indent 4 }}
3939
{{- end -}}
4040
{{- end -}}

helm/oauth2-proxy/templates/secret.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ metadata:
1212
name: {{ template "oauth2-proxy.fullname" . }}
1313
type: Opaque
1414
data:
15-
cookie-secret: {{ .Values.config.cookieSecret | b64enc | quote }}
16-
client-secret: {{ .Values.config.clientSecret | b64enc | quote }}
17-
client-id: {{ .Values.config.clientID | b64enc | quote }}
15+
cookie-secret: {{ tpl .Values.config.cookieSecret $ | b64enc | quote }}
16+
client-secret: {{ tpl .Values.config.clientSecret $ | b64enc | quote }}
17+
client-id: {{ tpl .Values.config.clientID $ | b64enc | quote }}
1818
{{- end -}}

0 commit comments

Comments
 (0)