HTTP 探针
HTTP 探针
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 15
periodSeconds: 10
failureThreshold: 3
timeoutSeconds: 2观察重启
观察重启
kubectl describe pod web-x | grep -i -A5 liveness
kubectl get pod web-x -o jsonpath='{.status.containerStatuses[0].restartCount}'/healthz 检查进程内部状态即可;数据库、下游依赖的不稳定适合放 readiness,不要放进 liveness。