首页 新闻 会员 周边

创建 k8s 集群报错:"error execution phase wait-control-plane"

0
悬赏园豆:20 [已解决问题] 解决于 2026-10-05 18:07

使用下面的命令创建 kubernetes 集群

kubeadm init \
  --control-plane-endpoint "k8s-api:6443" --upload-certs \
  --image-repository registry.cnblogs.com \
  --pod-network-cidr=192.168.0.0/16

创建过程中出现下面的错误,请问如何解决?

[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Starting the kubelet
error: error execution phase wait-control-plane: cannot obtain client without bootstrap: could not bootstrap the admin user in file admin.conf: unable to create ClusterRoleBinding: context deadline exceeded
To see the stack trace of this error execute with --v=5 or higher
dudu的主页 dudu | 高人七级 | 园豆:22785
提问于:2026-10-05 17:40
< >
分享
最佳答案
0

是 sandbox 的镜像拉取失败引起的,默认用的镜像是 registry.k8s.io/pause:3.10.2

在 /etc/containerd/config.toml 中将

[plugins.'io.containerd.cri.v1.images'.pinned_images]
  sandbox = 'registry.cnblogs.com/pause:3.10.2'

改为私有镜像仓库的镜像地址即可解决

[plugins.'io.containerd.cri.v1.images'.pinned_images]
  sandbox = 'registry.k8s.io/pause:3.10.2'
dudu | 高人七级 |园豆:22785 | 2026-10-05 18:06
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册。