Summary#
K8s 헬스 프로브 3종은 실패 시 동작이 다르다: liveness는 컨테이너 재시작, readiness는 Service endpoint/트래픽에서 제외, startup은 느린 초기화 동안 liveness/readiness 판단을 지연시키는 용도다. liveness를 과도하게 민감하게 잡거나 외부 의존성(DB 등)을 포함하면 일시적 지연이 재시작 루프를 유발할 수 있다.
Outcome#
| 프로브 | 실패 시 동작 | 언제 사용 | 주의 |
|---|---|---|---|
| liveness | 컨테이너 재시작 | 교착 상태·완전 멈춤·복구 불가능 상태 감지 | 외부 의존성 체크 금지, 임계값 보수적으로 설정 |
| readiness | Service endpoint에서 제거되어 트래픽 차단 | 초기화 중, DB 연결 대기, 배치/백프레셔 중 | 재시작 없음, 트래픽 제어 용도 |
| startup | 성공 전까지 liveness/readiness 판단 지연 | 느린 앱, JVM 워밍업, 큰 캐시 로딩 | failureThreshold × periodSeconds를 최대 초기화 시간으로 설계 |
FastAPI 실전 예#
livenessProbe:
httpGet:
path: /health/live # 프로세스 생존만 확인: 단순 200 권장
port: 8000
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 3 # 30초 연속 실패 시 재시작
readinessProbe:
httpGet:
path: /health/ready # DB 연결·캐시 준비 등 트래픽 수용 가능성 확인
port: 8000
periodSeconds: 5
failureThreshold: 2
startupProbe:
httpGet:
path: /health/live # 보통 liveness와 같은 가벼운 체크를 재사용 가능
port: 8000
failureThreshold: 30 # 최대 300초 (30 × 10s) 대기
periodSeconds: 10
Key Points#
- liveness probe에 DB 쿼리 포함 금지: DB 지연이 애플리케이션 재시작 루프를 유발할 수 있다.
- readiness failure는 재시작하지 않는다: Pod는 실행 상태로 남고 Service endpoint/로드밸런싱 대상에서만 제외된다.
- startup probe는 느린 시작을 위한 안전장치: 성공 전까지 liveness/readiness 실패 판정을 막아
initialDelaySeconds추측을 줄인다. - 엔드포인트는 보통
/health/live(간단),/health/ready(의존성/준비 상태) 2개면 충분하다./health/startup을 별도로 둘 수는 있지만 필수는 아니며, startupProbe는/health/live같은 가벼운 체크를 재사용해도 된다.
Caveats#
- readiness는 트래픽 차단 장치이지 전체 배포의 무중단을 단독 보장하지 않는다.
- Deployment 롤링 업데이트의 가용성은 주로
maxUnavailable,maxSurge, readiness probe,minReadySeconds조합으로 설계한다. - PodDisruptionBudget(PDB)은 노드 드레인 등 voluntary disruption에 대한 안전망으로 유용하지만, readiness failure 자체나 Deployment rollout 가용성을 단독으로 해결하는 장치는 아니다.
- liveness
failureThreshold/timeoutSeconds가 너무 낮으면 순간적인 CPU 폭주, GC pause, 네트워크 지연에도 정상 Pod가 재시작될 수 있다.
Related Vault Evidence#
personal_vault/projects/gemma-agent/k8s-liveness-readiness-probes/evidence.md: readiness는 Pod IP를 Service endpoint에서 제거하고, liveness는 컨테이너 재시작을 유발한다는 동일 핵심을 설명한다.personal_vault/knowledge/dev/kubernetes-advanced.md: PDB, rollout, 운영 안정성 관련 Kubernetes 운영 맥락을 제공한다.
Sagwan Revalidation 2026-05-06T08:31:02Z#
- verdict:
ok - note: Kubernetes probe 동작과 권장 기준이 현재 practice와 일치함
Sagwan Revalidation 2026-05-07T08:58:17Z#
- verdict:
ok - note: K8s 프로브 동작과 권장 분리는 최신 practice와 여전히 일치함
Sagwan Revalidation 2026-05-08T09:00:07Z#
- verdict:
ok - note: K8s 프로브 동작과 권장 기준이 현재 practice와 일치한다.
Sagwan Revalidation 2026-05-09T09:27:40Z#
- verdict:
ok - note: K8s probe 동작과 권장안이 현재 관행과 문서에 부합한다.
Sagwan Revalidation 2026-05-10T10:29:25Z#
- verdict:
ok - note: K8s 프로브 동작과 권장 practice가 현재도 유효하다.
Sagwan Revalidation 2026-05-11T10:46:59Z#
- verdict:
ok - note: K8s 프로브 동작과 권장 practice가 현재 문서 기준과 일치합니다.
Sagwan Revalidation 2026-05-12T10:59:14Z#
- verdict:
ok - note: K8s probe 동작과 권장 분리 원칙은 현재 문서·실무와 부합함
Sagwan Revalidation 2026-05-13T11:20:32Z#
- verdict:
ok - note: Kubernetes probe 동작과 권장 분리 기준이 현재 practice와 일치함
Sagwan Revalidation 2026-05-14T11:43:08Z#
- verdict:
ok - note: K8s probe 동작과 권장 기준은 현재 practice와 문서에 부합한다.
Sagwan Revalidation 2026-05-15T11:50:09Z#
- verdict:
ok - note: [chatgpt HTTP 503] upstream connect error or disconnect/reset before headers. reset reason: connection termination
Sagwan Revalidation 2026-05-16T12:07:06Z#
- verdict:
ok - note: K8s 프로브 동작과 권장 관행이 현재 문서·실무와 일치한다.
Sagwan Revalidation 2026-05-17T12:33:01Z#
- verdict:
ok - note: K8s 프로브 동작·권장안이 현재 문서와 practice에 부합함
Sagwan Revalidation 2026-05-18T12:57:23Z#
- verdict:
ok - note: K8s 프로브 동작과 권장안이 현재 문서·실무와 일치한다.
Sagwan Revalidation 2026-05-19T13:26:44Z#
- verdict:
ok - note: K8s 프로브 동작과 권장 관행이 현재 문서·실무와 부합한다.
Sagwan Revalidation 2026-05-20T13:49:50Z#
- verdict:
ok - note: K8s 프로브 동작과 권장 패턴이 현재 문서·실무와 일치한다.
Sagwan Revalidation 2026-05-21T14:26:04Z#
- verdict:
ok - note: K8s 프로브 동작·권장 기준이 현재 문서와 practice에 부합함
Sagwan Revalidation 2026-05-22T14:59:29Z#
- verdict:
ok - note: 프로브 동작과 권장 기준이 현재 Kubernetes practice와 여전히 부합함
Sagwan Revalidation 2026-05-23T15:37:12Z#
- verdict:
ok - note: Kubernetes 프로브 동작과 권장 패턴이 현재 문서·실무와 일치함
Sagwan Revalidation 2026-05-24T15:50:03Z#
- verdict:
ok - note: K8s probe 동작과 권장 분리 기준이 현재 practice와 일치합니다.
Sagwan Revalidation 2026-05-25T17:03:09Z#
- verdict:
ok - note: Kubernetes 프로브 동작과 권장 관행이 현재도 유효하다.
Sagwan Revalidation 2026-05-26T17:06:41Z#
- verdict:
ok - note: K8s 프로브 동작·권장안이 현재 practice와도 부합한다.
Sagwan Revalidation 2026-05-27T17:22:54Z#
- verdict:
ok - note: Kubernetes 프로브 동작과 권장 분리 기준이 현재 practice와 일치함
Sagwan Revalidation 2026-05-28T18:07:36Z#
- verdict:
ok - note: K8s probe 동작과 권장안이 현재 practice와 일치한다.
Sagwan Revalidation 2026-05-29T18:38:22Z#
- verdict:
ok - note: K8s probe 동작과 권장 분리 기준이 현재 practice와 일치합니다.
Sagwan Revalidation 2026-05-30T18:39:26Z#
- verdict:
ok - note: K8s 프로브 동작·권장 분리 기준이 현재 관행과 맞아 변경 불필요.
Sagwan Revalidation 2026-06-01T01:20:47Z#
- verdict:
ok - note: [chatgpt HTTP 401] {
Sagwan Revalidation 2026-06-02T01:31:56Z#
- verdict:
ok - note: K8s probe 동작과 권장 분리 기준이 현재 practice와 일치한다.
Sagwan Revalidation 2026-06-03T02:13:15Z#
- verdict:
ok - note: K8s 프로브 동작과 권장 practice 모두 현재 기준으로도 유효함
Sagwan Revalidation 2026-06-04T02:16:26Z#
- verdict:
ok - note: K8s 프로브 동작과 권장안이 현행 문서·practice와 부합함
Sagwan Revalidation 2026-06-05T02:43:36Z#
- verdict:
ok - note: K8s 프로브 동작과 권장 practice가 현재 문서 기준으로도 유효함