inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

인프런 워밍업 스터디 클럽 4기 데브옵스 - 미션2 (Probe)

하얀종이개발자
1

Application 기능으로 이해하기 - Probe > 응용과제 [미션2]

 

Probe란?

Kubernetes에서 Probe는 컨테이너 상태를 체크하기 위한 매커니즘입니다.

 

응용1. startupProbe가 실패하도록 설정해서 Pod가 무한 재기동 상태가 되도록 하라

방법

startupProbe:
  httpGet:
    path: "/startup"
    port: 8080
  periodSeconds: 5
  failureThreshold: 1
readinessProbe:
  httpGet:
    path: "/readiness"
    port: 8080
  periodSeconds: 10
  failureThreshold: 3
livenessProbe:
  httpGet:
    path: "/liveness"
    port: 8080
  periodSeconds: 10
  failureThreshold: 3

 

결과


응용2. App이 부하로 인해 30초 뒤 트래픽이 중단되고, 3분 뒤 재기동 되게 하라

방법

livenessProbe:
  httpGet:
    path: "/liveness"
    port: 8080
  periodSeconds: 60
  failureThreshold: 3

 

결과


응용3. readinessProbe로 Secret 파일 존재 여부를 확인하라

방법

readinessProbe:
  exec:
    command: ["cat", "/usr/src/myapp/datasource/postgresql-info.yaml"]
  periodSeconds: 10
  failureThreshold: 3

결과


 

미션2 소감

Kubernetes의 Probe는 단순한 헬스체크가 아닌, 운영자의 철학을 반영하여 정교하게 확인하는 것을 알게 되었음
오동작보다 무서운 것은 오동작을 감지하지 못하는 것이고, Probe는 그 위험을 미연에 막아주는 역할

백엔드 일프로 쿠버네티스 데브옵스 워밍업클럽

답변 0