본문 바로가기
MLOps/Doker & Kubernetes

Udemy CKA 강의 정리 111: Solution - Multi Container PODs (optional)

by 공부하는 무니 2023. 1. 13.
반응형

해당 내용은 Udemy의 Certified Kubernetes Administrator (CKA) with Practice Tests 강의를 공부한 내용입니다. 내용을 그대로 번역하기보다는, 제가 이해하기 쉬운 대로 수정한 부분들이 있습니다.

⚠️ 영어 독해가 많이 부족합니다. 틀린 내용이 있으면 알려주시면 감사하겠습니다.


Q1. Identify the number of containers created in the red pod.

$ kubectl get pod red

Q2. Identify the name of the containers running in the blue pod.

 $ kubectl describe pod blue

Q3. Create a multi-container pod with 2 containers. Use the spec given below. If the pod goes into the crashloopbackoff then add the command sleep 1000 in the lemon container.

  • Name: yellow

  • Container 1 Name: lemon

  • Container 1 Image: busybox

  • Container 2 Name: gold

  • Container 2 Image: redis

$ kubectl create -f /var/answers/answer-yellow.yaml

Q4. We have deployed an application logging stack in the elastic-stack namespace. Inspect it.

$ kubectl get pods -n elastic-stack

Q5. Once the pod is in a ready state, inspect the Kibana UI using the link above your terminal. There shouldn't be any logs for now.

 

Q6. Inspect the app pod and identify the number of containers in it.

$ kubectl describe pod -n elastic-stack

Q7. The application outputs logs to the file /log/app.log. View the logs and try to identify the user having issues with Login.

$ kubectl -n elastic-stack exec -it app cat /log/app.log

Q8. Edit the pod to add a sidecar container to send logs to Elastic Search. Mount the log volume to the sidecar container.

/var/answers/answer-app.yaml

 

Q9. Inspect the Kibana UI. You should now see logs appearing in the Discover section.

반응형

댓글