MLOps/Doker & Kubernetes

Udemy CKA 강의 정리 56: Solution - Labels and Selectors (Optional)

공부하는 무니 2023. 1. 6. 23:57
반응형

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

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


Q1. We have deployed a number of PODs. They are labelled with tierenvand bu. How many PODs exist in the devenvironment (env)?

파드가 많아서 세기 힘든 경우에는 아래와 같이 kubectl get pods --selector env=dev --no-headers | wc -l 커맨드를 사용하면 됩니다.

답: 7

Q2. How many PODs are in the financebusiness unit (bu)?

답: 6

Q3. How many objects are in the prodenvironment including PODs, ReplicaSets and any other objects?

kubectl get all --selector env=prod 로 확인할 수 있습니다.

답: 7

Q4. Identify the POD which is part of the prodenvironment, the financeBU and of frontendtier?

답: app-1-zzxdf

Q5. A ReplicaSet definition file is given replicaset-definition-1.yaml. Try to create the replicaset. There is an issue with the file. Try to fix it.

일단 한번 생성해보았습니다.

selector와 labels가 매칭되지 않는다고 나옵니다. yaml 파일을 수정해줍시다.

selector아래의 matchLabels와 template - metadata - labels가 일치하지 않습니다. 수정해줍니다.

yaml 파일을 저장하고 다시 생성합니다.

반응형