mariadb-container icon indicating copy to clipboard operation
mariadb-container copied to clipboard

Example Template Liveness/Readiness Probe Errors

Open strangiato opened this issue 3 years ago • 0 comments

The following Maria DB Templates have an incorrectly configured liveness/readiness probe:

  • https://github.com/sclorg/mariadb-container/blob/master/examples/mariadb-ephemeral-template.json
  • https://github.com/sclorg/mariadb-container/blob/master/examples/mariadb-persistent-template.json

When the probes are executed the following warning is logged in the pod:

2021-05-03 20:19:23 29 [Warning] Access denied for user 'userHFP'@'localhost' (using password: YES)
2021-05-03 20:19:27 30 [Warning] Access denied for user 'userHFP'@'localhost' (using password: YES)
2021-05-03 20:19:33 31 [Warning] Access denied for user 'userHFP'@'localhost' (using password: YES)

The probe should be two commands seperated by ; or &&:

"command": [
	"/bin/sh",
	"-i",
	"-c",
	"MYSQL_PWD=\"$MYSQL_PASSWORD\" && mysqladmin -u $MYSQL_USER ping"
]

Executing the command manually generates the following for the current probe:

sh-4.4$ MYSQL_PWD=\"$MYSQL_PASSWORD\" mysqladmin -u $MYSQL_USER ping
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'dbuser'@'localhost' (using password: YES)'

With the correction:

sh-4.4$ MYSQL_PWD=\"$MYSQL_PASSWORD\" && mysqladmin -u $MYSQL_USER ping
mysqld is alive

strangiato avatar May 03 '21 20:05 strangiato