일프로 미션2 Probe
2개월 전
▶ 응용1 : startupProbe가 실패 되도록 설정해서 Pod가 무한 재기동 상태가 되도록 설정해 보세요.
startupProbe의 failureThreshold를 '1'로 설정하면 "/startup"이 가동전 호출로 실패라 인지하고
Pod를 재가동하게 됩니다.
startupProbe:
httpGet:
path: "/startup"
port: 8080
periodSeconds: 5
failureThreshold: 1
재가동 스샷
▶ 응용2 : 일시적 장애 상황(App 내부 부하 증가)가 시작 된 후, 30초 뒤에 트래픽이 중단되고, 3분 뒤에는 App이 재기동 되도록 설정해 보세요.
startupProbe 는 정상적인 설정으로 변경
startupProbe:
httpGet:
path: "/startup"
port: 8080
periodSeconds: 5
failureThreshold: 30
readinessProbe 실패시 서비스 재연결을 함
readinessProbe:
httpGet:
path: "/readiness"
port: 8080
periodSeconds: 10
failureThreshold: 3 # 30s
livenessProbe 실패시 Pod를 재기동함
livenessProbe:
httpGet:
path: "/liveness"
port: 8080
periodSeconds: 60
failureThreshold: 3 # 3m
terminal에서 아래 명령어 실행
// 부하 증가 API - (App 내부 isAppReady와 isAppLive를 False로 바꿈)
curl http://192.168.56.30:31231/server-load-on
Pod 재시작 모습
▶ 응용3 : Secret 파일(/usr/src/myapp/datasource/postgresql-info.yaml)이 존재하는지 체크하는 readinessProbe를 만들어 보세요.
readinessProbe에 없는 파일로 설정하여 에러 발생
readinessProbe:
exec:
command: ["cat", "/usr/src/myapp/datasource/postgresql-infoa.yaml"]
periodSeconds: 10
failureThreshold: 3
이벤트 확인
댓글을 작성해보세요.