问题描述:

K8S安装,执行kubeadm init --apiserver-advertise-address 192.168.123.xx --pod-network-cidr=172.17.0.0/16

报错: Error response from daemon: Get "https://k8s.gcr.io/v2/"

原因:无法访问https://k8s.gcr.io/v2/,网络连接不通。

处理办法:

改用阿里的镜像地址,然后拉取镜像:(注意镜像版本)

images=(
    kube-apiserver:v1.23.6
    kube-controller-manager:v1.23.6
    kube-scheduler:v1.23.6
    kube-proxy:v1.23.6
    pause:3.6
    etcd:3.5.1-0
    coredns:v1.8.6
)

for list in ${images[@]} ; do
    docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/$list
    docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/$list k8s.gcr.io/$list
done
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:v1.8.6 k8s.gcr.io/coredns/coredns:v1.8.6

修改完成,再次执行初始化

kubeadm reset -f

kubeadm init --apiserver-advertise-address 192.168.123.xx --pod-network-、cidr=172.17.0.0/16

同类问题的相关链接:

[k8s部署踩过的坑]_error execution phase wait-control-plane: couldn't-CSDN博客 

Logo

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

更多推荐