Core Concepts - Namespaces

Ju Young Pang

·

2025. 1. 16. 18:05

Q) How many pods exist in the research namespace?

$ k get po -n research
NAME    READY   STATUS             RESTARTS      AGE
dna-1   0/1     CrashLoopBackOff   4 (86s ago)   3m2s
dna-2   0/1     CrashLoopBackOff   4 (87s ago)   3m2s

$ k get po -n research | wc -l
3

A) 2

 

Q) Create a POD in the finance namespace.

Name: redis
Image name: redis

$ k run redis --image=redis -n finance
pod/redis created

 

Q) Which namespace has the blue pod in it?

$ k get po -A | grep blue
marketing       blue             1/1     Running            0             6m16s

A) marketing

 

Q) What DNS name should the Blue application use to access the database db-service in its own namespace - marketing?

A) db-service

Application은 같은 namespace안에 있는 서비스를 그냥 서비스 이름으로 접근할 수 있다

 

Q) What DNS name should the Blue application use to access the database db-service in the dev namespace?

A) db-service.dev.svc.cluster.local

 

'Kubernetes > CKA' 카테고리의 다른 글

Core Concepts - Imperative Commands  (0) 2025.01.18
Core Concepts - Services  (0) 2025.01.16
Core Concepts - Deployments  (0) 2025.01.16
Core Concepts - ReplicaSets  (0) 2025.01.16
Core concepts - PODs  (0) 2025.01.16