From 91589381d47c7e3e507708e7790e9e26f612bcfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20B=C5=82aszczyk?= Date: Tue, 30 Jan 2024 12:48:17 +0100 Subject: [PATCH] feat: expose terminationGracePeriodSeconds (#664) --- helm/charts/hydra-maester/templates/deployment.yaml | 1 + helm/charts/hydra-maester/values.yaml | 2 ++ helm/charts/hydra/templates/deployment-watcher.yaml | 1 + helm/charts/hydra/templates/deployment.yaml | 1 + helm/charts/hydra/values.yaml | 2 ++ helm/charts/keto/templates/deployment-watcher.yaml | 1 + helm/charts/keto/templates/deployment.yaml | 1 + helm/charts/keto/values.yaml | 1 + .../kratos-selfservice-ui-node/templates/deployment.yaml | 1 + helm/charts/kratos-selfservice-ui-node/values.yaml | 1 + helm/charts/kratos/templates/deployment-kratos.yaml | 1 + helm/charts/kratos/templates/deployment-watcher.yaml | 1 + helm/charts/kratos/templates/statefulset-mail.yaml | 1 + helm/charts/kratos/values.yaml | 4 ++++ helm/charts/oathkeeper-maester/templates/deployment.yaml | 2 +- helm/charts/oathkeeper-maester/values.yaml | 1 + helm/charts/oathkeeper/templates/deployment-controller.yaml | 1 + helm/charts/oathkeeper/templates/deployment-sidecar.yaml | 1 + helm/charts/oathkeeper/values.yaml | 2 ++ 19 files changed, 25 insertions(+), 1 deletion(-) diff --git a/helm/charts/hydra-maester/templates/deployment.yaml b/helm/charts/hydra-maester/templates/deployment.yaml index 59551dc83e..33857e42d0 100644 --- a/helm/charts/hydra-maester/templates/deployment.yaml +++ b/helm/charts/hydra-maester/templates/deployment.yaml @@ -47,6 +47,7 @@ spec: {{- if .Values.deployment.extraVolumes }} {{- toYaml .Values.deployment.extraVolumes | nindent 8 }} {{- end }} + terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/helm/charts/hydra-maester/values.yaml b/helm/charts/hydra-maester/values.yaml index 2863cd1c1c..8c0dd87c46 100644 --- a/helm/charts/hydra-maester/values.yaml +++ b/helm/charts/hydra-maester/values.yaml @@ -132,6 +132,8 @@ deployment: # -- This applications connects to the k8s API and requires the permissions automountServiceAccountToken: true + terminationGracePeriodSeconds: 60 + # -- Arguments to be passed to the program args: # -- The minimum frequency at which watched resources are reconciled diff --git a/helm/charts/hydra/templates/deployment-watcher.yaml b/helm/charts/hydra/templates/deployment-watcher.yaml index 8073764da8..1fa38ae544 100644 --- a/helm/charts/hydra/templates/deployment-watcher.yaml +++ b/helm/charts/hydra/templates/deployment-watcher.yaml @@ -40,6 +40,7 @@ spec: spec: automountServiceAccountToken: {{ .Values.deployment.automountServiceAccountToken }} serviceAccountName: {{ include "hydra.serviceAccountName" . }}-watcher + terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }} containers: - name: watcher {{- with .Values.watcher.securityContext }} diff --git a/helm/charts/hydra/templates/deployment.yaml b/helm/charts/hydra/templates/deployment.yaml index 90d1bcf8a7..4c4fe9bcf3 100644 --- a/helm/charts/hydra/templates/deployment.yaml +++ b/helm/charts/hydra/templates/deployment.yaml @@ -61,6 +61,7 @@ spec: {{- end }} serviceAccountName: {{ include "hydra.serviceAccountName" . }} automountServiceAccountToken: {{ .Values.deployment.automountServiceAccountToken }} + terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" diff --git a/helm/charts/hydra/values.yaml b/helm/charts/hydra/values.yaml index e4db42b3ce..b14c8ba25c 100644 --- a/helm/charts/hydra/values.yaml +++ b/helm/charts/hydra/values.yaml @@ -346,6 +346,8 @@ deployment: # https://github.com/kubernetes/kubernetes/issues/57601 automountServiceAccountToken: true + terminationGracePeriodSeconds: 60 + # -- If you want to add extra init containers. These are processed before the migration init container. extraInitContainers: "" # extraInitContainers: | diff --git a/helm/charts/keto/templates/deployment-watcher.yaml b/helm/charts/keto/templates/deployment-watcher.yaml index 0526d9a0b4..d7029e714f 100644 --- a/helm/charts/keto/templates/deployment-watcher.yaml +++ b/helm/charts/keto/templates/deployment-watcher.yaml @@ -42,6 +42,7 @@ spec: serviceAccountName: {{ include "keto.serviceAccountName" . }}-watcher securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }} containers: - name: watcher {{- if .Values.securityContext }} diff --git a/helm/charts/keto/templates/deployment.yaml b/helm/charts/keto/templates/deployment.yaml index 191484cbda..dfbf925642 100644 --- a/helm/charts/keto/templates/deployment.yaml +++ b/helm/charts/keto/templates/deployment.yaml @@ -105,6 +105,7 @@ spec: automountServiceAccountToken: {{ $automountServiceAccountToken }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }} containers: - name: {{ .Chart.Name }} {{- with .Values.securityContext }} diff --git a/helm/charts/keto/values.yaml b/helm/charts/keto/values.yaml index 34c9262786..220d2c0222 100644 --- a/helm/charts/keto/values.yaml +++ b/helm/charts/keto/values.yaml @@ -398,6 +398,7 @@ deployment: extraEnv: [] # -- Number of revisions kept in history revisionHistoryLimit: 5 + terminationGracePeriodSeconds: 60 ## -- Watcher sidecar configuration watcher: diff --git a/helm/charts/kratos-selfservice-ui-node/templates/deployment.yaml b/helm/charts/kratos-selfservice-ui-node/templates/deployment.yaml index 3e20627d9d..08c501b4bb 100644 --- a/helm/charts/kratos-selfservice-ui-node/templates/deployment.yaml +++ b/helm/charts/kratos-selfservice-ui-node/templates/deployment.yaml @@ -42,6 +42,7 @@ spec: volumes: {{- toYaml . | nindent 6 }} {{- end }} + terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/helm/charts/kratos-selfservice-ui-node/values.yaml b/helm/charts/kratos-selfservice-ui-node/values.yaml index 690a2d7595..55357e4d6f 100644 --- a/helm/charts/kratos-selfservice-ui-node/values.yaml +++ b/helm/charts/kratos-selfservice-ui-node/values.yaml @@ -162,6 +162,7 @@ deployment: # https://github.com/kubernetes/kubernetes/issues/57601 automountServiceAccountToken: false + terminationGracePeriodSeconds: 60 affinity: {} diff --git a/helm/charts/kratos/templates/deployment-kratos.yaml b/helm/charts/kratos/templates/deployment-kratos.yaml index b39cd2cad0..53f0912600 100644 --- a/helm/charts/kratos/templates/deployment-kratos.yaml +++ b/helm/charts/kratos/templates/deployment-kratos.yaml @@ -112,6 +112,7 @@ spec: {{- end }} automountServiceAccountToken: {{ .Values.deployment.automountServiceAccountToken }} serviceAccountName: {{ include "kratos.serviceAccountName" . }} + terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }} containers: - name: {{ .Chart.Name }} image: {{ include "kratos.image" . }} diff --git a/helm/charts/kratos/templates/deployment-watcher.yaml b/helm/charts/kratos/templates/deployment-watcher.yaml index 0980ebbe5c..39ba0a4361 100644 --- a/helm/charts/kratos/templates/deployment-watcher.yaml +++ b/helm/charts/kratos/templates/deployment-watcher.yaml @@ -44,6 +44,7 @@ spec: securityContext: {{- toYaml . | nindent 8 }} {{- end }} + terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }} containers: - name: watcher {{- if .Values.securityContext }} diff --git a/helm/charts/kratos/templates/statefulset-mail.yaml b/helm/charts/kratos/templates/statefulset-mail.yaml index 1f953200ea..bbebdb29f5 100644 --- a/helm/charts/kratos/templates/statefulset-mail.yaml +++ b/helm/charts/kratos/templates/statefulset-mail.yaml @@ -52,6 +52,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + terminationGracePeriodSeconds: {{ .Values.statefulSet.terminationGracePeriodSeconds }} containers: - name: {{ include "kratos.fullname" . }}-courier image: {{ include "kratos.image" . }} diff --git a/helm/charts/kratos/values.yaml b/helm/charts/kratos/values.yaml index 92c56bf078..8e1bfc8daf 100644 --- a/helm/charts/kratos/values.yaml +++ b/helm/charts/kratos/values.yaml @@ -339,6 +339,8 @@ deployment: # https://github.com/kubernetes/kubernetes/issues/57601 automountServiceAccountToken: true + terminationGracePeriodSeconds: 60 + # -- Specify pod metadata, this metadata is added directly to the pod, and not higher objects podMetadata: # -- Extra pod level labels @@ -471,6 +473,8 @@ statefulSet: # -- Number of revisions kept in history revisionHistoryLimit: 5 + terminationGracePeriodSeconds: 60 + ## -- Pod level security context podSecurityContext: fsGroupChangePolicy: "OnRootMismatch" diff --git a/helm/charts/oathkeeper-maester/templates/deployment.yaml b/helm/charts/oathkeeper-maester/templates/deployment.yaml index 71599aeb13..2702ba54dc 100644 --- a/helm/charts/oathkeeper-maester/templates/deployment.yaml +++ b/helm/charts/oathkeeper-maester/templates/deployment.yaml @@ -46,6 +46,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" @@ -88,7 +89,6 @@ spec: securityContext: {{- toYaml . | nindent 8 }} {{- end }} - terminationGracePeriodSeconds: 10 {{- with .Values.priorityClassName }} priorityClassName: {{ . }} {{- end }} diff --git a/helm/charts/oathkeeper-maester/values.yaml b/helm/charts/oathkeeper-maester/values.yaml index 1de42d13f5..39f7264718 100644 --- a/helm/charts/oathkeeper-maester/values.yaml +++ b/helm/charts/oathkeeper-maester/values.yaml @@ -113,6 +113,7 @@ deployment: # https://github.com/kubernetes/kubernetes/issues/57601 # This applications connects to the k8s API and requires the permissions automountServiceAccountToken: true + terminationGracePeriodSeconds: 60 # -- Specify pod metadata, this metadata is added directly to the pod, and not higher objects podMetadata: # -- Extra pod level labels diff --git a/helm/charts/oathkeeper/templates/deployment-controller.yaml b/helm/charts/oathkeeper/templates/deployment-controller.yaml index 219d6eb6ce..b2e35ca343 100644 --- a/helm/charts/oathkeeper/templates/deployment-controller.yaml +++ b/helm/charts/oathkeeper/templates/deployment-controller.yaml @@ -73,6 +73,7 @@ spec: {{- if .Values.deployment.extraInitContainers }} {{- tpl .Values.deployment.extraInitContainers . | nindent 8 }} {{- end }} + terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/helm/charts/oathkeeper/templates/deployment-sidecar.yaml b/helm/charts/oathkeeper/templates/deployment-sidecar.yaml index de21179ecf..f41d693b72 100644 --- a/helm/charts/oathkeeper/templates/deployment-sidecar.yaml +++ b/helm/charts/oathkeeper/templates/deployment-sidecar.yaml @@ -83,6 +83,7 @@ spec: {{- if .Values.deployment.extraInitContainers }} {{- tpl .Values.deployment.extraInitContainers . | nindent 8 }} {{- end }} + terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/helm/charts/oathkeeper/values.yaml b/helm/charts/oathkeeper/values.yaml index 7ebeae3efe..a8fe8f5ca8 100644 --- a/helm/charts/oathkeeper/values.yaml +++ b/helm/charts/oathkeeper/values.yaml @@ -286,6 +286,8 @@ deployment: # https://github.com/kubernetes/kubernetes/issues/57601 automountServiceAccountToken: false + terminationGracePeriodSeconds: 60 + # -- Node labels for pod assignment. nodeSelector: {} # If you do want to specify node labels, uncomment the following