livenessProbe:
exec:
command: ["cat", "/tmp/healthy"]
initialDelaySeconds: 5 # 첫 probe까지 대기
periodSeconds: 5 # 이후 검사 주기
/tmp/healthy를 삭제하면, cat 명령이 실패 → kubelet이 컨테이너를 kill하고 재시작failureThreshold(기본 3) 연속 실패해야 컨테이너가 kill됨livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 3
periodSeconds: 3
HTTP_PROXY 등)는 liveness probe에 영향을 주지 않음 (v1.13+)livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 15
periodSeconds: 10
livenessProbe:
grpc:
port: 2379
initialDelaySeconds: 10
-tls 등)port에 숫자 대신 이름으로 참조 가능ports:
- name: liveness-port
containerPort: 8080
livenessProbe:
httpGet:
path: /healthz
port: liveness-port # 포트 번호 대신 이름
failureThreshold * periodSeconds 경과 후 컨테이너 kill → restartPolicy에 따라 재시작startupProbe:
httpGet:
path: /healthz
port: liveness-port
failureThreshold: 30 # 최대 30번 시도
periodSeconds: 10 # 10초 간격 → 최대 300초(5분) 대기
livenessProbe:
httpGet:
path: /healthz
port: liveness-port
failureThreshold: 1 # startup 이후엔 빠르게 감지
periodSeconds: 10
initialDelaySeconds를 길게 잡아야 해서, 초기화 완료 후에도 deadlock 감지가 느려지는 딜레마 발생readinessProbereadinessProbe:
exec:
command: ["cat", "/tmp/healthy"]
initialDelaySeconds: 5
periodSeconds: 5
initialDelaySeconds나 startupProbe를 사용