Notice
Recent Posts
Recent Comments
Link
«   2024/07   »
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
more
Archives
Today
Total
관리 메뉴

JINIers

pod scale 본문

공부/Docker&K8S

pod scale

JINIers 2023. 2. 16. 15:44

사용중인 pod 스케일하기

일단 기존에 있던 pod 확인

kubectl get pod

NAME                  READY   STATUS    RESTARTS   AGE
tc-666dc7d777-j42ts   1/1     Running   0          31h
tc-666dc7d777-j4vg5   1/1     Running   0          30h
tc-666dc7d777-r28gv   1/1     Running   0          30h
tc-666dc7d777-tfsh8   1/1     Running   0          31h
tc-666dc7d777-v7fjs   1/1     Running   0          31h

5개나 있다..

이걸 3개로 줄여보자

 

pod scale

kubectl scale deploy tc --replicas=3

3개로 줄인 뒤에 get pod로 확인한다.

kubectl get pod -w

kubectl get pod

* -w 옵션을 붙이면 실시간으로 pod가 터미네이팅 되는걸 확인할 수 있음.

 

로드밸런싱 되는지 확인

kubectl exec [pod name] -- curl [cluster IP] -s

 

* 사용중인 모든 자원 삭제

kubectl delete all --all

Comments