Skip to content

Commit 7d9a4cf

Browse files
committed
Added Liveness Probe and Readiness Probe
1 parent 30d3a22 commit 7d9a4cf

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

manifests/kubernetes/notification-mysql.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,32 @@ spec:
4343
image: manojmdocker14/microforge-notifications-mysql:v1.0.0
4444
ports:
4545
- containerPort: 3306
46+
startupProbe:
47+
exec:
48+
command:
49+
- bash
50+
- "-c"
51+
- "mysqladmin ping -u root -p$MYSQL_ROOT_PASSWORD"
52+
initialDelaySeconds: 15 # Wait 15s before starting the first check
53+
periodSeconds: 10 # Check every 10s
54+
failureThreshold: 30 # Allow 30 failures (Total 5 minutes of boot time)
55+
livenessProbe:
56+
exec:
57+
command:
58+
- bash
59+
- "-c"
60+
- "mysqladmin ping -u root -p$MYSQL_ROOT_PASSWORD"
61+
periodSeconds: 20
62+
timeoutSeconds: 5
63+
readinessProbe:
64+
exec:
65+
command:
66+
- bash
67+
- "-c"
68+
- "mysql -u root -p$MYSQL_ROOT_PASSWORD -e 'SELECT 1;'"
69+
initialDelaySeconds: 5
70+
periodSeconds: 10
71+
timeoutSeconds: 10
4672
envFrom:
4773
- configMapRef:
4874
name: notification-mysql-config

0 commit comments

Comments
 (0)