MLOps/Doker & Kubernetes

Udemy CKA 강의 정리 42: Solution - Namespaces (Optional)

공부하는 무니 2023. 1. 5. 23:19
반응형

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

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


Q1. How many Namespaces exist on the system?

kubectl get namespaces 또는 kubectl get ns 로 확인합니다.

답: 10

Q2. How many pods exist in the researchnamespace?

kubectl get pods --namespace=research 또는 kubectl get pods -n=research 로 확인합니다.

답: 2

Q3. Create a POD in the financenamespace.

kubectl run redis --image=redis -n=finance 로 생성합니다.

Q4. Which namespace has the bluepod in it?

kubectl get pods --all-namespaces 커맨드로 확인할 수 있습니다.

답: marketing

Q5. Access the Blueweb application using the link above your terminal!!

Q6. What DNS name should the Blueapplication use to access the database db-servicein its own namespace - marketing?

marketing namespace에서 Blue 파드와 db-service 서비스를 확인합니다.

애플리케이션은 같은 네임스페이스에 있으면 그 이름을 사용하는 것만으로도 서비스에 액세스 할 수 있습니다.

인터페이스에서 테스트해봅시다.

답: db-service

Q7. What DNS name should the Blueapplication use to access the database db-servicein the devnamespace?

dev namespace에도 db-service라는 서비스가 있습니다.

Blue 애플리케이션은 네임스페이스가 다르기 때문에 dev에 있는 db-service에 접근하려면 네임스페이스 서비스가 포함된 전체 주소를 사용해야 합니다.

답: db-service.dev.svc.cluster.local

반응형