본문 바로가기
Kubernetes/활용

잘못된 pod 생성 트러블 슈팅

by lumination 2024. 2. 15.

wrong-nginx-version.yaml

apiVersion: v1
kind: Pod
metadata:
  name: nginx-19
spec:
  containers:
  - name: nginx-pod
    image: nginx:1.19.19

 

kubectl apply -f wrong-nginx-version.yaml

더보기

Name:             nginx-19
Namespace:        default
Priority:         0
Service Account:  default
Node:             worker-node1/192.168.0.62
Start Time:       Thu, 15 Feb 2024 14:50:54 +0900
Labels:           <none>
Annotations:      cni.projectcalico.org/containerID: 25ff3ed7ed37842f4b43d7eb0835a1857d800bcb886a7c0cdc93a65112ffe7f7
                  cni.projectcalico.org/podIP: 10.10.180.228/32
                  cni.projectcalico.org/podIPs: 10.10.180.228/32
Status:           Pending
IP:               10.10.180.228
IPs:
  IP:  10.10.180.228
Containers:
  nginx-pod:
    Container ID:
    Image:          nginx:1.19.19
    Image ID:
    Port:           <none>
    Host Port:      <none>
    State:          Waiting
      Reason:       ImagePullBackOff
    Ready:          False
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-fhwrl (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  kube-api-access-fhwrl:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason     Age                From               Message
  ----     ------     ----               ----               -------
  Normal   Scheduled  55s                default-scheduler  Successfully assigned default/nginx-19 to worker-node1
  Normal   BackOff    25s (x2 over 53s)  kubelet            Back-off pulling image "nginx:1.19.19"
  Warning  Failed     25s (x2 over 53s)  kubelet            Error: ImagePullBackOff
  Normal   Pulling    11s (x3 over 55s)  kubelet            Pulling image "nginx:1.19.19"
  Warning  Failed     10s (x3 over 53s)  kubelet            Failed to pull image "nginx:1.19.19": rpc error: code = NotFound desc = failed to pull and unpack image "docker.io/library/nginx:1.19.19": failed to resolve reference "docker.io/library/nginx:1.19.19": docker.io/library/nginx:1.19.19: not found
  Warning  Failed     10s (x3 over 53s)  kubelet            Error: ErrImagePull


kubectl describe nginx-19 상태 조회

kubectl logs nginx-19 로그 보기

kubectl logs -f nginx-19 로그 tail