[Kubernets 相关镜像下载遇到]failed to pull image “k8s.gcr.io/kube-apiserver:v1.22.0“: output: Error response

问题原因: https://k8s.gcr.io/v2/国内无法访问。
我们执行:kubeadm config images pull --config=init.default.yaml用于抓取镜像。
该指令依赖两个数据:

  1. /etc/docker/daemon.json
    作用:用于设定docker pull 时使用的加速URL
    注意:如果在daemon.json文件中进行配置,需要docker版本高于1.12.6(在这个版本上不生效)
    官方的配置地址:https://docs.docker.com/engine/reference/commandline/dockerd/#/linux-configuration-file
    可设定参数及含义如下:
    “insecure-registries”: [], #这个私库的服务地址
    “registry-mirrors”: [], #私库加速器
    执行指令:
    echo ‘{“registry-mirrors”:[“https://registry.docker-cn.com”]}’ > /etc/docker/daemon.json
    systemctl stop docker #关掉docker service
    systemctl enable docker && systemctl start docker #开启开机启动;启动docker service
  2. init.default.yaml (本次出现问题因为这里设定不对)
    a. kubeadm生成一个default 设定:kubeadm config print init-defaults > init.default.yaml
    b. 修改设定内容:
    主节点IP——advertiseAddress
    国内阿里镜像地址imageReposit
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
error execution phase preflight: [preflight] Some fatal errors occurred: [ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-apiserver:v1.22.17: output: Error response from daemon: Ge t "https://k8s.gcr.io/v2/": 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.22.17: output: Error response from d aemon: Get "https://k8s.gcr.io/v2/": 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.22.17: output: Error response from daemon: Ge t "https://k8s.gcr.io/v2/": 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.22.17: output: Error response from daemon: Get "h ttps://k8s.gcr.io/v2/": 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.5: output: Error response from daemon: Get "https://k8s .gcr.io/v2/": context deadline exceeded, error: exit status 1 [ERROR ImagePull]: failed to pull image k8s.gcr.io/etcd:3.5.0-0: output: Error response from daemon: Get "https:// k8s.gcr.io/v2/": 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/coredns:v1.8.4: output: Error response from daemon: Get "https://k8s.gcr.io/v2/": context deadline exceeded, error: exit status 1 [preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...` To see the stack trace of this error execute with --v=5 or higher
07-12

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值