Kubernetes ‐ Probe - dnwls16071/Backend_Summary GitHub Wiki

📚 Probe

  • Probe는 컨테이너 상태를 확인하는 헬스체크 메커니즘이다.
  • Liveness Probe : 컨테이너가 살아있는지 확인, 실패 시 → 컨테이너 재시작

Liveness probes determine when to restart a container. For example, liveness probes could catch a deadlock when an application is running but unable to make progress.

  • Readiness Probe : 트래픽 받을 준비가 됐는지 확인, 실패 시 → Service에서 제외

Readiness probes determine when a container is ready to accept traffic. This is useful when waiting for an application to perform time-consuming initial tasks that depend on its backing services; for example: establishing network connections, loading files, and warming caches. Readiness probes can also be useful later in the container’s lifecycle, for example, when recovering from temporary faults or overloads.

  • Startup Probe : 초기 구동 완료 확인, 성공 전까지 다른 probe 비활성화 → 성공 후 Liveness Probe와 Readiness Probe는 동시에 활성화되며 지속적으로 애플리케이션 상태를 체크한다. 단, 성공하면 Startup Probe는 중지된다.

A startup probe verifies whether the application within a container is started. This can be used to adopt liveness checks on slow starting containers, avoiding them getting killed by the kubelet before they are up and running.

ports:
- name: liveness-port
  containerPort: 8080

livenessProbe:
  httpGet:
    path: /healthz
    port: liveness-port
  failureThreshold: 1
  periodSeconds: 10

startupProbe:
  httpGet:
    path: /healthz
    port: liveness-port
  failureThreshold: 30
  periodSeconds: 10

Kubernetes - Probe Sprint1. Probe 기능