Notice
Recent Posts
Recent Comments
Link
«   2024/09   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Tags
more
Archives
Today
Total
관리 메뉴

클라우드 엔지니어 꿈나무

Kubernetes(K8S) 따배쿠 Pod : Pod 동작 flow - CentOS7 본문

kubernetes

Kubernetes(K8S) 따배쿠 Pod : Pod 동작 flow - CentOS7

새싹싹이 2023. 10. 12. 17:14

 

# 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