일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- 취뽀
- Pub/Sub
- 도커
- spring boot
- docker
- fork()
- 개발
- 의존성주입
- 제어의역전
- k8s
- 코테
- tech
- 운영체제
- zookeeper
- 개발자
- 인프라
- Kafka
- 쿠버네티스
- Data Engineering
- OS
- 스프링빈
- 컴퓨터 구조
- it
- Kubernetes
- 시스템호출
- 데이터엔지니어
- CNS
- Context Switching
- POJO
- 커널
Archives
- Today
- Total
모래성 말고 철옹성
[1분 쿠버네티스] ReadinessProbe와 LivenessProbe 본문
1분 쿠버네티스
Pod의 ReadinessProbe와 LivenessProbe
ReadinessProbe
- 컨테이너가 트래픽을 받을 준비가 되었는지를 결정
- 새로 Pod가 구동일 될 때 컨테이너 내부의 App(ex. tomcat)이 준비(Ready)되었는지 확인
LivenessProbe
- 컨테이너를 언제 재시작해야 하는지 결정
- Pod는 Running 상태이더라도 App(ex. tomcat)이 장애 상황이 있을 수 있는데, 이 상황에 App을 지속적으로 확인하여 Pod를 재기동
공통
- 설정 내용은 HttpGet, exec, TÇPSocket으로 공통된 속성으로 해당 App에 대한 상태체크
readiness sample code (tcpSocket)
apiVersion: v1
kind: Pod
metadata:
name: goproxy
labels:
app: goproxy
spec:
containers:
- name: goproxy
image: registry.k8s.io/goproxy:0.1
ports:
- containerPort: 8080
readinessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 15
periodSeconds: 10
livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 15
periodSeconds: 10
http liveness sample code (HttpGet)
apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: liveness-http
spec:
containers:
- name: liveness
image: registry.k8s.io/e2e-test-images/agnhost:2.40
args:
- liveness
livenessProbe:
httpGet:
path: /healthz
port: 8080
httpHeaders:
- name: Custom-Header
value: Awesome
initialDelaySeconds: 3
periodSeconds: 3
반응형
'쿠버네티스' 카테고리의 다른 글
[1분 쿠버네티스] 쿠버네티스 아키텍처 이해 (0) | 2025.03.28 |
---|---|
[1분 쿠버네티스] Service - ClusterIP, NodePort, LoadBalancer (0) | 2025.03.26 |
[1분 쿠버네티스] 쿠버네티스 QoS (0) | 2025.03.18 |
Comments