Skip to content

Commit

Permalink
Merge pull request #174 from karel1980/graceful-shutdown
Browse files Browse the repository at this point in the history
Allow configuring terminationGracePeriodSeconds and lifecycle hooks
  • Loading branch information
pierluigilenoci authored Nov 28, 2023
2 parents 7c56c9b + 4d8c938 commit c9f0ae8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
8 changes: 4 additions & 4 deletions helm/oauth2-proxy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: oauth2-proxy
version: 6.19.1
version: 6.20.0
apiVersion: v2
appVersion: 7.5.1
home: https://oauth2-proxy.github.io/oauth2-proxy/
Expand Down Expand Up @@ -34,8 +34,8 @@ maintainers:
kubeVersion: ">=1.9.0-0"
annotations:
artifacthub.io/changes: |
- kind: fixed
description: Fix typo for automountServiceAccountToken parameter
- kind: added
description: Allow specifying terminationGracePeriodSeconds and lifecycle hooks
links:
- name: Github PR
url: https://github.com/oauth2-proxy/manifests/pull/173
url: https://github.com/oauth2-proxy/manifests/pull/174
7 changes: 7 additions & 0 deletions helm/oauth2-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ spec:
{{- toYaml $securityContext | nindent 10 }}
{{- end }}
{{- end }}
{{- if .Values.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:v{{ include "oauth2-proxy.version" . }}"
Expand Down Expand Up @@ -135,6 +138,10 @@ spec:
{{- if .Values.htpasswdFile.enabled }}
- --htpasswd-file=/etc/oauth2_proxy/htpasswd/users.txt
{{- end }}
{{- if .Values.lifecycle }}
lifecycle:
{{ toYaml .Values.lifecycle | indent 10 }}
{{- end }}
env:
{{- if .Values.proxyVarsAsSecrets }}
- name: OAUTH2_PROXY_CLIENT_ID
Expand Down
7 changes: 7 additions & 0 deletions helm/oauth2-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,13 @@ redis:
# Enables apiVersion deprecation checks
checkDeprecation: true

# Allows graceful shutdown
# terminationGracePeriodSeconds: 65
# lifecycle:
# preStop:
# exec:
# command: [ "sh", "-c", "sleep 60" ]

metrics:
# Enable Prometheus metrics endpoint
enabled: true
Expand Down

0 comments on commit c9f0ae8

Please sign in to comment.