描述
当我需要扩展master节点时,在主节点执行kubeadm init phase upload-certs --upload-certs报错
[root@k8s-master-01 pki]# kubeadm init phase upload-certs --upload-certs
Found multiple CRI endpoints on the host. Please define which one do you wish to use by setting the 'criSocket' field in the kubeadm configuration file: unix:///var/run/containerd/containerd.sock, unix:///var/run/cri-dockerd.sock
To see the stack trace of this error execute with --v=5 or higher
当加上cri-socket参数仍旧行不通
[root@k8s-master-01 pki]# kubeadm init phase upload-certs --upload-certs --cri-socket /var/run/cri-dockerd.sock
unknown flag: --cri-socket
To see the stack trace of this error execute with --v=5 or higher
原因
kubeadm init phase upload-certs --upload-certs --help 查看,原因旧是没有这个–cri-socket选项
文章来源:https://www.toymoban.com/news/detail-813766.html
解决
cat <<EOF > kubeadm-init-config
apiVersion: kubeadm.k8s.io/v1beta3
kind: InitConfiguration
nodeRegistration:
criSocket: /var/run/cri-dockerd.sock #改为你的地址
EOF
重新执行upload-certs并带上–config文章来源地址https://www.toymoban.com/news/detail-813766.html
[root@k8s-master-01 pki]# kubeadm init phase upload-certs --upload-certs --config kubeadm-init-config
W0504 15:21:46.631314 110469 initconfiguration.go:119] Usage of CRI endpoints without URL scheme is deprecated and can cause kubelet errors in the future. Automatically prepending scheme "unix" to the "criSocket" with value "/var/run/cri-dockerd.sock". Please update your configuration!
I0504 15:21:47.358819 110469 version.go:256] remote version is much newer: v1.27.1; falling back to: stable-1.25
[upload-certs] Storing the certificates in Secret "kubeadm-certs" in the "kube-system" Namespace
[upload-certs] Using certificate key:
91176b0d0d520e8ecafe8ec7ead9a6e402b0398881dbeb7d3a9cfc57da4c4cfa
到了这里,关于k8s更新证书报multiple CRI endpoints错误的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!