以下是报错信息

[root@k8s-master01 ~]# kubectl describe pod pod-base -n dev
Name:             pod-base
Namespace:        dev
Priority:         0
Service Account:  default
Node:             k8s-node01/192.168.58.130
Start Time:       Mon, 03 Jun 2024 16:37:04 +0800
Labels:           user=yoozoo
Annotations:      cni.projectcalico.org/containerID: 20a12171424dc2513d982efcc5760be9c7c4abe9f54d94bce8dd62dca83b7f60
                  cni.projectcalico.org/podIP: 172.16.85.194/32
                  cni.projectcalico.org/podIPs: 172.16.85.194/32
Status:           Pending
IP:               172.16.85.194
IPs:
  IP:  172.16.85.194
Containers:
  nginx:
    Container ID:   docker://93b76cbefd4512638353a0cfb9b1ba90d1e2e62e4225aa77711e0ba265fd3cae
    Image:          nginx
    Image ID:       docker-pullable://nginx@sha256:fad8e1cd52e24bce7b72cd7cb674a2efad671647b917055f5bd8a1f7ac9b1af8
    Port:           <none>
    Host Port:      <none>
    State:          Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Mon, 03 Jun 2024 16:38:00 +0800
      Finished:     Mon, 03 Jun 2024 17:15:57 +0800
    Ready:          False
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-m847k (ro)
  busybox:
    Container ID:   
    Image:          busybox
    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-m847k (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  kube-api-access-m847k:
    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       60m                 default-scheduler  Successfully assigned dev/pod-base to k8s-node01
  Normal   Pulling         60m                 kubelet            Pulling image "nginx"
  Normal   Pulled          59m                 kubelet            Successfully pulled image "nginx" in 53.409s (53.409s including waiting)
  Normal   Created         59m                 kubelet            Created container nginx
  Normal   Started         59m                 kubelet            Started container nginx
  Warning  Failed          57m                 kubelet            Failed to pull image "busybox": error pulling image configuration: download failed after attempts=6: dial tcp 108.160.161.20:443: connect: connection refused
  Warning  Failed          55m                 kubelet            Failed to pull image "busybox": error pulling image configuration: download failed after attempts=6: dial tcp 157.240.2.36:443: connect: connection refused
  Warning  Failed          52m                 kubelet            Failed to pull image "busybox": error pulling image configuration: download failed after attempts=6: dial tcp 199.59.148.201:443: connect: connection refused
  Normal   Pulling         51m (x4 over 59m)   kubelet            Pulling image "busybox"
  Warning  Failed          49m                 kubelet            Failed to pull image "busybox": error pulling image configuration: download failed after attempts=6: dial tcp 162.125.32.2:443: connect: connection refused
  Warning  Failed          49m (x5 over 57m)   kubelet            Error: ImagePullBackOff
  Warning  Failed          49m (x4 over 57m)   kubelet            Error: ErrImagePull
  Warning  Failed          45m                 kubelet            Failed to pull image "busybox": error pulling image configuration: download failed after attempts=6: dial tcp 157.240.10.41:443: connect: connection refused
  Warning  Failed          40m                 kubelet            Failed to pull image "busybox": error pulling image configuration: download failed after attempts=6: dial tcp 104.244.46.165:443: connect: connection refused
  Normal   BackOff         30m (x56 over 57m)  kubelet            Back-off pulling image "busybox"
  Warning  Failed          25m                 kubelet            (combined from similar events): Failed to pull image "busybox": error pulling image configuration: download failed after attempts=6: dial tcp 65.49.68.152:443: connect: connection refused
  Normal   SandboxChanged  25s (x43 over 21m)  kubelet            Pod sandbox changed, it will be killed and re-created.

解决方法:更换阿里云镜像,再次尝试下载

vi /etc/docker/daemon.json

{
 "registry-mirrors":["https://6kx4zyno.mirror.aliyuncs.com"]
}

重启

systemctl daemon-reload
systemctl restart docker

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐