Add liveliness and readiness probe to mysql-1-pvc spec
@@ -49,6 +49,18 @@ spec:
value: password
ports:
- containerPort: 3306
+ livenessProbe:
+ exec:
+ command: ["sh", "-c", "mysqladmin -u root -p$MYSQL_ROOT_PASSWORD ping"]
+ initialDelaySeconds: 70
+ periodSeconds: 10
+ timeoutSeconds: 5
+ readinessProbe:
+ exec:
+ command: ["sh", "-c", "mysql -u root -p$MYSQL_ROOT_PASSWORD -e \"select 1\""]
+ initialDelaySeconds: 60
+ periodSeconds: 10
+ timeoutSeconds: 5
volumeMounts:
- name: mysql-persistent-storage
mountPath: /var/lib/mysql
