TimeBye / kubeadm-ha

kubeadm-ha 使用 kubeadm 进行高可用 kubernetes 集群搭建,利用 ansible-playbook 实现自动化安装,既提供一键安装脚本,也可以根据 playbook 分步执行安装各个组件。
Other
607 stars 298 forks source link

切换到slb 模式后添加worker 节点失败 #108

Closed EasonHe closed 2 years ago

EasonHe commented 2 years ago

缺陷描述

我先正常初始化安装,然后再切换大到slb,结果是worker 添加失败

执行下面括号中的命令,提交返回结果 fatal: [10.108.136.18]: FAILED! => {"changed": true, "cmd": "source /etc/profile && kubeadm join --config /etc/kubernetes/kubeadm-config.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,FileAvailable--etc-kubernetes-pki-ca.crt\n", "delta": "0:00:00.639717", "end": "2022-06-08 12:25:24.684608", "msg": "non-zero return code", "rc": 1, "start": "2022-06-08 12:25:24.044891", "stderr": "\t[WARNING FileAvailable--etc-kubernetes-pki-ca.crt]: /etc/kubernetes/pki/ca.crt already exists\nerror execution phase preflight: unable to fetch the kubeadm-config ConfigMap: failed to get config map: Get \"https://127.0.0.1:8443/api/v1/namespaces/kube-system/configmaps/kubeadm-config?timeout=10s\": dial tcp 127.0.0.1:8443: connect: connection refused\nTo see the stack trace of this error execute with --v=5 or higher", "stderr_lines": ["\t[WARNING FileAvailable--etc-kubernetes-pki-ca.crt]: /etc/kubernetes/pki/ca.crt already exists", "error execution phase preflight: unable to fetch the kubeadm-config ConfigMap: failed to get config map: Get \"https://127.0.0.1:8443/api/v1/namespaces/kube-system/configmaps/kubeadm-config?timeout=10s\": dial tcp 127.0.0.1:8443: connect: connection refused", "To see the stack trace of this error execute with --v=5 or higher"], "stdout": "[preflight] Running pre-flight checks\n[preflight] Reading configuration from the cluster...\n[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'", "stdout_lines": ["[preflight] Running pre-flight checks", "[preflight] Reading configuration from the cluster...", "[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'"]}

需要在切换会nginx 模式添加节点么?

TimeBye commented 2 years ago

看报错信息你应该还是使用的nginx本地负载模式

TimeBye commented 2 years ago

请检查一下负载模式是否正确修改

EasonHe commented 2 years ago

请问正确的安装步骤是什么,我先使用nginx模式安装,然后切换到slb ,后面添加节点是不需要再切回nginx模式吧

TimeBye commented 2 years ago

请问正确的安装步骤是什么,我先使用nginx模式安装,然后切换到slb ,后面添加节点是不需要再切回nginx模式吧

是的,就是这个步骤,不需要再切回nginx模式,直接添加节点就可以了