出现这问题可能是两种原因:
1、k8s 所有节点的时间不统一。
2、k8s 配置文件镜像仓库有问题
问题:
[root@master1 ~]# kubeadm config images pull --config kubeadm-config.yaml
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]
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
, error: exit status 1
To see the stack trace of this error execute with --v=5 or higher
解决
编辑 kubeadm-config.yaml 文件改镜像仓库
dns:
type: CoreDNS
etcd:
local:
dataDir: /var/lib/etcd
imageRepository: registry.aliyuncs.com/google_containers # 改完之后的镜像仓库地址
kind: ClusterConfiguration
kubernetesVersion: v1.18.2
networking:
dnsDomain: cluster.local
podSubnet: "10.244.0.0/16"
serviceSubnet: 10.96.0.0/12
scheduler: {}
或者
同步 k8s 所有节点时间
timedatectl set-timezone Asia/Shanghai
chronyc -a makestep
标签:daemon,gcr,io,镜像,output,kubeadm,k8s,config
From: https://blog.51cto.com/u_14620403/8868210