cka실습

CKA Part2

yomatozu 2025. 4. 22. 14:22

1. you can find an existing deployment frontend in production namespace, scale down the replicas to 2 and change the image to nginx:1.25

 

'production' 네임스페이스에 있는 frontend 디플로이먼트를 복제본 2개로 줄이고, 이미지 버전을 nginx:1.25로 변경하라.

 

k scale deploy frontend --replicas=2 -n production
k set image deploy frontend nginx=nginx:1.25-n production

 

 

2. Auto scale the existing deployment frontend in production namespace at 80% of pod CPU usage, and set Minimum replicas= 3 and Maximum replicas= 5

 

production 네임스페이스에 있는 frontend Deployment를, Pod CPU 사용량이 80%가 되도록 오토스케일링 설정하고, 최소 복제본 수는 3개, 최대 복제본 수는 5개로 설정하라.

k autoscale deploy frontend -n production --min=3 --max=5 --cpu-percent=80
k get hap -n production

 

 

3. Expose existing deployment in production namespace named as frontend through Nodeport and Nodeport service name should be frontendsvc

 

production-frontend을 nodeport로 expose할 수 있게하는 frontendsvc를 만들어라

 

k expose deploy frontend -n production --name=frontendsvc --port=80 --type=NodePort
k edit svc frontendsvc -n production // nodePort번호 31200으로 설정
k get svc frontendsvc -n production

'cka실습' 카테고리의 다른 글

CKA Part3  (0) 2025.04.22
CKA Part1  (0) 2025.04.22