IT 강의/도커 쿠버

[CKA 강의 요약] Practice Test Introduction

rnany 2024. 3. 26. 21:32

Udemy의 Certified Kubernetes Administrator (CKA) with Practice Tests  강의의 24. Practice Test Introduction ~ 28. Practice Test - Solution (Optional)챕터를 공부한 내용으로 강의 내용과 다를 수 있습니다. 정확한 내용은 강의를 들으시는 것을 추천드립니다.


https://uklabs.kodekloud.com/courses/labs-certified-kubernetes-administrator-with-practice-tests/ 에서 핸즈온을 사용 할 수 있다.

 

답변의 명령어를 통해 질문에서 원하는 답을 찾을 수 있다.

 

Q1. How many pods exist on the system? In the current(default) namespace.
A. kubectl get pods

Q2. Create a new pod with the nginx image.
Image name: nginx
A. kubectl run nginx --image nginx

Q3. How many pods are created now? Note: We have created a few more pods. So please check again.
A. kubectl get pods

Q4. What is the image used to create the new pods? You must look at one of the new pods in detail to figure this out.

A. kubectl describe pod newpods

Q5. Which nodes are these pods placed on? You must look at all the pods in detail to figure this out.
A. kubectl describe pod newpods |grep Node

Q6. How many containers are part of the pod webapp? Note: We just created a new POD. Ignore the state of the POD for now.
A. kubectl describe pod webapp

Q7. What images are used in the new webapp pod? You must look at all the pods in detail to figure this out.
A. kubectl describe pod webapp

Q8. What is the state of the container agentx in the pod webapp? Wait for it to finish the ContainerCreating state
A. kubectl describe pod webapp


Q9. Why do you think the container agentx in pod webapp is in error? Try to figure it out from the events section of the pod.

A. kubectl describe pod webapp

Q10. What does the READY column in the output of the kubectl get pods command indicate?
A. ready container / total container

Q11. Delete the webapp Pod. Once deleted, wait for the pod to fully terminate.
A. kubectl delete pod webapp

Q12. Create a new pod with the name redis and with the image redis123. Use a pod-definition YAML file. And yes the image name is wrong!
A. kubectl run redis --image redis123  --dry-run=client -o yaml  > redis.yaml


-- dry-run은 실제 오브젝트를 만들지 않고 작업하는 옵션이다.

-o yaml을 붙이면 yaml 형식으로 출력 된다.

이를 >를 통해 원하는 yaml 파일을 만들 수 있다.


Q13. Now change the image on this pod to redis. Once done, the pod should be in a running state.

A. kubectl delete pod redis

    kubectl run redis --image redis