[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
This commit is contained in:
Markin, Sergiy (sm515x) 2022-05-25 16:21:39 +00:00
parent 9be2ea22a0
commit 931ba39e87
4 changed files with 9 additions and 1 deletions

View File

@ -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:

View File

@ -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

View File

@ -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:

View File

@ -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
...