Feat: add liveness probe

This commit is contained in:
2025-04-18 23:49:39 +08:00
parent d39349724a
commit 3df7a601b9
3 changed files with 20 additions and 0 deletions

View File

@@ -28,3 +28,9 @@ spec:
value: '0.0.0.0' value: '0.0.0.0'
- name: MONGO_CONNECTION_STRING - name: MONGO_CONNECTION_STRING
value: 'mongodb://cnd2025-mongo.cnd2025.svc.cluster.local:27017/todo' value: 'mongodb://cnd2025-mongo.cnd2025.svc.cluster.local:27017/todo'
livenessProbe:
httpGet:
path: /ping
port: 8888
initialDelaySeconds: 5
periodSeconds: 5

View File

@@ -21,3 +21,9 @@ spec:
ports: ports:
- name: http - name: http
containerPort: 80 containerPort: 80
livenessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 5
periodSeconds: 5

View File

@@ -21,3 +21,11 @@ spec:
ports: ports:
- name: mongo - name: mongo
containerPort: 27017 containerPort: 27017
livenessProbe:
exec:
command:
- mongosh
- --eval
- version()
initialDelaySeconds: 5
periodSeconds: 5