创建部署问题时,请参考下面模板,你提供的信息越多,越容易及时获得解答。
你只花一分钟创建的问题,不能指望别人花上半个小时给你解答。
发帖前请点击 发表主题 右边的 预览(👀) 按钮,确保帖子格式正确。
操作系统信息
虚拟机,Centos7.9,8C/16G
Kubernetes版本信息
v1.23.10。多节点。
容器运行时
docker,20.10.8
KubeSphere版本信息
没安装
KubeKey版本信息
v3.0.7
问题是什么
第一次是使用KubeKey在完全干净的系统里创建集群,创建方式是使用KubeKey内置HAproxy创建高可用集群,可以正常创建集群,但是创建完才发现生成config-sample.yaml时的命令有问题,导致创建的集群没有KubeSphere,于是就使用KubeKey删除了集群,打算重新创建,但是重新创建却报错了。
20:22:07 CST success: [worker2]
20:22:07 CST success: [worker3]
20:22:07 CST success: [worker1]
20:22:07 CST success: [master2]
20:22:07 CST success: [master1]
20:22:07 CST success: [master3]
20:22:07 CST [ConfigureOSModule] configure the ntp server for each node
20:22:07 CST skipped: [worker3]
20:22:07 CST skipped: [master1]
20:22:07 CST skipped: [master2]
20:22:07 CST skipped: [master3]
20:22:07 CST skipped: [worker1]
20:22:07 CST skipped: [worker2]
20:22:07 CST [KubernetesStatusModule] Get kubernetes cluster status
20:22:07 CST stdout: [master2]
v1.23.10
20:22:07 CST stdout: [master2]
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?
20:22:07 CST message: [master2]
get kubernetes cluster info failed: Failed to exec command: sudo -E /bin/bash -c “/usr/local/bin/kubectl –no-headers=true get nodes -o custom-columns=:metadata.name,:status.nodeInfo.kubeletVersion,:status.addresses”
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?: Process exited with status 1
20:22:07 CST retry: [master2]
20:22:12 CST stdout: [master2]
v1.23.10
20:22:13 CST stdout: [master2]
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?
20:22:13 CST message: [master2]
get kubernetes cluster info failed: Failed to exec command: sudo -E /bin/bash -c “/usr/local/bin/kubectl –no-headers=true get nodes -o custom-columns=:metadata.name,:status.nodeInfo.kubeletVersion,:status.addresses”
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?: Process exited with status 1
20:22:13 CST retry: [master2]
20:22:18 CST stdout: [master2]
v1.23.10
20:22:18 CST stdout: [master2]
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?
20:22:18 CST message: [master2]
get kubernetes cluster info failed: Failed to exec command: sudo -E /bin/bash -c “/usr/local/bin/kubectl –no-headers=true get nodes -o custom-columns=:metadata.name,:status.nodeInfo.kubeletVersion,:status.addresses”
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?: Process exited with status 1
20:22:18 CST stdout: [master3]
v1.23.10
20:22:19 CST stdout: [master3]
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?
20:22:19 CST message: [master3]
get kubernetes cluster info failed: Failed to exec command: sudo -E /bin/bash -c “/usr/local/bin/kubectl –no-headers=true get nodes -o custom-columns=:metadata.name,:status.nodeInfo.kubeletVersion,:status.addresses”
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?: Process exited with status 1
20:22:19 CST retry: [master3]
20:22:24 CST stdout: [master3]
v1.23.10
20:22:24 CST stdout: [master3]
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?
20:22:24 CST message: [master3]
get kubernetes cluster info failed: Failed to exec command: sudo -E /bin/bash -c “/usr/local/bin/kubectl –no-headers=true get nodes -o custom-columns=:metadata.name,:status.nodeInfo.kubeletVersion,:status.addresses”
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?: Process exited with status 1
20:22:24 CST retry: [master3]
20:22:29 CST stdout: [master3]
v1.23.10
20:22:29 CST stdout: [master3]
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?
20:22:29 CST message: [master3]
get kubernetes cluster info failed: Failed to exec command: sudo -E /bin/bash -c “/usr/local/bin/kubectl –no-headers=true get nodes -o custom-columns=:metadata.name,:status.nodeInfo.kubeletVersion,:status.addresses”
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?: Process exited with status 1
20:22:29 CST success: [master1]
20:22:29 CST failed: [master2]
20:22:29 CST failed: [master3]
error: Pipeline[CreateClusterPipeline] execute failed: Module[KubernetesStatusModule] exec failed:
failed: [master2] [GetClusterStatus] exec failed after 3 retires: get kubernetes cluster info failed: Failed to exec command: sudo -E /bin/bash -c “/usr/local/bin/kubectl –no-headers=true get nodes -o custom-columns=:metadata.name,:status.nodeInfo.kubeletVersion,:status.addresses”
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?: Process exited with status 1
failed: [master3] [GetClusterStatus] exec failed after 3 retires: get kubernetes cluster info failed: Failed to exec command: sudo -E /bin/bash -c “/usr/local/bin/kubectl –no-headers=true get nodes -o custom-columns=:metadata.name,:status.nodeInfo.kubeletVersion,:status.addresses”
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?: Process exited with status 1
而且现在执行kubectl命令都会有报错,例如执行kubectl version
,就会显示:
Client Version: version.Info{Major:“1”, Minor:“23”, GitVersion:“v1.23.10”, GitCommit:“7e54d50d3012cf3389e43b096ba35300f36e0817”, GitTreeState:“clean”, BuildDate:“2022-08-17T18:32:54Z”, GoVersion:“go1.17.13”, Compiler:“gc”, Platform:“linux/amd64”}
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?