• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    미해결

nginx 파드 명령어 수행 후에, pods 상태가 ImagePullBackoff 입니다

21.12.07 09:34 작성 조회수 512

1

nginx 파드 명령어 수행 후에, pods 상태가 ImagePullBackoff 입니다

 

해결 방법 좀 알려주세요 ㅠㅠ

 

[root@m-k8s ~]# kubectl get pods

NAME    READY   STATUS             RESTARTS   AGE

nginx   0/1     ImagePullBackOff   0          4m8s

 

 

 

 

[root@m-k8s ~]# kubectl get pods

NAME    READY   STATUS             RESTARTS   AGE

nginx   0/1     ImagePullBackOff   0          4m8s

[root@m-k8s ~]# kubectl describe pod nginx

Name:         nginx

Namespace:    default

Priority:     0

Node:         w2-k8s/192.168.1.102

Start Time:   Tue, 07 Dec 2021 09:27:08 +0900

Labels:       run=nginx

Annotations:  cni.projectcalico.org/podIP: 172.16.103.130/32

              cni.projectcalico.org/podIPs: 172.16.103.130/32

Status:       Pending

IP:           172.16.103.130

IPs:

  IP:  172.16.103.130

Containers:

  nginx:

    Container ID:

    Image:          ngnix

    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 default-token-kksf9 (ro)

Conditions:

  Type              Status

  Initialized       True

  Ready             False

  ContainersReady   False

  PodScheduled      True

Volumes:

  default-token-kksf9:

    Type:        Secret (a volume populated by a Secret)

    SecretName:  default-token-kksf9

    Optional:    false

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  5m43s                  default-scheduler  Successfully assigned default/nginx to w2-k8s

  Normal   Pulling    4m13s (x4 over 5m42s)  kubelet            Pulling image "ngnix"

  Warning  Failed     4m11s (x4 over 5m40s)  kubelet            Failed to pull image "ngnix": rpc error: code = Unknown desc = Error response from daemon: pull access denied for ngnix, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

  Warning  Failed     4m11s (x4 over 5m40s)  kubelet            Error: ErrImagePull

  Normal   BackOff    3m46s (x6 over 5m39s)  kubelet            Back-off pulling image "ngnix"

  Warning  Failed     30s (x20 over 5m39s)   kubelet            Error: ImagePullBackOff

 

 

 

[root@m-k8s ~]# kubectl logs nginx

Error from server (BadRequest): container "nginx" in pod "nginx" is waiting to start: image can't be pulled

 

 

[root@m-k8s ~]# kubectl get pods -o wide -A

NAMESPACE     NAME                                       READY   STATUS             RESTARTS   AGE     IP               NODE     NOMINATED NODE   READINESS GATES

default       nginx                                      0/1     ImagePullBackOff   0          6m32s   172.16.103.130   w2-k8s   <none>           <none>

kube-system   calico-kube-controllers-744cfdf676-44nf6   1/1     Running            1          15h     172.16.171.70    m-k8s    <none>           <none>

kube-system   calico-node-4d25x                          1/1     Running            1          15h     192.168.1.10     m-k8s    <none>           <none>

kube-system   calico-node-bsxgc                          1/1     Running            1          15h     192.168.1.101    w1-k8s   <none>           <none>

kube-system   calico-node-fjzt5                          1/1     Running            1          15h     192.168.1.103    w3-k8s   <none>           <none>

kube-system   calico-node-hpkd7                          1/1     Running            1          15h     192.168.1.102    w2-k8s   <none>           <none>

kube-system   coredns-74ff55c5b-dcqr5                    1/1     Running            1          15h     172.16.171.69    m-k8s    <none>           <none>

kube-system   coredns-74ff55c5b-jcsgf                    1/1     Running            1          15h     172.16.171.68    m-k8s    <none>           <none>

kube-system   etcd-m-k8s                                 1/1     Running            1          15h     192.168.1.10     m-k8s    <none>           <none>

kube-system   kube-apiserver-m-k8s                       1/1     Running            1          15h     192.168.1.10     m-k8s    <none>           <none>

kube-system   kube-controller-manager-m-k8s              1/1     Running            1          15h     192.168.1.10     m-k8s    <none>           <none>

kube-system   kube-proxy-2sktk                           1/1     Running            1          15h     192.168.1.102    w2-k8s   <none>           <none>

kube-system   kube-proxy-5clpq                           1/1     Running            1          15h     192.168.1.101    w1-k8s   <none>           <none>

kube-system   kube-proxy-fdjl7                           1/1     Running            1          15h     192.168.1.103    w3-k8s   <none>           <none>

kube-system   kube-proxy-wxtzk                           1/1     Running            1          15h     192.168.1.10     m-k8s    <none>           <none>

kube-system   kube-scheduler-m-k8s                       1/1     Running            1          15h     192.168.1.10     m-k8s    <none>           <none>

 

 

[root@m-k8s ~]# ping 8.8.8.8 -c 3

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.

64 bytes from 8.8.8.8: icmp_seq=1 ttl=115 time=44.6 ms

64 bytes from 8.8.8.8: icmp_seq=2 ttl=115 time=42.8 ms

64 bytes from 8.8.8.8: icmp_seq=3 ttl=115 time=43.0 ms

 

--- 8.8.8.8 ping statistics ---

3 packets transmitted, 3 received, 0% packet loss, time 2003ms

rtt min/avg/max/mdev = 42.823/43.523/44.662/0.847 ms

 

답변 1

답변을 작성해보세요.

0

안녕하세요 

 

nginx를 치셔야 하는데 ngnix로 오타를 치셔서 그렇습니다. 

 Warning  Failed     4m11s (x4 over 5m40s)  kubelet            Failed to pull image "ngnix": rpc error: code = Unknown desc = Error response from daemon: pull access denied for ngnix, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

 

배포된 것을 지우고 다시 해보시면 될 것 같습니다. 

저도 자주 쳐요..그러면서 배우는거죠 :) 

 

조훈 드림.