WEBBOOK CHAPTER

CI/CD, 서버실에서 클라우드까지: 26장. Probe와 graceful shutdown을 배포 계약으로 만든다

26장. Probe와 graceful shutdown을 배포 계약으로 만든다

liveness는 재시작하면 회복되는 deadlock, readiness는 지금 traffic을 받을 수 있는지, startup은 느린 초기화를 구분한다. 모든 downstream 장애를 liveness 실패로 만들면 pod restart storm이 난다. readiness에서 필수 의존성 의미를 신중히 정한다.


readinessProbe:
  httpGet: { path: /ready, port: 8080 }
  periodSeconds: 5
livenessProbe:
  httpGet: { path: /live, port: 8080 }
  periodSeconds: 15

SIGTERM을 받으면 readiness를 내리고 새 요청을 막은 뒤 in-flight, queue lease, audit flush를 grace period 안에 마무리한다. load balancer propagation과 preStop sleep을 맹목적으로 복사하지 말고 측정한다.