k8s集群添加master节点提示control plane instance a cluster that doesn‘t have a stable controlPlaneEndpoint ad
k8s集群添加master节点提示unable to add a new control plane instance a cluster that doesn't have a stable controlPlaneEndpoint address
k8s集群添加master节点提示unable to add a new control plane instance a cluster that doesn't have a stable controlPlaneEndpoint address
检查kube-config.yaml文件
# kubeadm config view > kube-config.yaml
或者是直接查询
# kubectl get cm kubeadm-config -n kube-system
# kubectl describe cm kubeadm-config -n kube-system
发现没有controlPlaneEndpoint这个参数
或者从kubeadm config view 导出的文件中搜索controlPlaneEndpoint
# cat kube-config.yaml | grep controlPlaneEndpoint
添加controlPlaneEndpoint这个参数
# kubectl edit cm kubeadm-config -n kube-system
添加位置如下:
同样通过文件方式添加后修改kube-config.yaml 文件并重新加载配置
# kubectl apply -f kube-config.yaml
再将主master01上的证书及文件copy到master02节点上
# scp -r /etc/kubernetes/pki 192.168.137.21:/etc/kubernetes
# scp -r /etc/kubernetes/admin.conf 192.168.137.21:/etc/kubernetes
重新再将master02添加入集群,若加入命令时效,可以在master01上生成join命令执行kubeadm token create --print-join-command 生成新的加入命令
# kubeadm join 192.168.137.20:6443 --token eeea4n.oiy6lybaprz1wxvc --discovery-token-ca-cert-hash sha256:6f26e3dba55d8b34967f248326377afa6876793a63b2d417623c7e1b0c4b23ae --control-plane --certificate-key ea12a7838270108a68fdaf9239145f95aac4abfdcace15e4b7446f18a3f54a32
按照命令生成要求执行如下命令,便于管理集群 集群node节点状态正常,pod状态正常,manifest目录下配置文件生成正常
更多推荐
所有评论(0)