kubeadm init 失败: failed to pull image k8s.gcr.io/etcd:3.4.13

编程入门 行业动态 更新时间:2024-10-10 12:26:18

kubeadm init 失败: failed to <a href=https://www.elefans.com/category/jswz/34/1768718.html style=pull image k8s.gcr.io/etcd:3.4.13"/>

kubeadm init 失败: failed to pull image k8s.gcr.io/etcd:3.4.13

一. kubeadm init 失败

报错:

error execution phase preflight: [preflight] Some fatal errors occurred:[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-apiserver:v1.19.3: output: Error response from daemon: Get /: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-controller-manager:v1.19.3: output: Error response from daemon: Get /: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-scheduler:v1.19.3: output: Error response from daemon: Get /: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-proxy:v1.19.3: output: Error response from daemon: Get /: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1[ERROR ImagePull]: failed to pull image k8s.gcr.io/pause:3.2: output: Error response from daemon: Get /: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1[ERROR ImagePull]: failed to pull image k8s.gcr.io/etcd:3.4.13-0: output: Error response from daemon: Get /: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1[ERROR ImagePull]: failed to pull image k8s.gcr.io/coredns:1.7.0: output: 

二. 原因

因为k8s.gcr.io镜像库在国内需要翻墙,所以普通下载无法成功完成,可以更改一下下载的镜像库地址为国内地址,下载后将标签打回和kubeadm config一致的方法解决。

  • 更改前查看镜像地址
[root@master01 opt]# kubeadm config images list
I0825 12:06:37.047523   32435 version.go:252] remote version is much newer: v1.28.1; falling back to: stable-1.19
W0825 12:06:38.260046   32435 configset.go:348] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]
k8s.gcr.io/kube-apiserver:v1.19.16
k8s.gcr.io/kube-controller-manager:v1.19.16
k8s.gcr.io/kube-scheduler:v1.19.16
k8s.gcr.io/kube-proxy:v1.19.16
k8s.gcr.io/pause:3.2
k8s.gcr.io/etcd:3.4.13-0
k8s.gcr.io/coredns:1.7.0
  • 更改镜像基地址
for i in `kubeadm config images list`; doimageName=${i#k8s.gcr.io/}docker pull registry.aliyuncs/google_containers/$imageNamedocker tag registry.aliyuncs/google_containers/$imageName k8s.gcr.io/$imageNamedocker rmi registry.aliyuncs/google_containers/$imageName
done;

三. 重新执行 kubeadm init

[root@mater01 opt]# sudo kubeadm initYour Kubernetes control-plane has initialized successfully!To start using your cluster, you need to run the following as a regular user:mkdir -p $HOME/.kubesudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/configsudo chown $(id -u):$(id -g) $HOME/.kube/configYou should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at: you can join any number of worker nodes by running the following on each as root:kubeadm join 101.16.97.0:6443 --token iplvm8.ex1q0syqg \--discovery-token-ca-cert-hash sha256:3266bbdab19c3640d43f486e63dc0a8660de5

更多推荐

kubeadm init 失败: failed to pull image k8s.gcr.io/etcd:3.4.13

本文发布于:2024-03-07 21:29:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1718959.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:pull   image   failed   kubeadm   init

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!