Skip to content

Commit c2958b2

Browse files
committed
[UPDATE] - mysql health checks
1 parent 95baf72 commit c2958b2

File tree

1 file changed

+28
-38
lines changed

1 file changed

+28
-38
lines changed

04-wordpress-deployment/mysql.yaml

+28-38
Original file line numberDiff line numberDiff line change
@@ -44,52 +44,43 @@ spec:
4444
- name: mysql-config
4545
mountPath: /docker-entrypoint-initdb.d
4646
resources:
47-
requests:
48-
memory: "256Mi"
49-
cpu: "100m"
50-
limits:
51-
memory: "512Mi"
52-
cpu: "200m"
47+
requests:
48+
memory: "256Mi"
49+
cpu: "100m"
50+
limits:
51+
memory: "512Mi"
52+
cpu: "200m"
5353
startupProbe:
5454
exec:
55-
command:
56-
- /bin/bash
57-
- -ec
58-
- |
59-
password_aux="${MYSQL_ROOT_PASSWORD:-}"
60-
if [[ -f "${MYSQL_ROOT_PASSWORD_FILE:-}" ]]; then
61-
password_aux=$(cat "$MYSQL_ROOT_PASSWORD_FILE")
62-
fi
63-
mysqladmin status -uroot -p"${password_aux}"
64-
initialDelaySeconds: 60
55+
command:
56+
- /bin/bash
57+
- -ec
58+
- |
59+
password_aux="${MYSQL_ROOT_PASSWORD:-}"
60+
if [[ -f "${MYSQL_ROOT_PASSWORD_FILE:-}" ]]; then
61+
password_aux=$(cat "$MYSQL_ROOT_PASSWORD_FILE")
62+
fi
63+
mysqladmin status -uroot -p"${password_aux}"
64+
initialDelaySeconds: 80
6565
periodSeconds: 10
6666
failureThreshold: 30
6767
livenessProbe:
68-
exec:
69-
command:
70-
- /bin/bash
71-
- -ec
72-
- |
73-
password_aux="${MYSQL_ROOT_PASSWORD:-}"
74-
if [[ -f "${MYSQL_ROOT_PASSWORD_FILE:-}" ]]; then
75-
password_aux=$(cat "$MYSQL_ROOT_PASSWORD_FILE")
76-
fi
77-
mysqladmin status -uroot -p"${password_aux}"
68+
tcpSocket:
69+
port: 3306
7870
periodSeconds: 10
7971
timeoutSeconds: 5
80-
successThreshold: 1
8172
failureThreshold: 3
8273
readinessProbe:
8374
exec:
84-
command:
85-
- /bin/bash
86-
- -ec
87-
- |
88-
password_aux="${MYSQL_ROOT_PASSWORD:-}"
89-
if [[ -f "${MYSQL_ROOT_PASSWORD_FILE:-}" ]]; then
90-
password_aux=$(cat "$MYSQL_ROOT_PASSWORD_FILE")
91-
fi
92-
mysqladmin status -uroot -p"${password_aux}"
75+
command:
76+
- /bin/bash
77+
- -ec
78+
- |
79+
password_aux="${MYSQL_ROOT_PASSWORD:-}"
80+
if [[ -f "${MYSQL_ROOT_PASSWORD_FILE:-}" ]]; then
81+
password_aux=$(cat "$MYSQL_ROOT_PASSWORD_FILE")
82+
fi
83+
mysqladmin ping -uroot -p"${password_aux}"
9384
periodSeconds: 10
9485
timeoutSeconds: 5
9586
successThreshold: 1
@@ -101,7 +92,6 @@ spec:
10192
- name: mysql-volume
10293
persistentVolumeClaim:
10394
claimName: mysql-pvc
104-
10595
---
10696
apiVersion: v1
10797
kind: Service
@@ -115,4 +105,4 @@ spec:
115105
ports:
116106
- protocol: TCP
117107
port: 3306
118-
targetPort: 3306
108+
targetPort: 3306

0 commit comments

Comments
 (0)