kubernetes3

post subtitle

By widehyo
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ cat deployment1.yml 
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-deploy
spec:
  replicas: 3
  selector:
    matchLabels:
      app: web
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
      - name: nginx
        image: nginx:1.16
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku apply -f deployment1.yml 
deployment.apps/web-deploy created
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku get all
NAME                              READY   STATUS              RESTARTS   AGE
pod/web-deploy-665f6cf5fc-5lwtp   0/1     ContainerCreating   0          6s
pod/web-deploy-665f6cf5fc-fzbtb   0/1     ContainerCreating   0          6s
pod/web-deploy-665f6cf5fc-qrz5l   0/1     ContainerCreating   0          6s

NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   39h

NAME                         READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/web-deploy   0/3     3            0           6s

NAME                                    DESIRED   CURRENT   READY   AGE
replicaset.apps/web-deploy-665f6cf5fc   3         3         0       6s
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku get all
NAME                              READY   STATUS    RESTARTS   AGE
pod/web-deploy-665f6cf5fc-5lwtp   1/1     Running   0          20s
pod/web-deploy-665f6cf5fc-fzbtb   1/1     Running   0          20s
pod/web-deploy-665f6cf5fc-qrz5l   1/1     Running   0          20s

NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   39h

NAME                         READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/web-deploy   3/3     3            3           20s

NAME                                    DESIRED   CURRENT   READY   AGE
replicaset.apps/web-deploy-665f6cf5fc   3         3         3       20s


 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku apply -f deployment2.yml 
deployment.apps/web-deploy configured
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku get all
NAME                              READY   STATUS    RESTARTS   AGE
pod/web-deploy-665f6cf5fc-5lwtp   1/1     Running   0          8m17s
pod/web-deploy-665f6cf5fc-d2qlx   1/1     Running   0          4s
pod/web-deploy-665f6cf5fc-dj6v8   1/1     Running   0          4s
pod/web-deploy-665f6cf5fc-fzbtb   1/1     Running   0          8m17s
pod/web-deploy-665f6cf5fc-hs4lk   1/1     Running   0          4s
pod/web-deploy-665f6cf5fc-mzbs9   1/1     Running   0          4s
pod/web-deploy-665f6cf5fc-ncppl   1/1     Running   0          4s
pod/web-deploy-665f6cf5fc-qrz5l   1/1     Running   0          8m17s
pod/web-deploy-665f6cf5fc-t2j5s   1/1     Running   0          4s
pod/web-deploy-665f6cf5fc-tmx9l   1/1     Running   0          4s

NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   39h

NAME                         READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/web-deploy   10/10   10           10          8m17s

NAME                                    DESIRED   CURRENT   READY   AGE
replicaset.apps/web-deploy-665f6cf5fc   10        10        10      8m17s

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku scale --replicas=5 deployment.apps/web-deploy
deployment.apps/web-deploy scaled
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku get po -o wide
NAME                          READY   STATUS    RESTARTS   AGE     IP            NODE       NOMINATED NODE   READINESS GATES
web-deploy-665f6cf5fc-5lwtp   1/1     Running   0          9m32s   10.244.0.34   minikube   <none>           <none>
web-deploy-665f6cf5fc-fzbtb   1/1     Running   0          9m32s   10.244.0.32   minikube   <none>           <none>
web-deploy-665f6cf5fc-mzbs9   1/1     Running   0          79s     10.244.0.37   minikube   <none>           <none>
web-deploy-665f6cf5fc-ncppl   1/1     Running   0          79s     10.244.0.36   minikube   <none>           <none>
web-deploy-665f6cf5fc-qrz5l   1/1     Running   0          9m32s   10.244.0.33   minikube   <none>           <none>


 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku describe deployment web-deploy
Name:                   web-deploy
Namespace:              default
CreationTimestamp:      Sun, 22 Mar 2026 13:48:37 +0900
Labels:                 <none>
Annotations:            deployment.kubernetes.io/revision: 1
Selector:               app=web
Replicas:               5 desired | 5 updated | 5 total | 5 available | 0 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:  app=web
  Containers:
   nginx:
    Image:         nginx:1.16
    Port:          <none>
    Host Port:     <none>
    Environment:   <none>
    Mounts:        <none>
  Volumes:         <none>
  Node-Selectors:  <none>
  Tolerations:     <none>
Conditions:
  Type           Status  Reason
  ----           ------  ------
  Progressing    True    NewReplicaSetAvailable
  Available      True    MinimumReplicasAvailable
OldReplicaSets:  <none>
NewReplicaSet:   web-deploy-665f6cf5fc (5/5 replicas created)
Events:
  Type    Reason             Age    From                   Message
  ----    ------             ----   ----                   -------
  Normal  ScalingReplicaSet  11m    deployment-controller  Scaled up replica set web-deploy-665f6cf5fc from 0 to 3
  Normal  ScalingReplicaSet  3m33s  deployment-controller  Scaled up replica set web-deploy-665f6cf5fc from 3 to 10
  Normal  ScalingReplicaSet  2m24s  deployment-controller  Scaled down replica set web-deploy-665f6cf5fc from 10 to 5

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ cat deployment3.yml 
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-deploy
spec:
  replicas: 10
  selector:
    matchLabels:
      app: web
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
      - name: nginx
        image: nginx:1.17

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku apply -f deployment3.yml 
deployment.apps/web-deploy configured
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku get po
NAME                          READY   STATUS              RESTARTS   AGE
web-deploy-5b7f986d66-2fcwf   0/1     ContainerCreating   0          5s
web-deploy-5b7f986d66-c5m76   0/1     ContainerCreating   0          5s
web-deploy-5b7f986d66-qr8hm   0/1     ContainerCreating   0          5s
web-deploy-5b7f986d66-tcp4g   0/1     ContainerCreating   0          5s
web-deploy-5b7f986d66-zg7qq   0/1     ContainerCreating   0          5s
web-deploy-665f6cf5fc-5lwtp   1/1     Running             0          12m
web-deploy-665f6cf5fc-89pvx   1/1     Running             0          5s
web-deploy-665f6cf5fc-c4tv2   1/1     Running             0          5s
web-deploy-665f6cf5fc-fzbtb   1/1     Running             0          12m
web-deploy-665f6cf5fc-mvfgs   1/1     Running             0          5s
web-deploy-665f6cf5fc-mzbs9   1/1     Running             0          4m26s
web-deploy-665f6cf5fc-ncppl   1/1     Running             0          4m26s
web-deploy-665f6cf5fc-qrz5l   1/1     Running             0          12m
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku get po
NAME                          READY   STATUS              RESTARTS   AGE
web-deploy-5b7f986d66-2fcwf   0/1     ContainerCreating   0          14s
web-deploy-5b7f986d66-6l6wk   0/1     ContainerCreating   0          1s
web-deploy-5b7f986d66-c5m76   0/1     ContainerCreating   0          14s
web-deploy-5b7f986d66-qr8hm   1/1     Running             0          14s
web-deploy-5b7f986d66-rqbsx   0/1     ContainerCreating   0          0s
web-deploy-5b7f986d66-tcp4g   0/1     ContainerCreating   0          14s
web-deploy-5b7f986d66-zg7qq   1/1     Running             0          14s
web-deploy-665f6cf5fc-5lwtp   1/1     Running             0          12m
web-deploy-665f6cf5fc-89pvx   0/1     Completed           0          14s
web-deploy-665f6cf5fc-c4tv2   1/1     Running             0          14s
web-deploy-665f6cf5fc-fzbtb   1/1     Running             0          12m
web-deploy-665f6cf5fc-mzbs9   1/1     Running             0          4m35s
web-deploy-665f6cf5fc-ncppl   1/1     Running             0          4m35s
web-deploy-665f6cf5fc-qrz5l   1/1     Running             0          12m
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku get po
NAME                          READY   STATUS              RESTARTS   AGE
web-deploy-5b7f986d66-2fcwf   1/1     Running             0          24s
web-deploy-5b7f986d66-6l6wk   1/1     Running             0          11s
web-deploy-5b7f986d66-c5m76   1/1     Running             0          24s
web-deploy-5b7f986d66-f75mj   0/1     ContainerCreating   0          5s
web-deploy-5b7f986d66-kvltw   0/1     ContainerCreating   0          7s
web-deploy-5b7f986d66-qr8hm   1/1     Running             0          24s
web-deploy-5b7f986d66-rqbsx   1/1     Running             0          10s
web-deploy-5b7f986d66-tcp4g   1/1     Running             0          24s
web-deploy-5b7f986d66-zg7qq   1/1     Running             0          24s
web-deploy-5b7f986d66-zzbjl   1/1     Running             0          9s
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku get po
NAME                          READY   STATUS    RESTARTS   AGE
web-deploy-5b7f986d66-2fcwf   1/1     Running   0          29s
web-deploy-5b7f986d66-6l6wk   1/1     Running   0          16s
web-deploy-5b7f986d66-c5m76   1/1     Running   0          29s
web-deploy-5b7f986d66-f75mj   1/1     Running   0          10s
web-deploy-5b7f986d66-kvltw   1/1     Running   0          12s
web-deploy-5b7f986d66-qr8hm   1/1     Running   0          29s
web-deploy-5b7f986d66-rqbsx   1/1     Running   0          15s
web-deploy-5b7f986d66-tcp4g   1/1     Running   0          29s
web-deploy-5b7f986d66-zg7qq   1/1     Running   0          29s
web-deploy-5b7f986d66-zzbjl   1/1     Running   0          14s


Events:
  Type    Reason             Age                 From                   Message
  ----    ------             ----                ----                   -------
  Normal  ScalingReplicaSet  14m                 deployment-controller  Scaled up replica set web-deploy-665f6cf5fc from 0 to 3
  Normal  ScalingReplicaSet  5m49s               deployment-controller  Scaled up replica set web-deploy-665f6cf5fc from 3 to 10
  Normal  ScalingReplicaSet  4m40s               deployment-controller  Scaled down replica set web-deploy-665f6cf5fc from 10 to 5
  Normal  ScalingReplicaSet  88s                 deployment-controller  Scaled up replica set web-deploy-665f6cf5fc from 5 to 10
  Normal  ScalingReplicaSet  88s                 deployment-controller  Scaled up replica set web-deploy-5b7f986d66 from 0 to 3
  Normal  ScalingReplicaSet  88s                 deployment-controller  Scaled down replica set web-deploy-665f6cf5fc from 10 to 8
  Normal  ScalingReplicaSet  88s                 deployment-controller  Scaled up replica set web-deploy-5b7f986d66 from 3 to 5
  Normal  ScalingReplicaSet  75s                 deployment-controller  Scaled down replica set web-deploy-665f6cf5fc from 8 to 7
  Normal  ScalingReplicaSet  75s                 deployment-controller  Scaled up replica set web-deploy-5b7f986d66 from 5 to 6
  Normal  ScalingReplicaSet  65s (x11 over 74s)  deployment-controller  (combined from similar events): Scaled down replica set web-deploy-665f6cf5fc from 1 to 0


 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku rollout undo deployment web-deploy
deployment.apps/web-deploy rolled back
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku get po
NAME                          READY   STATUS              RESTARTS   AGE
web-deploy-5b7f986d66-c5m76   1/1     Running             0          3m25s
web-deploy-5b7f986d66-rqbsx   1/1     Running             0          3m11s
web-deploy-5b7f986d66-zzbjl   1/1     Running             0          3m10s
web-deploy-665f6cf5fc-2dhfm   0/1     ContainerCreating   0          2s
web-deploy-665f6cf5fc-4rwpd   1/1     Running             0          4s
web-deploy-665f6cf5fc-7ld7f   0/1     ContainerCreating   0          2s
web-deploy-665f6cf5fc-7qcg7   1/1     Running             0          4s
web-deploy-665f6cf5fc-hdjxm   0/1     ContainerCreating   0          2s
web-deploy-665f6cf5fc-kdfqt   1/1     Running             0          4s
web-deploy-665f6cf5fc-sn6vj   0/1     ContainerCreating   0          2s
web-deploy-665f6cf5fc-trdms   1/1     Running             0          4s
web-deploy-665f6cf5fc-wnq9n   1/1     Running             0          4s
web-deploy-665f6cf5fc-wv6gf   0/1     ContainerCreating   0          2s
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku get po
NAME                          READY   STATUS    RESTARTS   AGE
web-deploy-665f6cf5fc-2dhfm   1/1     Running   0          10s
web-deploy-665f6cf5fc-4rwpd   1/1     Running   0          12s
web-deploy-665f6cf5fc-7ld7f   1/1     Running   0          10s
web-deploy-665f6cf5fc-7qcg7   1/1     Running   0          12s
web-deploy-665f6cf5fc-hdjxm   1/1     Running   0          10s
web-deploy-665f6cf5fc-kdfqt   1/1     Running   0          12s
web-deploy-665f6cf5fc-sn6vj   1/1     Running   0          10s
web-deploy-665f6cf5fc-trdms   1/1     Running   0          12s
web-deploy-665f6cf5fc-wnq9n   1/1     Running   0          12s
web-deploy-665f6cf5fc-wv6gf   1/1     Running   0          10s

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku get rs -o wide
NAME                    DESIRED   CURRENT   READY   AGE     CONTAINERS   IMAGES       SELECTOR
web-deploy-5b7f986d66   0         0         0       4m27s   nginx        nginx:1.17   app=web,pod-template-hash=5b7f986d66
web-deploy-665f6cf5fc   10        10        10      17m     nginx        nginx:1.16   app=web,pod-template-hash=665f6cf5fc

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku get po -o wide
NAME                          READY   STATUS    RESTARTS   AGE    IP            NODE       NOMINATED NODE   READINESS GATES
web-deploy-665f6cf5fc-2dhfm   1/1     Running   0          106s   10.244.0.61   minikube   <none>           <none>
web-deploy-665f6cf5fc-4rwpd   1/1     Running   0          108s   10.244.0.55   minikube   <none>           <none>
web-deploy-665f6cf5fc-7ld7f   1/1     Running   0          106s   10.244.0.63   minikube   <none>           <none>
web-deploy-665f6cf5fc-7qcg7   1/1     Running   0          108s   10.244.0.59   minikube   <none>           <none>
web-deploy-665f6cf5fc-hdjxm   1/1     Running   0          106s   10.244.0.64   minikube   <none>           <none>
web-deploy-665f6cf5fc-kdfqt   1/1     Running   0          108s   10.244.0.58   minikube   <none>           <none>
web-deploy-665f6cf5fc-sn6vj   1/1     Running   0          106s   10.244.0.60   minikube   <none>           <none>
web-deploy-665f6cf5fc-trdms   1/1     Running   0          108s   10.244.0.57   minikube   <none>           <none>
web-deploy-665f6cf5fc-wnq9n   1/1     Running   0          108s   10.244.0.56   minikube   <none>           <none>
web-deploy-665f6cf5fc-wv6gf   1/1     Running   0          106s   10.244.0.62   minikube   <none>           <none>
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku delete po web-deploy-665f6cf5fc-sn6vj
pod "web-deploy-665f6cf5fc-sn6vj" deleted from default namespace
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku get po -o wide
NAME                          READY   STATUS    RESTARTS   AGE     IP            NODE       NOMINATED NODE   READINESS GATES
web-deploy-665f6cf5fc-2dhfm   1/1     Running   0          2m25s   10.244.0.61   minikube   <none>           <none>
web-deploy-665f6cf5fc-4rwpd   1/1     Running   0          2m27s   10.244.0.55   minikube   <none>           <none>
web-deploy-665f6cf5fc-7ld7f   1/1     Running   0          2m25s   10.244.0.63   minikube   <none>           <none>
web-deploy-665f6cf5fc-7qcg7   1/1     Running   0          2m27s   10.244.0.59   minikube   <none>           <none>
web-deploy-665f6cf5fc-hdjxm   1/1     Running   0          2m25s   10.244.0.64   minikube   <none>           <none>
web-deploy-665f6cf5fc-kdfqt   1/1     Running   0          2m27s   10.244.0.58   minikube   <none>           <none>
web-deploy-665f6cf5fc-ldw6g   1/1     Running   0          7s      10.244.0.65   minikube   <none>           <none>
web-deploy-665f6cf5fc-trdms   1/1     Running   0          2m27s   10.244.0.57   minikube   <none>           <none>
web-deploy-665f6cf5fc-wnq9n   1/1     Running   0          2m27s   10.244.0.56   minikube   <none>           <none>
web-deploy-665f6cf5fc-wv6gf   1/1     Running   0          2m25s   10.244.0.62   minikube   <none>           <none>

  • multi node가 필요해 virtual box에 학습환경 설정
    • 가상머신 환경 설정(ubuntu22.04 jammy)
      • 4GB ram, 20GB storage, 4 cpu 설정
      • sudo apt update && sudo apt upgrade
      • hostname -i 로 확인시 10.x.x.x 확인 (내부 접속만 허용)
      • machine 정지 후 virtualbox에서 우클릭 > 설정 > 네트워크 > adapter 설정
      • hostname -i 로 확인시 192.x.x.x 확인 (로컬호스트에서 ssh로 접근할 ip 확인)
      • wsl 내에서 ssh <name>@<ip> Connection refused 확인
      • sudo apt install openssh-server
      • sudo systemctl restart ssh
      • wsl 내에서 ssh <name>@<ip> 접속확인
    • ubuntu22.04에 virtualbox 설치
      • /etc/apt/sources.list
      • deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian <mydist> contrib
      • deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian jammy contrib
      • wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg --dearmor
widehyo@k8s-playground:~/gitclone/15_DandK/vagrant-kubernetes$ tail !$
tail /etc/apt/sources.list
deb http://kr.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src http://kr.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted
deb http://security.ubuntu.com/ubuntu/ jammy-security universe
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security universe
deb http://security.ubuntu.com/ubuntu/ jammy-security multiverse
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security multiverse
deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian jammy contrib

widehyo@k8s-playground:~$ wget https://www.virtualbox.org/download/oracle_vbox_2016.asc
widehyo@k8s-playground:~$ ls
gitclone  kubectl  oracle_vbox_2016.asc

   43  2026-03-22 06:04:07 sudo vi /etc/apt/sources.list
   50  2026-03-22 06:07:31 wget https://www.virtualbox.org/download/oracle_vbox_2016.asc
   52  2026-03-22 06:08:09 sudo gpg --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg --dearmor oracle_vbox_2016.asc
   54  2026-03-22 06:08:45 sudo apt-get update
   55  2026-03-22 06:08:49 sudo apt-get install virtualbox-7.1
wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install vagrant
   35  2026-03-22 05:58:49 wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
   36  2026-03-22 05:58:53 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs)
 main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
   37  2026-03-22 05:58:57 sudo apt update && sudo apt install vagrant
  • ubuntu에서 k8s 설치
    • Install kubectl on Linux
      • curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
      • sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
      • kubectl version --client
widehyo@k8s-playground:~$ curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 55.8M  100 55.8M    0     0  11.9M      0  0:00:04  0:00:04 --:--:-- 12.1M
widehyo@k8s-playground:~$ sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
[sudo] password for widehyo: 
widehyo@k8s-playground:~$ kubectl version --client
Client Version: v1.35.3
Kustomize Version: v5.7.1
  • vagrant up
==> master: Clearing any previously set network interfaces...
The IP address configured for the host-only network is not within the
allowed ranges. Please update the address used to be within the allowed
ranges and run the command again.

  Address: 172.16.20.11
  Ranges: 192.168.56.0/21, fe80::/10

Valid ranges can be modified in the /etc/vbox/networks.conf file. For
more information including valid format see:

  https://www.virtualbox.org/manual/ch06.html#network_hostonly
widehyo@k8s-playground:~/gitclone/15_DandK/vagrant-kubernetes$ git diff Vagrantfile
diff --git a/vagrant-kubernetes/Vagrantfile b/vagrant-kubernetes/Vagrantfile
index c3b7341..42d5aba 100644
--- a/vagrant-kubernetes/Vagrantfile
+++ b/vagrant-kubernetes/Vagrantfile
@@ -9,21 +9,21 @@ bridge_if = "en0: Wi-Fi (Wireless)"
 vm_spec = [
   { name: "master", cpu: 2, memory: 2048,
     box: linux_os,
-    private_ip: "172.16.20.11",
+    private_ip: "192.168.56.11",
     public_ip: "192.168.1.91",
     storage: [], playbook: "install_master.yml",
     comment: "Master node" },
 
   { name: "node1", cpu: 4, memory: 8192,
     box: linux_os,
-    private_ip: "172.16.20.12",
+    private_ip: "192.168.56.12",
     public_ip: "192.168.1.92",
     storage: [], playbook: "install_node.yml",
     comment: "Worker node #1" },
 
   { name: "node2", cpu: 4, memory: 8192,
     box: linux_os,
-    private_ip: "172.16.20.13",
+    private_ip: "192.168.56.13",
     public_ip: "192.168.1.93",
     storage: [], playbook: "install_node.yml",
     comment: "Worker node #2" },
widehyo@k8s-playground:~/gitclone/15_DandK/vagrant-kubernetes$ vagrant up
Bringing machine 'master' up with 'virtualbox' provider...
Bringing machine 'node1' up with 'virtualbox' provider...
Bringing machine 'node2' up with 'virtualbox' provider...
==> master: Checking if box 'ubuntu/bionic64' version '20230607.0.5' is up to date...
==> master: Clearing any previously set network interfaces...
==> master: Preparing network interfaces based on configuration...
    master: Adapter 1: nat
    master: Adapter 2: hostonly
==> master: Forwarding ports...
    master: 22 (guest) => 2222 (host) (adapter 1)
==> master: Running 'pre-boot' VM customizations...
==> master: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "5301e226-72f6-4d31-94a2-9fbfe78e5cfd", "--type", "headless"]

Stderr: VBoxManage: error: VT-x is not available (VERR_VMX_NO_VMX)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole

  • virtualbox 내부에서 virtualbox를 실행하는 것은 불가능 한 것으로(그래서 내부적으로 virtualbox를 사용하는 vagrant up을 이용한 실습환경구성은 불가)
  • minikube에 multi node로 start하는 방법이 있다함
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes $ minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes $ miku get all
NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   41h


 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes $ minikube stop
✋  Stopping node "minikube"  ...
🛑  Powering off "minikube" via SSH ...
🛑  1 node stopped.
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes $ minikube start --nodes=3
😄  minikube v1.38.1 on Ubuntu 22.04 (kvm/amd64)
✨  Using the docker driver based on existing profile
❗  You cannot change the number of nodes for an existing minikube cluster. Please use 'minikube node add' to add nodes to an existing cluster.
👍  Starting "minikube" primary control-plane node in "minikube" cluster
🚜  Pulling base image v0.0.50 ...
🔄  Restarting existing docker container for "minikube" ...
🐳  Preparing Kubernetes v1.35.1 on Docker 29.2.1 ...
🔎  Verifying Kubernetes components...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: storage-provisioner, default-storageclass
💡  kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes $ miku get all
NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   41h


 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes $ minikube stop
✋  Stopping node "minikube"  ...
🛑  Powering off "minikube" via SSH ...
🛑  1 node stopped.
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes $ minikube delete
🔥  Deleting "minikube" in docker ...
🔥  Deleting container "minikube" ...
🔥  Removing /home/widehyo/.minikube/machines/minikube ...
💀  Removed all traces of the "minikube" cluster.
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes $ minikube start --nodes 3
😄  minikube v1.38.1 on Ubuntu 22.04 (kvm/amd64)
✨  Automatically selected the docker driver. Other choices: none, ssh
❗  Starting v1.39.0, minikube will default to "containerd" container runtime. See #21973 for more info.
📌  Using Docker driver with root privileges
👍  Starting "minikube" primary control-plane node in "minikube" cluster
🚜  Pulling base image v0.0.50 ...
🔥  Creating docker container (CPUs=2, Memory=3072MB) ...
🐳  Preparing Kubernetes v1.35.1 on Docker 29.2.1 ...
🔗  Configuring CNI (Container Networking Interface) ...
🔎  Verifying Kubernetes components...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: storage-provisioner, default-storageclass

👍  Starting "minikube-m02" worker node in "minikube" cluster
🚜  Pulling base image v0.0.50 ...
🔥  Creating docker container (CPUs=2, Memory=3072MB) ...
🌐  Found network options:
    ▪ NO_PROXY=192.168.49.2
🐳  Preparing Kubernetes v1.35.1 on Docker 29.2.1 ...
    ▪ env NO_PROXY=192.168.49.2
🔎  Verifying Kubernetes components...

👍  Starting "minikube-m03" worker node in "minikube" cluster
🚜  Pulling base image v0.0.50 ...
🔥  Creating docker container (CPUs=2, Memory=3072MB) ...
🌐  Found network options:
    ▪ NO_PROXY=192.168.49.2,192.168.49.3
🐳  Preparing Kubernetes v1.35.1 on Docker 29.2.1 ...
    ▪ env NO_PROXY=192.168.49.2
    ▪ env NO_PROXY=192.168.49.2,192.168.49.3
🔎  Verifying Kubernetes components...
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
  • wsl에서 k8s 설치
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes $ curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 55.8M  100 55.8M    0     0  11.4M      0  0:00:04  0:00:04 --:--:-- 11.4M
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes $ sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
[sudo] password for widehyo: 
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes $ kubectl version --client
Client Version: v1.35.3
Kustomize Version: v5.7.1


 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes $ kubectl get nodes
NAME           STATUS   ROLES           AGE   VERSION
minikube       Ready    control-plane   92s   v1.35.1
minikube-m02   Ready    <none>          71s   v1.35.1
minikube-m03   Ready    <none>          53s   v1.35.1
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl get all
NAME        READY   STATUS    RESTARTS   AGE
pod/test1   1/1     Running   0          7s

NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   2m38s
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl get pod -o wide
NAME    READY   STATUS    RESTARTS   AGE   IP           NODE           NOMINATED NODE   READINESS GATES
test1   1/1     Running   0          18s   10.244.2.2   minikube-m03   <none>           <none>


 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl apply -f deployment4.yml 
deployment.apps/test2 created
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl get po -o wide
NAME                     READY   STATUS              RESTARTS   AGE   IP           NODE           NOMINATED NODE   READINESS GATES
test1                    1/1     Running             0          46s   10.244.2.2   minikube-m03   <none>           <none>
test2-545c467c5c-2jh77   1/1     Running             0          6s    10.244.1.2   minikube-m02   <none>           <none>
test2-545c467c5c-drcmf   0/1     ContainerCreating   0          6s    <none>       minikube-m02   <none>           <none>
test2-545c467c5c-dzrz2   0/1     ContainerCreating   0          6s    <none>       minikube       <none>           <none>
test2-545c467c5c-fbsr9   1/1     Running             0          6s    10.244.2.3   minikube-m03   <none>           <none>
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl get po -o wide
NAME                     READY   STATUS    RESTARTS   AGE   IP           NODE           NOMINATED NODE   READINESS GATES
test1                    1/1     Running   0          54s   10.244.2.2   minikube-m03   <none>           <none>
test2-545c467c5c-2jh77   1/1     Running   0          14s   10.244.1.2   minikube-m02   <none>           <none>
test2-545c467c5c-drcmf   1/1     Running   0          14s   10.244.1.3   minikube-m02   <none>           <none>
test2-545c467c5c-dzrz2   1/1     Running   0          14s   10.244.0.3   minikube       <none>           <none>
test2-545c467c5c-fbsr9   1/1     Running   0          14s   10.244.2.3   minikube-m03   <none>           <none>


 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ minikube node stop minikube-m02
✋  Stopping node "minikube-m02"  ...
🛑  Powering off "minikube-m02" via SSH ...
🛑  Successfully stopped node minikube-m02
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl get nodes
NAME           STATUS   ROLES           AGE     VERSION
minikube       Ready    control-plane   6m17s   v1.35.1
minikube-m02   Ready    <none>          5m56s   v1.35.1
minikube-m03   Ready    <none>          5m38s   v1.35.1

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl get nodes -w
NAME           STATUS     ROLES           AGE     VERSION
minikube       Ready      control-plane   8m31s   v1.35.1
minikube-m02   NotReady   <none>          8m10s   v1.35.1
minikube-m03   Ready      <none>          7m52s   v1.35.1


 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl get po -o wide -w
NAME                     READY   STATUS    RESTARTS   AGE     IP           NODE           NOMINATED NODE   READINESS GATES
test1                    1/1     Running   0          6m45s   10.244.2.2   minikube-m03   <none>           <none>
test2-545c467c5c-2jh77   1/1     Running   0          6m5s    10.244.1.2   minikube-m02   <none>           <none>
test2-545c467c5c-drcmf   1/1     Running   0          6m5s    10.244.1.3   minikube-m02   <none>           <none>
test2-545c467c5c-dzrz2   1/1     Running   0          6m5s    10.244.0.3   minikube       <none>           <none>
test2-545c467c5c-fbsr9   1/1     Running   0          6m5s    10.244.2.3   minikube-m03   <none>           <none>
test2-545c467c5c-drcmf   1/1     Running   0          8m34s   10.244.1.3   minikube-m02   <none>           <none>
test2-545c467c5c-2jh77   1/1     Running   0          8m34s   10.244.1.2   minikube-m02   <none>           <none>
test2-545c467c5c-drcmf   1/1     Terminating   0          8m34s   10.244.1.3   minikube-m02   <none>           <none>
test2-545c467c5c-2jh77   1/1     Terminating   0          8m34s   10.244.1.2   minikube-m02   <none>           <none>
test2-545c467c5c-wx4vp   0/1     Pending       0          0s      <none>       <none>         <none>           <none>
test2-545c467c5c-wx4vp   0/1     Pending       0          0s      <none>       minikube-m03   <none>           <none>
test2-545c467c5c-z49ck   0/1     Pending       0          0s      <none>       <none>         <none>           <none>
test2-545c467c5c-wx4vp   0/1     ContainerCreating   0          0s      <none>       minikube-m03   <none>           <none>
test2-545c467c5c-z49ck   0/1     Pending             0          0s      <none>       minikube       <none>           <none>
test2-545c467c5c-z49ck   0/1     ContainerCreating   0          0s      <none>       minikube       <none>           <none>
test2-545c467c5c-z49ck   1/1     Running             0          1s      10.244.0.4   minikube       <none>           <none>
test2-545c467c5c-wx4vp   1/1     Running             0          1s      10.244.2.4   minikube-m03   <none>           <none>

 ~ $ date -Isecond
2026-03-22T15:52:37+09:00
 ~ $ history | tail
31374  2026-03-22 15:47:18 minikube node stop minikube-m02
31375  2026-03-22 15:47:29 kubectl get nodes
31376  2026-03-22 15:47:49 minikube get po -o wide
31377  2026-03-22 15:48:01 minikube kubectl -- get pod -o wide
31378  2026-03-22 15:48:23 kubectl get po -o wide
31379  2026-03-22 15:49:43 kubectl get nodes -w
31380  2026-03-22 15:50:27 kubectl get po -o wide
31381  2026-03-22 15:52:31 date
31382  2026-03-22 15:52:37 date -Isecond
31383  2026-03-22 15:52:48 history | tail
 ~ $ date -Isecond
2026-03-22T15:53:08+09:00


 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ minikube node start minikube-m02
👍  Starting "minikube-m02" worker node in "minikube" cluster
🚜  Pulling base image v0.0.50 ...
🔄  Restarting existing docker container for "minikube-m02" ...
🐳  Preparing Kubernetes v1.35.1 on Docker 29.2.1 ...
🔎  Verifying Kubernetes components...
🌟  Enabled addons: 
😄  Successfully started node minikube-m02!
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl get nodes
NAME           STATUS   ROLES           AGE   VERSION
minikube       Ready    control-plane   14m   v1.35.1
minikube-m02   Ready    <none>          13m   v1.35.1
minikube-m03   Ready    <none>          13m   v1.35.1
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl get pods -o wide
NAME                     READY   STATUS    RESTARTS   AGE     IP           NODE           NOMINATED NODE   READINESS GATES
test1                    1/1     Running   0          11m     10.244.2.2   minikube-m03   <none>           <none>
test2-545c467c5c-dzrz2   1/1     Running   0          10m     10.244.0.3   minikube       <none>           <none>
test2-545c467c5c-fbsr9   1/1     Running   0          10m     10.244.2.3   minikube-m03   <none>           <none>
test2-545c467c5c-wx4vp   1/1     Running   0          2m24s   10.244.2.4   minikube-m03   <none>           <none>
test2-545c467c5c-z49ck   1/1     Running   0          2m24s   10.244.0.4   minikube       <none>           <none>


 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku delete deployment test2
deployment.apps "test2" deleted from default namespace
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku delete pod test1
pod "test1" deleted from default namespace

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku get all
NAME                         READY   STATUS        RESTARTS   AGE
pod/test1                    1/1     Terminating   0          13m
pod/test2-545c467c5c-dzrz2   1/1     Terminating   0          12m
pod/test2-545c467c5c-fbsr9   1/1     Terminating   0          12m
pod/test2-545c467c5c-wx4vp   1/1     Terminating   0          4m18s
pod/test2-545c467c5c-z49ck   1/1     Terminating   0          4m18s

NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   16m
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ miku get all
NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   16m

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured

minikube-m02
type: Worker
host: Running
kubelet: Running

minikube-m03
type: Worker
host: Running
kubelet: Running


 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl get all
NAME                        READY   STATUS    RESTARTS   AGE
pod/mysql-8b8467754-l7klk   0/1     Pending   0          36s

NAME                 TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
service/kubernetes   ClusterIP   10.96.0.1       <none>        443/TCP          21m
service/mysql-dpl    NodePort    10.100.84.158   <none>        3306:30306/TCP   36s

NAME                    READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/mysql   0/1     1            0           36s

NAME                              DESIRED   CURRENT   READY   AGE
replicaset.apps/mysql-8b8467754   1         1         0       36s

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ cat mysql-act-stby.yml 
# 퍼시스턴트 볼륨
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: gvol-1
spec:
  storageClassName: gluster-heketi
  #storageClassName: ibmc-file-bronze   # 용량 20Gi IKS 
  accessModes:
   - ReadWriteMany
  resources:
    requests:
      storage: 12Gi
      #storage: 20Gi   # for IKS
---
# MySQL서버 디플로이먼트
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mysql
  labels:
    app: mysql
spec:
  selector:
    matchLabels:
      app: mysql
  replicas: 1
  template:
    metadata:
      labels:
        app: mysql
    spec:
      containers:
      - name: mysql
        image: mysql:5.7
        ports:
        - containerPort: 3306
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: qwerty
        volumeMounts:
        - mountPath: /var/lib/mysql
          name: pvc
        livenessProbe:
          exec:
            command: ["mysqladmin","-p$MYSQL_ROOT_PASSWORD","ping"]
          initialDelaySeconds: 60
          timeoutSeconds: 10
      volumes:
      - name: pvc
        persistentVolumeClaim:
          claimName: gvol-1
---
# MySQL서버 서비스
apiVersion: v1
kind: Service
metadata:
  name: mysql-dpl
  labels:
    app: mysql
spec:
  type: NodePort
  ports:
  - port: 3306
    nodePort: 30306
  selector:
    app: mysql


 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ git diff mysql-act-stby.yml
diff --git a/step08/mysql-act-stby.yml b/step08/mysql-act-stby.yml
index db5a56e..9ba475f 100644
--- a/step08/mysql-act-stby.yml
+++ b/step08/mysql-act-stby.yml
@@ -4,7 +4,7 @@ kind: PersistentVolumeClaim
 metadata:
   name: gvol-1
 spec:
-  storageClassName: gluster-heketi
+  storageClassName: standard
   #storageClassName: ibmc-file-bronze   # 용량 20Gi IKS 
   accessModes:
    - ReadWriteMany

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl delete -f mysql-act-stby.yml 
persistentvolumeclaim "gvol-1" deleted from default namespace
deployment.apps "mysql" deleted from default namespace
service "mysql-dpl" deleted from default namespace

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl apply -f mysql-act-stby.yml 
persistentvolumeclaim/gvol-1 created
deployment.apps/mysql created
service/mysql-dpl created

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl get all -o wide
NAME                        READY   STATUS    RESTARTS   AGE   IP           NODE           NOMINATED NODE   READINESS GATES
pod/mysql-8b8467754-ccspk   1/1     Running   0          50s   10.244.2.5   minikube-m03   <none>           <none>

NAME                 TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE   SELECTOR
service/kubernetes   ClusterIP   10.96.0.1        <none>        443/TCP          25m   <none>
service/mysql-dpl    NodePort    10.108.108.174   <none>        3306:30306/TCP   50s   app=mysql

NAME                    READY   UP-TO-DATE   AVAILABLE   AGE   CONTAINERS   IMAGES      SELECTOR
deployment.apps/mysql   1/1     1            1           50s   mysql        mysql:5.7   app=mysql

NAME                              DESIRED   CURRENT   READY   AGE   CONTAINERS   IMAGES      SELECTOR
replicaset.apps/mysql-8b8467754   1         1         1       50s   mysql        mysql:5.7   app=mysql,pod-template-hash=8b8467754



 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl get node
NAME           STATUS   ROLES           AGE   VERSION
minikube       Ready    control-plane   28m   v1.35.1
minikube-m02   Ready    <none>          28m   v1.35.1
minikube-m03   Ready    <none>          28m   v1.35.1
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl get po -o wide
NAME                    READY   STATUS    RESTARTS   AGE     IP           NODE           NOMINATED NODE   READINESS GATES
mysql-8b8467754-ccspk   1/1     Running   0          4m25s   10.244.2.5   minikube-m03   <none>           <none>
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl drain minikube-m03
node/minikube-m03 cordoned
error: unable to drain node "minikube-m03" due to error: cannot delete DaemonSet-managed Pods (use --ignore-daemonsets to ignore): kube-system/kindnet-bg6xj, kube-system/kube-proxy-2ldz2, continuing command...
There are pending nodes to be drained:
 minikube-m03
cannot delete DaemonSet-managed Pods (use --ignore-daemonsets to ignore): kube-system/kindnet-bg6xj, kube-system/kube-proxy-2ldz2
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl drain minikube-m03 --ignore-daemonsets
node/minikube-m03 already cordoned
Warning: ignoring DaemonSet-managed Pods: kube-system/kindnet-bg6xj, kube-system/kube-proxy-2ldz2
evicting pod default/mysql-8b8467754-ccspk
pod/mysql-8b8467754-ccspk evicted
node/minikube-m03 drained

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl get po -o wide
NAME                    READY   STATUS              RESTARTS   AGE   IP       NODE           NOMINATED NODE   READINESS GATES
mysql-8b8467754-qp7bd   0/1     ContainerCreating   0          29s   <none>   minikube-m02   <none>           <none>
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl get po -o wide -w
NAME                    READY   STATUS    RESTARTS   AGE   IP           NODE           NOMINATED NODE   READINESS GATES
mysql-8b8467754-qp7bd   1/1     Running   0          32s   10.244.1.2   minikube-m02   <none>           <none>

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl uncordon minikube-m03
node/minikube-m03 uncordoned
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step08 $ kubectl get nodes
NAME           STATUS   ROLES           AGE   VERSION
minikube       Ready    control-plane   30m   v1.35.1
minikube-m02   Ready    <none>          30m   v1.35.1
minikube-m03   Ready    <none>          29m   v1.35.1


 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ kubectl apply -f deploy.yml 
deployment.apps/web-deploy created
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ kubectl apply -f svc.yml 
service/web-service created

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ kubectl get all -o wide
NAME                             READY   STATUS              RESTARTS   AGE   IP       NODE           NOMINATED NODE   READINESS GATES
pod/web-deploy-ff44d897b-7s9gh   0/1     ContainerCreating   0          9s    <none>   minikube-m02   <none>           <none>
pod/web-deploy-ff44d897b-7vjqv   0/1     ContainerCreating   0          9s    <none>   minikube       <none>           <none>
pod/web-deploy-ff44d897b-p5zj4   0/1     ContainerCreating   0          9s    <none>   minikube-m03   <none>           <none>

NAME                  TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE   SELECTOR
service/kubernetes    ClusterIP   10.96.0.1       <none>        443/TCP   53m   <none>
service/web-service   ClusterIP   10.110.114.21   <none>        80/TCP    5s    app=web

NAME                         READY   UP-TO-DATE   AVAILABLE   AGE   CONTAINERS   IMAGES         SELECTOR
deployment.apps/web-deploy   0/3     3            0           9s    nginx        nginx:latest   app=web

NAME                                   DESIRED   CURRENT   READY   AGE   CONTAINERS   IMAGES         SELECTOR
replicaset.apps/web-deploy-ff44d897b   3         3         0       9s    nginx        nginx:latest   app=web,pod-template-hash=ff44d897b

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ kubectl get pods | awk '/web/ { printf "kubectl exec %s -- /bin/sh -c \"hostname>/usr/share/nginx/html/index.html\"\n", $1 }' | bash
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ !?busybox
kubectl run -it busybox --restart=Never --rm --image=busybox sh
All commands and output from this session will be recorded in container logs, including credentials and sensitive information passed through the command prompt.
If you don't see a command prompt, try pressing enter.
/ # while true; do wget -q -O - http://web-service; sleep 1; done
web-deploy-ff44d897b-7vjqv
web-deploy-ff44d897b-p5zj4
web-deploy-ff44d897b-7vjqv
web-deploy-ff44d897b-7s9gh
web-deploy-ff44d897b-7s9gh
web-deploy-ff44d897b-7vjqv
web-deploy-ff44d897b-7vjqv
web-deploy-ff44d897b-7s9gh
web-deploy-ff44d897b-7vjqv
web-deploy-ff44d897b-7s9gh
^C

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ kubectl delete -f svc.yml 
service "web-service" deleted from default namespace
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ kubectl apply -f svc-sa.yml 
service/web-service created

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ cat svc-sa.yml 
apiVersion: v1
kind: Service
metadata:
  name: web-service
spec:
  selector:
    app: web
  ports:
  - protocol: TCP
    port: 80
  sessionAffinity: ClientIP

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ kubectl get pods | awk '/web/ { printf "kubectl exec %s -- /bin/sh -c \"hostname>/usr/share/nginx/html/index.html\"\n", $1 }' | bash
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ !?busybox
kubectl run -it busybox --restart=Never --rm --image=busybox sh
All commands and output from this session will be recorded in container logs, including credentials and sensitive information passed through the command prompt.
If you don't see a command prompt, try pressing enter.
/ # while true; do wget -q -O - http://web-service; sleep 1; done
web-deploy-ff44d897b-rvjxw
web-deploy-ff44d897b-rvjxw
web-deploy-ff44d897b-rvjxw
web-deploy-ff44d897b-rvjxw
web-deploy-ff44d897b-rvjxw
web-deploy-ff44d897b-rvjxw
^C


 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ cat svc-np.yml 
apiVersion: v1
kind: Service
metadata:
  name: web-service-np
spec:
  selector:
    app: web
  ports:
  - protocol: TCP
    port: 80
  type: NodePort
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ kubectl get all -o wide
NAME                             READY   STATUS    RESTARTS   AGE     IP            NODE           NOMINATED NODE   READINESS GATES
pod/web-deploy-ff44d897b-c94xx   1/1     Running   0          5m18s   10.244.0.6    minikube       <none>           <none>
pod/web-deploy-ff44d897b-h4r2d   1/1     Running   0          5m18s   10.244.1.4    minikube-m02   <none>           <none>
pod/web-deploy-ff44d897b-rvjxw   1/1     Running   0          5m18s   10.244.2.10   minikube-m03   <none>           <none>

NAME                     TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE     SELECTOR
service/kubernetes       ClusterIP   10.96.0.1      <none>        443/TCP        66m     <none>
service/web-service-np   NodePort    10.101.62.40   <none>        80:31812/TCP   3m39s   app=web

NAME                         READY   UP-TO-DATE   AVAILABLE   AGE     CONTAINERS   IMAGES         SELECTOR
deployment.apps/web-deploy   3/3     3            3           5m18s   nginx        nginx:latest   app=web

NAME                                   DESIRED   CURRENT   READY   AGE     CONTAINERS   IMAGES         SELECTOR
replicaset.apps/web-deploy-ff44d897b   3         3         3       5m18s   nginx        nginx:latest   app=web,pod-template-hash=ff44d897b

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ minikube ip
192.168.49.2
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ curl http://192.168.49.2:31812/
web-deploy-ff44d897b-h4r2d
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ curl http://192.168.49.2:31812/
web-deploy-ff44d897b-rvjxw
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ curl http://192.168.49.2:31812/
web-deploy-ff44d897b-rvjxw
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ curl http://192.168.49.2:31812/
web-deploy-ff44d897b-c94xx
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ curl http://192.168.49.2:31812/
web-deploy-ff44d897b-c94xx



 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ cat svc-ext-dns.yml 
kind: Service
apiVersion: v1
metadata:
  name: yahoo
spec:
  type: ExternalName
  externalName: www.yahoo.co.jp
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ kubectl apply -f !$
kubectl apply -f svc-ext-dns.yml
service/yahoo created
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step09 $ !?busybox
kubectl run -it busybox --restart=Never --rm --image=busybox sh
All commands and output from this session will be recorded in container logs, including credentials and sensitive information passed through the command prompt.
If you don't see a command prompt, try pressing enter.
/ # ping www.yahoo.co.jp
PING www.yahoo.co.jp (182.22.31.124): 56 data bytes
64 bytes from 182.22.31.124: seq=0 ttl=42 time=41.981 ms
64 bytes from 182.22.31.124: seq=1 ttl=42 time=44.025 ms
^C
--- www.yahoo.co.jp ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 41.981/43.003/44.025 ms
/ # ^C

/ # 
pod "busybox" deleted from default namespace
pod default/busybox terminated (Error)


 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step10/job_finish_case $ kubectl apply -f !$
kubectl apply -f job-normal-end.yml
job.batch/normal-end created
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step10/job_finish_case $ kubectl get all
NAME                   READY   STATUS    RESTARTS   AGE
pod/normal-end-jrkcs   1/1     Running   0          4s
pod/normal-end-lkv6j   1/1     Running   0          4s

NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   4h31m

NAME                   STATUS    COMPLETIONS   DURATION   AGE
job.batch/normal-end   Running   0/6           4s         4s
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step10/job_finish_case $ kubectl get po -o wide -w
NAME               READY   STATUS      RESTARTS   AGE   IP            NODE           NOMINATED NODE   READINESS GATES
normal-end-25jnd   1/1     Running     0          6s    10.244.1.9    minikube-m02   <none>           <none>
normal-end-jrkcs   0/1     Completed   0          16s   10.244.1.8    minikube-m02   <none>           <none>
normal-end-lkv6j   0/1     Completed   0          16s   10.244.2.19   minikube-m03   <none>           <none>
normal-end-tpbzz   1/1     Running     0          6s    10.244.2.20   minikube-m03   <none>           <none>
normal-end-25jnd   0/1     Completed   0          9s    10.244.1.9    minikube-m02   <none>           <none>
normal-end-tpbzz   0/1     Completed   0          9s    10.244.2.20   minikube-m03   <none>           <none>
normal-end-25jnd   0/1     Completed   0          9s    10.244.1.9    minikube-m02   <none>           <none>
normal-end-tpbzz   0/1     Completed   0          9s    10.244.2.20   minikube-m03   <none>           <none>
normal-end-npl2h   0/1     Pending     0          0s    <none>        <none>         <none>           <none>
normal-end-bjgqj   0/1     Pending     0          0s    <none>        <none>         <none>           <none>
normal-end-npl2h   0/1     Pending     0          0s    <none>        minikube-m03   <none>           <none>
normal-end-bjgqj   0/1     Pending     0          0s    <none>        minikube-m02   <none>           <none>
normal-end-npl2h   0/1     ContainerCreating   0          0s    <none>        minikube-m03   <none>           <none>
normal-end-tpbzz   0/1     Completed           0          10s   10.244.2.20   minikube-m03   <none>           <none>
normal-end-25jnd   0/1     Completed           0          10s   10.244.1.9    minikube-m02   <none>           <none>
normal-end-bjgqj   0/1     ContainerCreating   0          0s    <none>        minikube-m02   <none>           <none>
normal-end-bjgqj   1/1     Running             0          3s    10.244.1.10   minikube-m02   <none>           <none>
normal-end-npl2h   1/1     Running             0          3s    10.244.2.21   minikube-m03   <none>           <none>
normal-end-bjgqj   0/1     Completed           0          8s    10.244.1.10   minikube-m02   <none>           <none>
normal-end-npl2h   0/1     Completed           0          8s    10.244.2.21   minikube-m03   <none>           <none>
normal-end-bjgqj   0/1     Completed           0          9s    10.244.1.10   minikube-m02   <none>           <none>
normal-end-npl2h   0/1     Completed           0          9s    10.244.2.21   minikube-m03   <none>           <none>
normal-end-npl2h   0/1     Completed           0          10s   10.244.2.21   minikube-m03   <none>           <none>
normal-end-bjgqj   0/1     Completed           0          10s   10.244.1.10   minikube-m02   <none>           <none>
^C ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step10/job_finish_case $ kubectl get po -o wide
NAME               READY   STATUS      RESTARTS   AGE   IP            NODE           NOMINATED NODE   READINESS GATES
normal-end-25jnd   0/1     Completed   0          26s   10.244.1.9    minikube-m02   <none>           <none>
normal-end-bjgqj   0/1     Completed   0          16s   10.244.1.10   minikube-m02   <none>           <none>
normal-end-jrkcs   0/1     Completed   0          36s   10.244.1.8    minikube-m02   <none>           <none>
normal-end-lkv6j   0/1     Completed   0          36s   10.244.2.19   minikube-m03   <none>           <none>
normal-end-npl2h   0/1     Completed   0          16s   10.244.2.21   minikube-m03   <none>           <none>
normal-end-tpbzz   0/1     Completed   0          26s   10.244.2.20   minikube-m03   <none>           <none>
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step10/job_finish_case $ kubectl get all
NAME                   READY   STATUS      RESTARTS   AGE
pod/normal-end-25jnd   0/1     Completed   0          30s
pod/normal-end-bjgqj   0/1     Completed   0          20s
pod/normal-end-jrkcs   0/1     Completed   0          40s
pod/normal-end-lkv6j   0/1     Completed   0          40s
pod/normal-end-npl2h   0/1     Completed   0          20s
pod/normal-end-tpbzz   0/1     Completed   0          30s

NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   4h31m

NAME                   STATUS     COMPLETIONS   DURATION   AGE
job.batch/normal-end   Complete   6/6           30s        40s

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step10/job_finish_case $ cat job-abnormal-end.yml 
apiVersion: batch/v1
kind: Job
metadata:
  name: abnormal-end
spec:
  backoffLimit: 3
  template:
    spec:
      containers:
      - name: busybox
        image: busybox:latest
        command: ["sh",  "-c", "sleep 5; exit 1"]
      restartPolicy: Never

 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step10/job_finish_case $ kubectl apply -f !$
kubectl apply -f job-abnormal-end.yml
job.batch/abnormal-end created
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step10/job_finish_case $ kubectl get po -o wide -w
NAME                 READY   STATUS   RESTARTS   AGE   IP            NODE           NOMINATED NODE   READINESS GATES
abnormal-end-q5wjt   0/1     Error    0          9s    10.244.2.22   minikube-m03   <none>           <none>
abnormal-end-q5wjt   0/1     Error    0          9s    10.244.2.22   minikube-m03   <none>           <none>
abnormal-end-8d65j   0/1     Pending   0          0s    <none>        <none>         <none>           <none>
abnormal-end-8d65j   0/1     Pending   0          0s    <none>        minikube-m03   <none>           <none>
abnormal-end-8d65j   0/1     ContainerCreating   0          0s    <none>        minikube-m03   <none>           <none>
abnormal-end-8d65j   1/1     Running             0          3s    10.244.2.23   minikube-m03   <none>           <none>
abnormal-end-8d65j   0/1     Error               0          8s    10.244.2.23   minikube-m03   <none>           <none>
abnormal-end-8d65j   0/1     Error               0          9s    10.244.2.23   minikube-m03   <none>           <none>
abnormal-end-8d65j   0/1     Error               0          10s   10.244.2.23   minikube-m03   <none>           <none>
abnormal-end-nr5lm   0/1     Pending             0          0s    <none>        <none>         <none>           <none>
abnormal-end-nr5lm   0/1     Pending             0          0s    <none>        minikube-m03   <none>           <none>
abnormal-end-nr5lm   0/1     ContainerCreating   0          0s    <none>        minikube-m03   <none>           <none>
abnormal-end-nr5lm   1/1     Running             0          3s    10.244.2.24   minikube-m03   <none>           <none>
abnormal-end-nr5lm   0/1     Error               0          8s    10.244.2.24   minikube-m03   <none>           <none>
abnormal-end-nr5lm   0/1     Error               0          9s    10.244.2.24   minikube-m03   <none>           <none>
abnormal-end-nr5lm   0/1     Error               0          10s   10.244.2.24   minikube-m03   <none>           <none>
^C ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step10/job_finish_case $ kubectl get all -o wide
NAME                     READY   STATUS   RESTARTS   AGE   IP            NODE           NOMINATED NODE   READINESS GATES
pod/abnormal-end-8d65j   0/1     Error    0          49s   10.244.2.23   minikube-m03   <none>           <none>
pod/abnormal-end-nr5lm   0/1     Error    0          22s   10.244.2.24   minikube-m03   <none>           <none>
pod/abnormal-end-q5wjt   0/1     Error    0          65s   10.244.2.22   minikube-m03   <none>           <none>

NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE     SELECTOR
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   4h33m   <none>

NAME                     STATUS    COMPLETIONS   DURATION   AGE   CONTAINERS   IMAGES           SELECTOR
job.batch/abnormal-end   Running   0/1           65s        65s   busybox      busybox:latest   batch.kubernetes.io/controller-uid=2b610e97-99eb-4878-bfcf-ca8e2e21e99e
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step10/job_finish_case $ kubectl get po -o wide
NAME                 READY   STATUS   RESTARTS   AGE     IP            NODE           NOMINATED NODE   READINESS GATES
abnormal-end-27dqt   0/1     Error    0          59s     10.244.2.25   minikube-m03   <none>           <none>
abnormal-end-8d65j   0/1     Error    0          2m13s   10.244.2.23   minikube-m03   <none>           <none>
abnormal-end-nr5lm   0/1     Error    0          106s    10.244.2.24   minikube-m03   <none>           <none>
abnormal-end-q5wjt   0/1     Error    0          2m29s   10.244.2.22   minikube-m03   <none>           <none>
 ~/gitclone/playground/reading/57_15_step_de_shutoku_docker_kara_hairu_kubernetes/15_DandK/step10/job_finish_case $ kubectl describe job
Name:             abnormal-end
Namespace:        default
Selector:         batch.kubernetes.io/controller-uid=2b610e97-99eb-4878-bfcf-ca8e2e21e99e
Labels:           batch.kubernetes.io/controller-uid=2b610e97-99eb-4878-bfcf-ca8e2e21e99e
                  batch.kubernetes.io/job-name=abnormal-end
                  controller-uid=2b610e97-99eb-4878-bfcf-ca8e2e21e99e
                  job-name=abnormal-end
Annotations:      <none>
Parallelism:      1
Completions:      1
Completion Mode:  NonIndexed
Suspend:          false
Backoff Limit:    3
Start Time:       Sun, 22 Mar 2026 20:13:29 +0900
Pods Statuses:    0 Active (0 Ready) / 0 Succeeded / 4 Failed
Pod Template:
  Labels:  batch.kubernetes.io/controller-uid=2b610e97-99eb-4878-bfcf-ca8e2e21e99e
           batch.kubernetes.io/job-name=abnormal-end
           controller-uid=2b610e97-99eb-4878-bfcf-ca8e2e21e99e
           job-name=abnormal-end
  Containers:
   busybox:
    Image:      busybox:latest
    Port:       <none>
    Host Port:  <none>
    Command:
      sh
      -c
      sleep 5; exit 1
    Environment:   <none>
    Mounts:        <none>
  Volumes:         <none>
  Node-Selectors:  <none>
  Tolerations:     <none>
Events:
  Type     Reason                Age    From            Message
  ----     ------                ----   ----            -------
  Normal   SuccessfulCreate      2m40s  job-controller  Created pod: abnormal-end-q5wjt
  Normal   SuccessfulCreate      2m24s  job-controller  Created pod: abnormal-end-8d65j
  Normal   SuccessfulCreate      117s   job-controller  Created pod: abnormal-end-nr5lm
  Normal   SuccessfulCreate      70s    job-controller  Created pod: abnormal-end-27dqt
  Warning  BackoffLimitExceeded  61s    job-controller  Job has reached the specified backoff limit


 ~/gitclone/15_DandK/step10/job-cron $ kubectl get all
NAME                       READY   STATUS      RESTARTS   AGE
pod/hello-29569697-knp62   0/1     Completed   0          2m53s
pod/hello-29569698-n8hws   0/1     Completed   0          113s
pod/hello-29569699-6gvts   0/1     Completed   0          53s

NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   5h38m

NAME                  SCHEDULE      TIMEZONE   SUSPEND   ACTIVE   LAST SCHEDULE   AGE
cronjob.batch/hello   */1 * * * *   <none>     False     0        53s             3m25s

NAME                       STATUS     COMPLETIONS   DURATION   AGE
job.batch/hello-29569697   Complete   1/1           5s         2m53s
job.batch/hello-29569698   Complete   1/1           4s         113s
job.batch/hello-29569699   Complete   1/1           5s         53s
 ~/gitclone/15_DandK/step10/job-cron $ ls
cron-job.yml
 ~/gitclone/15_DandK/step10/job-cron $ kubectl delete -f cron-job.yml 
cronjob.batch "hello" deleted from default namespace
 ~/gitclone/15_DandK/step10/job-cron $ kubectl get all
NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   5h38m
Tags: tag