Skip to content

Commit 74e598d

Browse files
Merge pull request #178 from jkroepke/avoid-restarts
Avoid unnecessary pod restart on each helm chart version
2 parents 32aa3a3 + 855e996 commit 74e598d

File tree

5 files changed

+41
-32
lines changed

5 files changed

+41
-32
lines changed

helm/oauth2-proxy/Chart.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: oauth2-proxy
2-
version: 6.22.0
2+
version: 6.23.0
33
apiVersion: v2
44
appVersion: 7.5.1
55
home: https://oauth2-proxy.github.io/oauth2-proxy/
@@ -34,8 +34,8 @@ maintainers:
3434
kubeVersion: ">=1.9.0-0"
3535
annotations:
3636
artifacthub.io/changes: |
37-
- kind: added
38-
description: Redis chart bumped to 18.5.0
37+
- kind: fixed
38+
description: Avoid unnecessary pod restart on each helm chart version
3939
links:
4040
- name: Github PR
41-
url: https://github.com/oauth2-proxy/manifests/pull/179
41+
url: https://github.com/oauth2-proxy/manifests/pull/178

helm/oauth2-proxy/templates/_helpers.tpl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,31 @@ Workaround for EKS https://github.com/aws/eks-distro/issues/1128
131131
{{- printf "%s.%s" .Capabilities.KubeVersion.Major (.Capabilities.KubeVersion.Minor | replace "+" "") -}}
132132
{{- end -}}
133133
{{- end -}}
134+
135+
{{- define "oauth2-proxy.alpha-config" -}}
136+
---
137+
server:
138+
BindAddress: '0.0.0.0:4180'
139+
{{- if .Values.alphaConfig.serverConfigData }}
140+
{{- toYaml .Values.alphaConfig.serverConfigData | nindent 6 }}
141+
{{- end }}
142+
{{- if .Values.metrics.enabled }}
143+
metricsServer:
144+
BindAddress: '0.0.0.0:44180'
145+
{{- if .Values.alphaConfig.metricsConfigData }}
146+
{{- toYaml .Values.alphaConfig.metricsConfigData | nindent 6 }}
147+
{{- end }}
148+
{{- end }}
149+
{{- if .Values.alphaConfig.configData }}
150+
{{- toYaml .Values.alphaConfig.configData | nindent 4 }}
151+
{{- end }}
152+
{{- if .Values.alphaConfig.configFile }}
153+
{{- tpl .Values.alphaConfig.configFile $ | nindent 4 }}
154+
{{- end }}
155+
{{- end -}}
156+
157+
{{- define "oauth2-proxy.secrets" -}}
158+
cookie-secret: {{ tpl .Values.config.cookieSecret $ | b64enc | quote }}
159+
client-secret: {{ tpl .Values.config.clientSecret $ | b64enc | quote }}
160+
client-id: {{ tpl .Values.config.clientID $ | b64enc | quote }}
161+
{{- end -}}

helm/oauth2-proxy/templates/deployment.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,18 @@ spec:
2121
template:
2222
metadata:
2323
annotations:
24-
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
24+
checksum/config: {{ tpl .Values.config.configFile $ | sha256sum }}
2525
{{- if .Values.alphaConfig.enabled }}
26-
checksum/alpha-config: {{ include (print $.Template.BasePath "/secret-alpha.yaml") . | sha256sum }}
26+
checksum/alpha-config: {{ include "oauth2-proxy.alpha-config" . | sha256sum }}
2727
{{- end }}
28+
{{- if .Values.authenticatedEmailsFile.enabled }}
2829
checksum/config-emails: {{ include (print $.Template.BasePath "/configmap-authenticated-emails-file.yaml") . | sha256sum }}
29-
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
30+
{{- end }}
31+
checksum/secret: {{ include "oauth2-proxy.secrets" . | sha256sum }}
3032
checksum/google-secret: {{ include (print $.Template.BasePath "/google-secret.yaml") . | sha256sum }}
3133
checksum/redis-secret: {{ include (print $.Template.BasePath "/redis-secret.yaml") . | sha256sum }}
3234
{{- if .Values.htpasswdFile.enabled }}
33-
checksum/htpasswd: {{ include (print $.Template.BasePath "/secret-htpasswd-file.yaml") . | sha256sum }}
35+
checksum/htpasswd: {{ toYaml .Values.htpasswdFile.entries | sha256sum }}
3436
{{- end }}
3537
{{- if .Values.podAnnotations }}
3638
{{ toYaml .Values.podAnnotations | indent 8 }}

helm/oauth2-proxy/templates/secret-alpha.yaml

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,6 @@ metadata:
1515
{{- include "oauth2-proxy.labels" . | indent 4 }}
1616
name: {{ template "oauth2-proxy.fullname" . }}-alpha
1717
namespace: {{ template "oauth2-proxy.namespace" $ }}
18-
stringData:
19-
oauth2_proxy.yml: |
20-
---
21-
server:
22-
BindAddress: '0.0.0.0:4180'
23-
{{- if .Values.alphaConfig.serverConfigData }}
24-
{{- toYaml .Values.alphaConfig.serverConfigData | nindent 6 }}
25-
{{- end }}
26-
{{- if .Values.metrics.enabled }}
27-
metricsServer:
28-
BindAddress: '0.0.0.0:44180'
29-
{{- if .Values.alphaConfig.metricsConfigData }}
30-
{{- toYaml .Values.alphaConfig.metricsConfigData | nindent 6 }}
31-
{{- end }}
32-
{{- end }}
33-
{{- if .Values.alphaConfig.configData }}
34-
{{- toYaml .Values.alphaConfig.configData | nindent 4 }}
35-
{{- end }}
36-
{{- if .Values.alphaConfig.configFile }}
37-
{{- tpl .Values.alphaConfig.configFile $ | nindent 4 }}
38-
{{- end }}
18+
data:
19+
oauth2_proxy.yml: {{ include "oauth2-proxy.alpha-config" . | b64enc | quote }}
3920
{{- end }}

helm/oauth2-proxy/templates/secret.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,5 @@ metadata:
1313
namespace: {{ template "oauth2-proxy.namespace" $ }}
1414
type: Opaque
1515
data:
16-
cookie-secret: {{ tpl .Values.config.cookieSecret $ | b64enc | quote }}
17-
client-secret: {{ tpl .Values.config.clientSecret $ | b64enc | quote }}
18-
client-id: {{ tpl .Values.config.clientID $ | b64enc | quote }}
16+
{{- include "oauth2-proxy.secrets" . | nindent 2 }}
1917
{{- end -}}

0 commit comments

Comments
 (0)