개인적으로 CKA(Certified Kubernetes Administrator) 시험을 준비하고 있는데, 이를 위해 개념 및 관련 문제를 정리하고자 한다.
1. 정의
- 1개 이상의 컨테이너가 함께 묶여서 동작하는 그룹
2. 특징
- 공유 네트워크
> Pod 내부 컨테이너들은 동일한 네트워크 네임스페이스를 공유
- 공유 스토리지
> Pod 에 Volume 을 붙이고 여러 컨테이너가 같은 Volume 을 마운트 해 사용
- 라이프사이클 단위
> Pod 는 하나의 단위로 생성되고 삭제됨
3. 관련 문제 (KodeKloud 에서 제공하는 샘플 문제를 정리)
- How many pods exist on the system?
> In the current(default) namespace.
kubectl get pods
- Create a new pod using the nginx image.
> Image name: nginx
kubectl run nginx-pod --image=nginx
- Which image is specified for the pods whose names begin with the newpods- prefix?
> You must look at one of the new pods in detail to figure this out.
kubectl get pods -o name | grep new pods
kubectl describe pod <pod-name>
- Which nodes are these pods placed on?
> You must look at all the pods in detail to figure this out.
kubectl get nodes
- We just created a new pod named webapp. How many containers are part of the webapp pod.
> Note: Ignore the state of the pod for now.
kubectl describe pod webapp
- What does the READY column in the output of the ‘kubectl get pods’ command indicate?
답) Running Containers in POD / Total Containers in POD
- Delete the webapp pod.
> Once deleted, wait for the pod to fully terminate.
kubectl delete pod webapp
- Create a new pod with the name ‘redis’ and the image ‘redis123’
> Use a pod-definition YAML file. And yes the image name is wrong!
kubectl run redis —image=redis123 --dry-run=client -o yaml > redis-definition.yaml
kubectl create -f redis-definition.yaml
- Now change the image on this pod to ‘redis’. - Once done, the pod should be in a running state.
(redis-definition.yaml 파일을 직접 수정 후) kubectl apply -f redis-definition.yaml
- Create a new pod called custom-nginx using the nginx image and run it on container port 8080.
kubectl run custom-nginx --image=nginx --port=8080
4. 출처
'IT > Kubernetes' 카테고리의 다른 글
| [CKA] PV(PersistentVolume) 란? (0) | 2025.11.22 |
|---|---|
| [CKA] StorageClass 란? (0) | 2025.11.21 |
| [CKA] PriorityClass 란? (0) | 2025.11.21 |
| [CKA] Deployment 란? (0) | 2025.11.21 |
| [CKA] ReplicaSet 이란? (0) | 2025.11.21 |