From bb236e0a98860d007434eea62cedefd210b28029 Mon Sep 17 00:00:00 2001 From: Vasyl Saienko Date: Mon, 18 Nov 2024 12:13:52 +0000 Subject: [PATCH] [mariadb] Add terminationGracePeriodSeconds Allow to set terminationGracePeriodSeconds for server instace to let more time to shutdown all clients gracefully. Increase timeout to 600 seconds by default. Change-Id: I1f4ba7d5ca50d1282cedfacffbe818af7ccc60f2 --- mariadb/Chart.yaml | 2 +- mariadb/templates/statefulset.yaml | 7 ++++--- mariadb/values.yaml | 3 +++ releasenotes/notes/mariadb.yaml | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mariadb/Chart.yaml b/mariadb/Chart.yaml index e4db235430..5f52f503d4 100644 --- a/mariadb/Chart.yaml +++ b/mariadb/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v10.6.7 description: OpenStack-Helm MariaDB name: mariadb -version: 0.2.63 +version: 0.2.64 home: https://mariadb.com/kb/en/ icon: http://badges.mariadb.org/mariadb-badge-180x60.png sources: diff --git a/mariadb/templates/statefulset.yaml b/mariadb/templates/statefulset.yaml index 467a97ef38..2bb8fe4740 100644 --- a/mariadb/templates/statefulset.yaml +++ b/mariadb/templates/statefulset.yaml @@ -1,7 +1,7 @@ {{/* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. -Y may obtain a copy of the License at +You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @@ -126,6 +126,7 @@ spec: {{ if $envAll.Values.pod.tolerations.mariadb.enabled }} {{ tuple $envAll "mariadb" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} {{ end }} + terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.server.timeout }} nodeSelector: {{ .Values.labels.server.node_selector_key }}: {{ .Values.labels.server.node_selector_value }} initContainers: @@ -214,8 +215,8 @@ spec: containerPort: {{ tuple "oslo_db" "direct" "sst" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} command: - /tmp/start.py -{{ dict "envAll" . "component" "server" "container" "mariadb" "type" "readiness" "probeTemplate" (include "mariadbReadinessProbe" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }} -{{ dict "envAll" . "component" "server" "container" "mariadb" "type" "liveness" "probeTemplate" (include "mariadbLivenessProbe" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }} +{{ dict "envAll" . "component" "server" "container" "mariadb" "type" "readiness" "probeTemplate" (include "mariadbReadinessProbe" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }} +{{ dict "envAll" . "component" "server" "container" "mariadb" "type" "liveness" "probeTemplate" (include "mariadbLivenessProbe" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }} volumeMounts: - name: pod-tmp mountPath: /tmp diff --git a/mariadb/values.yaml b/mariadb/values.yaml index 9f6dfb138a..b74c57b8a9 100644 --- a/mariadb/values.yaml +++ b/mariadb/values.yaml @@ -170,6 +170,9 @@ pod: rolling_update: max_unavailable: 1 max_surge: 3 + termination_grace_period: + server: + timeout: 600 disruption_budget: mariadb: min_available: 0 diff --git a/releasenotes/notes/mariadb.yaml b/releasenotes/notes/mariadb.yaml index 823b0f41d4..82404742e3 100644 --- a/releasenotes/notes/mariadb.yaml +++ b/releasenotes/notes/mariadb.yaml @@ -79,4 +79,5 @@ mariadb: - 0.2.61 Avoid using deprecated isAlive() - 0.2.62 Implement mariadb upgrade during start - 0.2.63 Use service ip for endpoint discovery + - 0.2.64 Add terminationGracePeriodSeconds ...