From 0f9fc14d0fb43452f4f762217a0135f4b1a00357 Mon Sep 17 00:00:00 2001 From: Florian Streibelt Date: Fri, 11 Oct 2024 17:08:30 +0200 Subject: [PATCH] [mariadb] remove user and password from readyness and lifeness probes With the credentials for the root user present in /root/.my.cnf we do not need to give them as parameters for the probes, avoiding problems with shell escaping and showing passwords in the processlist of the k8s nodes. --- common/mariadb/templates/deployment.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/mariadb/templates/deployment.yaml b/common/mariadb/templates/deployment.yaml index 575f543f76..086d1efa5b 100644 --- a/common/mariadb/templates/deployment.yaml +++ b/common/mariadb/templates/deployment.yaml @@ -63,7 +63,7 @@ spec: lifecycle: postStart: exec: - command: ["sh", "-c", "while ! mysqladmin ping -uroot -p$MYSQL_ROOT_PASSWORD --silent; do sleep 1; done; mysql_upgrade"] + command: ["sh", "-c", "while ! mysqladmin ping --silent; do sleep 1; done; mysql_upgrade"] env: - name: MYSQL_ROOT_PASSWORD valueFrom: @@ -76,7 +76,7 @@ spec: {{- if .Values.livenessProbe.enabled }} livenessProbe: exec: - command: ["sh", "-c", "exec mysqladmin status -uroot -p$MYSQL_ROOT_PASSWORD"] + command: ["sh", "-c", "exec mysqladmin status"] initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.livenessProbe.periodSeconds }} timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} @@ -86,7 +86,7 @@ spec: {{- if .Values.readinessProbe.enabled }} readinessProbe: exec: - command: ["sh", "-c", "exec mysqladmin status -uroot -p$MYSQL_ROOT_PASSWORD"] + command: ["sh", "-c", "exec mysqladmin status"] initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.readinessProbe.periodSeconds }} timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}