클라우드 배우기
Kubernetes(K8S) 따배쿠 Pod : Pod 동작 flow - CentOS7 본문
# kubectl delete pod --all => 동작 중인 모든 파드 삭제
# kubectl get pods -o wide --watch => 파드 삭제를 한 줄씩 조회
master 창을 하나 더 열어 # kubectl create -f web.yaml 및 # kubectl delete -f web.yaml 실행
# kubectl edit pod web -> 동작 중인 파드 수정
따배쿠 문제
1. # kubectl get pod
2. # kubectl get pod --all-namespaces
3. # kubectl run nginx-pod --image nginx --port 80
4 & 8. # kubectl describe pod nginx-pod
5 ~ 7. # kubectl get pod -o wide
5. node 1
6. 1/1 => 1개
7. running
8. runnig => Pod 상태와 Container 상태는 상이, container 상태는 # kubectl describe pod nginx-pod
9. 현재 ready/ 전체 pod 수
10. # kubectl delete pod nginx-pod
11. # kubectl run redis123 --image httpd --port 80 --dry-run -o yaml => dry run 확인
# kubectl run redis123 --image httpd --port 80 --dry-run -o yaml > redis.yaml => yaml파일 생성
# kubectl create -f redis.yaml (=kubectl apply -f redis.yaml)
<<참고>>
필수 yaml 입력
(수정 전)
(수정 후)
apiVersion: v1
kind: Pod
metadata:
name: redis123
spec:
containers:
- image: httpd
name: redis123
<<참고 영상>>
https://youtu.be/nvBKnFfiy7M?si=Qf7j2WOyR06FBTLX
'kubernetes' 카테고리의 다른 글
Kubernetes(K8S) 따배쿠 Pod : init container & infra container - Centos7 (1) | 2023.10.14 |
---|---|
Kubernetes(K8S) livenessProbe를 이용해 self-healing Pod (1) | 2023.10.14 |
Kubernetes(K8S) 따배쿠 Container 정리와 Single / Multi Container Pod 생성 Centos7 (0) | 2023.10.11 |
Kubernetes(K8S) 따배쿠 yaml 템플릿 - Centos7 (0) | 2023.10.11 |
Kubernetes(K8S) 따배쿠 namespace - Centos7 (1) | 2023.10.09 |