Skip to content

Commit e3886cc

Browse files
feat: add init container for oauth2 proxy (#1779)
Co-authored-by: jeho <[email protected]>
1 parent 73aac2f commit e3886cc

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

charts/oauth2-proxy/templates/deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ spec:
100100
{{- if .Values.terminationGracePeriodSeconds }}
101101
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
102102
{{- end }}
103+
# The .Values.extraInitContainers is not supported by the upstream chart!
104+
{{- if .Values.extraInitContainers }}
105+
{{- toYaml .Values.extraInitContainers | nindent 6 }}
106+
{{- end }}
103107
containers:
104108
- name: {{ .Chart.Name }}
105109
image: "{{ .Values.image.repository }}:{{ include "oauth2-proxy.version" . }}"

charts/oauth2-proxy/values.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ extraContainers: []
215215
# - name: my-sidecar
216216
# image: nginx:latest
217217

218+
# The extraInitContainers is not supported by the upstream chart!
219+
extraInitContainers: []
220+
218221
priorityClassName: ""
219222

220223
# hostAliases is a list of aliases to be added to /etc/hosts for network name resolution

values/oauth2-proxy/oauth2-proxy.gotmpl

+6
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ extraVolumeMounts:
7979
mountPath: /etc/oauth2-proxy/error.html
8080
subPath: error.html
8181

82+
extraInitContainers:
83+
- name: wait-for-keycloak
84+
image: curlimages/curl:latest
85+
command: ["/bin/sh","-c"]
86+
args: ["while [ $(curl -sw '%{http_code}' {{ $v._derived.oidcBaseUrl }} -o /dev/null) -ne 200 ]; do sleep 2; echo 'Waiting for Keycloak OIDC Issuer URL'; done"]
87+
8288
{{- with .Values.otomi | get "globalPullSecret" nil }}
8389
imagePullSecrets:
8490
- name: otomi-pullsecret-global

0 commit comments

Comments
 (0)