K8S拉取busybox镜像时发生报错解决

以下是报错信息

[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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

元气满满的热码式

感谢您的支持!我会继续努力发布

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值