当前位置:   article > 正文

下载镜像提示 output: Error response from daemon: Get https://k8s.gcr.io/v2/: x509: certificate has expired...

下载镜像提示 output: Error response from daemon: Get https://k8s.gcr.io/v2/: x509: certificate has expired...

出现这问题可能是两种原因:
1、k8s 所有节点的时间不统一。
2、k8s 配置文件镜像仓库有问题

问题:

  1. [root@master1 ~]# kubeadm config images pull --config kubeadm-config.yaml
  2. W0920 01:12:10.794030 2723 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]
  3. failed to pull image "k8s.gcr.io/kube-apiserver:v1.18.2": output: Error response from daemon: Get https://k8s.gcr.io/v2/: x509: certificate has expired or is not yet valid
  4. , error: exit status 1
  5. To see the stack trace of this error execute with --v=5 or higher

解决
编辑 kubeadm-config.yaml 文件改镜像仓库

  1. dns:
  2. type: CoreDNS
  3. etcd:
  4. local:
  5. dataDir: /var/lib/etcd
  6. imageRepository: registry.aliyuncs.com/google_containers # 改完之后的镜像仓库地址
  7. kind: ClusterConfiguration
  8. kubernetesVersion: v1.18.2
  9. networking:
  10. dnsDomain: cluster.local
  11. podSubnet: "10.244.0.0/16"
  12. serviceSubnet: 10.96.0.0/12
  13. scheduler: {}

或者

同步 k8s 所有节点时间

  1. timedatectl set-timezone Asia/Shanghai
  2. chronyc -a makestep
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/565776
推荐阅读
相关标签
  

闽ICP备14008679号