- 좋은 관리 기능이라고 다 적용하는 건 좋지 않음
- 어플리케이션 기능을 이해하고 적용하자
- probe도 얘 때문에 죽은 적이 있을 만큼 정확하게 이해하고 적용을 시켜야 되는 기술임
- 근데 진짜 중요한 기능이라 깊이 있게 다룰 거임
Pod(probe)- 프로브 기본 개념
Probe 예시
startupProbe
httpGet:
path: "/ready"
port: 8080
periodSeconds: 10
successThreshold: 1
failureThreshold: 10
- Pod가 만들어지자마자 probe가 동작 →
startupProbe
- 10초에 한 번씩(
periodSeconds) /ready라는 API를 App에 날림
- 기동 중에는 이게 계속 실패하지만,
- 10번 안에(
failreThreshold)
- 1번이라도 성공하면(
successThreshold)
startupProbe를 중단하고 다음으로 넘어감
readnessProbe
httpGet:
path: "/ready"
port: 8080
periodSeconds: 10
successThreshold: 1
failureThreshold: 2
livenessProbe
httpGet:
path: "/ready"
port: 8080
periodSeconds: 10
successThreshold: 1
failureThreshold: 2
- 계속해서
/ready라는 API를 App에 날림
- 앱이 살아있는 동안에는 200 OK 결과를 계속 리턴해줌
- readiness는 성공을 했을 때 외부 트래픽을 Pod가 받을 수 있는 상태로 만들어줌
- liveness는 App이 살아있는지를 계속 체크
- 앱에 장애가 나서 2번 이상 실패하면 재기동 시킴
실제 쓸 때는?
- 보통 startup의 실패 횟수만 조정해서 쓰는 경우가 많음
- 근데 readiness랑 liveness가 별도로 있는 이유가 있지 않을까?
- 각각의 probe마다 path랑 port가 다른 이유가 있겠지?
