From dedc97def26f4215270c22ee33ea4a719189f211 Mon Sep 17 00:00:00 2001 From: Karel Vervaeke Date: Tue, 28 Nov 2023 15:02:59 +0100 Subject: [PATCH 1/5] Allow configuring terminationGracePeriodSeconds --- helm/oauth2-proxy/templates/deployment.yaml | 3 +++ helm/oauth2-proxy/values.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/helm/oauth2-proxy/templates/deployment.yaml b/helm/oauth2-proxy/templates/deployment.yaml index 4a8d32b..dd38f10 100644 --- a/helm/oauth2-proxy/templates/deployment.yaml +++ b/helm/oauth2-proxy/templates/deployment.yaml @@ -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" . }}" diff --git a/helm/oauth2-proxy/values.yaml b/helm/oauth2-proxy/values.yaml index 9c3ee0e..56aa2d3 100644 --- a/helm/oauth2-proxy/values.yaml +++ b/helm/oauth2-proxy/values.yaml @@ -349,6 +349,9 @@ redis: # Enables apiVersion deprecation checks checkDeprecation: true +# Allows graceful shutdown +# terminationGracePeriodSeconds: 65 + metrics: # Enable Prometheus metrics endpoint enabled: true From b61ed28460c8083bc5a14c5ac6b69d9fcc88ce74 Mon Sep 17 00:00:00 2001 From: Karel Vervaeke Date: Tue, 28 Nov 2023 15:30:22 +0100 Subject: [PATCH 2/5] Allow adding lifecycle hooks --- helm/oauth2-proxy/templates/deployment.yaml | 4 ++++ helm/oauth2-proxy/values.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/helm/oauth2-proxy/templates/deployment.yaml b/helm/oauth2-proxy/templates/deployment.yaml index dd38f10..a94f1b5 100644 --- a/helm/oauth2-proxy/templates/deployment.yaml +++ b/helm/oauth2-proxy/templates/deployment.yaml @@ -138,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 diff --git a/helm/oauth2-proxy/values.yaml b/helm/oauth2-proxy/values.yaml index 56aa2d3..361d459 100644 --- a/helm/oauth2-proxy/values.yaml +++ b/helm/oauth2-proxy/values.yaml @@ -351,6 +351,10 @@ checkDeprecation: true # Allows graceful shutdown # terminationGracePeriodSeconds: 65 +# lifecycle: +# preStop: +# exec: +# command: [ "sh", "-c", "sleep 60" ] metrics: # Enable Prometheus metrics endpoint From 091edebbf3a2c97401ffa6c7f20f652f15244740 Mon Sep 17 00:00:00 2001 From: Karel Vervaeke Date: Tue, 28 Nov 2023 16:12:11 +0100 Subject: [PATCH 3/5] Bumped version to 6.20.0 + record changes for artifacthub.io --- helm/oauth2-proxy/Chart.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helm/oauth2-proxy/Chart.yaml b/helm/oauth2-proxy/Chart.yaml index b3cca28..1c0ac92 100644 --- a/helm/oauth2-proxy/Chart.yaml +++ b/helm/oauth2-proxy/Chart.yaml @@ -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/ @@ -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 \ No newline at end of file From 6addcbdedd1c2fa4b4eb677a8bde46e53afd6468 Mon Sep 17 00:00:00 2001 From: Pierluigi Lenoci Date: Tue, 28 Nov 2023 18:36:33 +0100 Subject: [PATCH 4/5] Lint --- helm/oauth2-proxy/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/oauth2-proxy/Chart.yaml b/helm/oauth2-proxy/Chart.yaml index 1c0ac92..5a797be 100644 --- a/helm/oauth2-proxy/Chart.yaml +++ b/helm/oauth2-proxy/Chart.yaml @@ -38,4 +38,4 @@ annotations: description: Allow specifying terminationGracePeriodSeconds and lifecycle hooks links: - name: Github PR - url: https://github.com/oauth2-proxy/manifests/pull/174 \ No newline at end of file + url: https://github.com/oauth2-proxy/manifests/pull/174 From 4d8c938b7c195f21227627201eb59f204fb82149 Mon Sep 17 00:00:00 2001 From: Pierluigi Lenoci Date: Tue, 28 Nov 2023 18:38:44 +0100 Subject: [PATCH 5/5] Lint --- helm/oauth2-proxy/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/oauth2-proxy/Chart.yaml b/helm/oauth2-proxy/Chart.yaml index 5a797be..6c3df8d 100644 --- a/helm/oauth2-proxy/Chart.yaml +++ b/helm/oauth2-proxy/Chart.yaml @@ -35,7 +35,7 @@ kubeVersion: ">=1.9.0-0" annotations: artifacthub.io/changes: | - kind: added - description: Allow specifying terminationGracePeriodSeconds and lifecycle hooks + description: Allow specifying terminationGracePeriodSeconds and lifecycle hooks links: - name: Github PR url: https://github.com/oauth2-proxy/manifests/pull/174