From 931ba39e8765e184d8edf10e40b7b27899fecae6 Mon Sep 17 00:00:00 2001 From: "Markin, Sergiy (sm515x)" Date: Wed, 25 May 2022 16:21:39 +0000 Subject: [PATCH] [MariaDB] Add liveness probe to restart a pod that got stuck in a transfer wsrep_local_state_comment Readiness probe that we currently have does not help with restarting a pod that got stuck in a transfer state reported by wsrep_local_state_comment. root@mariadb-server-2:/# mysql_status_query wsrep_ready OFF root@mariadb-server-2:/# mysql_status_query wsrep_connected ON root@mariadb-server-2:/# mysql_status_query wsrep_cluster_status non-Primary root@mariadb-server-2:/# mysql_status_query wsrep_local_state_comment Transfer So the idea is to add a liveness probe that will take care of this. Change-Id: I2ccecc75349667fe19c6f7f9dccc2dbbd17d0a5e --- mariadb/Chart.yaml | 2 +- mariadb/templates/statefulset.yaml | 1 + mariadb/values.yaml | 6 ++++++ releasenotes/notes/mariadb.yaml | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mariadb/Chart.yaml b/mariadb/Chart.yaml index c56ffc810..de965d53c 100644 --- a/mariadb/Chart.yaml +++ b/mariadb/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v10.2.31 description: OpenStack-Helm MariaDB name: mariadb -version: 0.2.24 +version: 0.2.25 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 33819f3e9..31d322b5c 100644 --- a/mariadb/templates/statefulset.yaml +++ b/mariadb/templates/statefulset.yaml @@ -200,6 +200,7 @@ spec: command: - /tmp/stop.sh {{ 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 "mariadbReadinessProbe" . | 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 9347aaeb0..6664b1d32 100644 --- a/mariadb/values.yaml +++ b/mariadb/values.yaml @@ -68,6 +68,12 @@ pod: initialDelaySeconds: 30 periodSeconds: 30 timeoutSeconds: 15 + liveness: + enabled: true + params: + initialDelaySeconds: 120 + periodSeconds: 30 + timeoutSeconds: 15 security_context: server: pod: diff --git a/releasenotes/notes/mariadb.yaml b/releasenotes/notes/mariadb.yaml index c5acf11ec..bece0b48f 100644 --- a/releasenotes/notes/mariadb.yaml +++ b/releasenotes/notes/mariadb.yaml @@ -40,4 +40,5 @@ mariadb: - 0.2.22 Fix ingress cluster role privileges - 0.2.23 Fix backup script by ignoring sys database for MariaDB 10.6 compartibility - 0.2.24 Uplift Mariadb-ingress to 1.2.0 + - 0.2.25 Add liveness probe to restart a pod that got stuck in a transfer wsrep_local_state_comment ...