Udemy의 Certified Kubernetes Administrator (CKA) with Practice Tests 강의의 30. ReplicaSets, 31. ReplicaSets - Solution (Optional) 챕터를 공부한 내용으로 강의 내용과 다를 수 있습니다. 정확한 내용은 강의를 들으시는 것을 추천드립니다.
https://uklabs.kodekloud.com/topic/practice-test-replicasets-2/ 에서 핸즈온을 사용 할 수 있다.
답변의 명령어를 통해 질문에서 원하는 답을 찾을 수 있다.
Q1. How many PODs exist on the system? In the current(default) namespace.
A. kubectl get pods
Q2. How many ReplicaSets exist on the system? In the current(default) namespace.
A. kubectl get replicasets
Q3. How about now? How many ReplicaSets do you see?
A. kubectl get replicasets
Q4. How many PODs are DESIRED in the new-replica-set?
A. kubectl get replicasets
Q5. What is the image used to create the pods in the new-replica-set?
A. kubectl describe replicaset new-replica-set
Q6. How many PODs are READY in the new-replica-set?
A. kubectl get replicasets
Q7. Why do you think the PODs are not ready?
A. kubectl get pods 이후 kubectl describe pods "pod 명"
Q8. Delete any one of the 4 PODs.
A. kubectl delete pods "pod 명"
Q9. How many PODs exist now?
A. kubectl get pods
Q10. Why are there still 4 PODs, even after you deleted one?
A. ReplicaSet ensures that desired number of PODs always run (replicaset이 4개의 pod를 유지하게 모니터링 중이라서)
Q11. Create a ReplicaSet using the replicaset-definition-1.yaml file located at /root/. There is an issue with the file, so try to fix it.
A. kubectl create -f replicaset-definition-1.yaml 명령어 사용해 어떤 에러가 발생하는지 본 뒤 하단과 같이 파일 수정
$ vim replicaset-definition-1.yml
apiVersion: apps/v1
Q12. Fix the issue in the replicaset-definition-2.yaml file and create a ReplicaSet using it. This file is located at /root/.
A. kubectl create -f replicaset-definition-2.yaml 명령어 사용해 어떤 에러가 발생하는지 본 뒤 하단과 같이 파일 수정
$ vim replicaset-definition-2.yml
metadata:
labels:
tier: frontend
Q13. Delete the two newly created ReplicaSets - replicaset-1 and replicaset-2
A. kubectl delete replicasets replicaset-1, kubectl delete replicasets replicaset-2
Q14. Fix the original replica set new-replica-setto use the correct busyboximage.
A. kubectl edit rs new-replica-set으로 replica set 설정 파일 수정(image: busybox) 후 모든 파드 삭제 후 재생성
Q15. Scale the ReplicaSet to 5 PODs.
A. kubectl scale --replicas=5 rs new-replica-set 혹은 kubectl edit rs new-replica-set으로 수정
Q16. Now scale the ReplicaSet down to 2 PODs. Use the kubectl scale command or edit the replicaset using kubectl edit replicaset.
A. kubectl scale --replicas=5=2 rs new-replica-set 혹은 kubectl edit rs new-replica-set으로 수정
'IT 강의 > 도커 쿠버' 카테고리의 다른 글
[CKA 강의 요약] Certification Tip! (0) | 2024.06.19 |
---|---|
[CKA 강의 요약] Deployments (0) | 2024.06.13 |
[CKA 강의 요약] Recap - ReplicaSets (0) | 2024.04.01 |
[CKA 강의 요약] Practice Test Introduction (0) | 2024.03.26 |
[CKA 강의 요약] Demo - Pods with YAML (0) | 2024.03.26 |