인프런 워밍업 클럽 4기 - DevOps 2주차 Probe 미션 및 복습
1
Probe 응용과제 미션
[6-1] startupProbe가 실패 되도록 설정해서 Pod가 무한 재기동 상태가 되도록 설정
startup 헬스체크할 api 주소를 바꿈
아래 로그까지 뜨고 재시작됨


[6-2] 일시적 장애 상황(App 내부 부하 증가)가 시작 된 후, 30초 뒤에 트래픽이 중단되고, 3분 뒤에는 App이 재기동 되도록 설정해 보세요.
kubectl patch deployment api-tester-1231 -n anotherclass-123 --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/livenessProbe/periodSeconds", "value": 60}]'
livenessProbe의 헬스체크 조건을 1분에 한번 체크하고, 3번 실패를 임계값으로 두기

pod는 살아있지만 통신은 안됨 (readinessProbe 계속 실패, libenessProbe는 3분동안 3번 실패후 앱 리스타트)

[6-3] Secret 파일(/usr/src/myapp/datasource/postgresql-info.yaml)이 존재하는지 체크하는 readinessProbe를 만들어 보세요.
readinessProbe 헬스 체크 변경 ~ 2개의 파드가 떴다가 하나의 파드가 곧 사라지고 연결 잘됨
kubectl patch deployment api-tester-1231 \
-n anotherclass-123 \
--type='json' \
-p='[{"op": "replace", "path": "/spec/template/spec/containers/0/readinessProbe", "value": {"exec": {"command": ["test", "-f", "/usr/src/myapp/datasource/postgresql-info.yaml"]}, "periodSeconds": 10, "failureThreshold": 3}}]'만약에 없는 경로의 파일을 test -f 하게 세팅하면..

patch 명령시 파드가 다시 뜨며, 이전 파드가 계속 살아 있어 2개 파드가 뜸..
그런데 이전 파드를 죽이고 셀프힐링도중에 curl을 때리면, 아래와 같이 요청에러

Probe 복습

답변 1






답지 확인했는데, test -f 로 하니까 따로 이벤트 로그는 안남고. cat 으로 파일 확인하니 로그가 남네요!