88 lines
3.0 KiB
Diff
88 lines
3.0 KiB
Diff
From a8ef0407811373b98a91be7787fcdcca18c76e23 Mon Sep 17 00:00:00 2001
|
|
From: "Hu, Yong" <yong.hu@intel.com>
|
|
Date: Tue, 17 Dec 2019 15:11:13 +0000
|
|
Subject: [PATCH] Enable override of mariadb-server probe parameters
|
|
|
|
Parameters are exported for startupProbe and readinessProbe.
|
|
They are set with the default values, and might be overridden in
|
|
some special cases. For example, some cases require more times
|
|
of "readinessProbe" failure before the peer mariadb-server node is
|
|
recovered. Other cases, in which the regular readiness probe cannot
|
|
be performed because only one signle mariadb-server exists, have to
|
|
take use of "startupProbe" to ensure the WSREP status are ready.
|
|
For all these exceptional cases above, which are different from the
|
|
default mariadb cluster with 3 nodes, we have to export the probe
|
|
parameters and override the related probe pareameters.
|
|
|
|
Signed-off-by: Hu, Yong <yong.hu@intel.com>
|
|
Co-Authored-By: Zhipeng, Liu <zhipengs.liu@intel.com>
|
|
---
|
|
mariadb/templates/statefulset.yaml | 16 +++++++++-------
|
|
mariadb/values.yaml | 16 ++++++++++++++++
|
|
2 files changed, 25 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/mariadb/templates/statefulset.yaml b/mariadb/templates/statefulset.yaml
|
|
index 66d5339..9e3d37d 100644
|
|
--- a/mariadb/templates/statefulset.yaml
|
|
+++ b/mariadb/templates/statefulset.yaml
|
|
@@ -14,6 +14,13 @@ See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/}}
|
|
|
|
+{{- define "mariadbReadinessProbe" }}
|
|
+exec:
|
|
+ command:
|
|
+ - /tmp/readiness.sh
|
|
+{{- end }}
|
|
+
|
|
+
|
|
{{- if .Values.manifests.statefulset }}
|
|
{{- $envAll := . }}
|
|
|
|
@@ -170,13 +177,8 @@ spec:
|
|
exec:
|
|
command:
|
|
- /tmp/stop.sh
|
|
- readinessProbe:
|
|
- initialDelaySeconds: 30
|
|
- periodSeconds: 30
|
|
- timeoutSeconds: 3
|
|
- exec:
|
|
- command:
|
|
- - /tmp/readiness.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" "startup" "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 b913636..c7a70d2 100644
|
|
--- a/mariadb/values.yaml
|
|
+++ b/mariadb/values.yaml
|
|
@@ -59,6 +59,22 @@ labels:
|
|
node_selector_value: enabled
|
|
|
|
pod:
|
|
+ probes:
|
|
+ server:
|
|
+ mariadb:
|
|
+ readiness:
|
|
+ enabled: true
|
|
+ params:
|
|
+ initialDelaySeconds: 30
|
|
+ periodSeconds: 30
|
|
+ timeoutSeconds: 15
|
|
+ failureThreshold: 3
|
|
+ startup:
|
|
+ enabled: false
|
|
+ params:
|
|
+ initialDelaySeconds: 30
|
|
+ periodSeconds: 30
|
|
+ failureThreshold: 3
|
|
security_context:
|
|
server:
|
|
pod:
|
|
--
|
|
2.7.4
|
|
|