创建部署问题时,请参考下面模板,你提供的信息越多,越容易及时获得解答。如果未按模板创建问题,管理员有权关闭问题。
确保帖子格式清晰易读,用 markdown code block 语法格式化代码块。
你只花一分钟创建的问题,不能指望别人花上半个小时给你解答。
操作系统信息
ubuntu 22.04
Kubernetes版本信息
将 kubectl version
命令执行结果贴在下方
Client Version: version.Info{Major:“1”, Minor:“21”, GitVersion:“v1.21.5”, GitCommit:“aea7bbadd2fc0cd689de94a54e5b7b758869d691”, GitTreeState:“clean”, BuildDate:“2021-09-15T21:10:45Z”, GoVersion:“go1.16.8”, Compiler:“gc”, Platform:“linux/amd64”}
Server Version: version.Info{Major:“1”, Minor:“21”, GitVersion:“v1.21.5”, GitCommit:“aea7bbadd2fc0cd689de94a54e5b7b758869d691”, GitTreeState:“clean”, BuildDate:“2021-09-15T21:04:16Z”, GoVersion:“go1.16.8”, Compiler:“gc”, Platform:“linux/amd64”}
容器运行时
将 docker version
/ crictl version
/ nerdctl version
结果贴在下方
Client:
Version: 20.10.12
API version: 1.41
Go version: go1.16.2
Git commit: 20.10.12-0ubuntu2~20.04.1
Built: Wed Apr 6 02:14:38 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Server:
Engine:
Version: 20.10.12
API version: 1.41 (minimum version 1.12)
Go version: go1.16.2
Git commit: 20.10.12-0ubuntu2~20.04.1
Built: Thu Feb 10 15:03:35 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.5.9-0ubuntu1~20.04.4
GitCommit:
runc:
Version: 1.1.0-0ubuntu1~20.04.1
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
KubeSphere版本信息
v3.2.1
问题是什么
通过kk增加新节点,总是报错。
09:18:34 CST message: [localhost]
docker is existed
09:18:34 CST success: [LocalHost]
09:18:34 CST [ConfigureOSModule] Prepare to init OS
09:18:35 CST success: [node2]
09:18:35 CST success: [ecs-5b73]
09:18:35 CST [ConfigureOSModule] Generate init os script
09:18:35 CST success: [ecs-5b73]
09:18:35 CST success: [node2]
09:18:35 CST [ConfigureOSModule] Exec init os script
09:18:36 CST stdout: [node2]
net.ipv4.ip_forward = 1
vm.swappiness = 1
net.core.somaxconn = 1024
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_max_syn_backlog = 1024
kernel.unknown_nmi_panic = 1
net.bridge.bridge-nf-call-arptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_local_reserved_ports = 30000-32767
vm.max_map_count = 262144
fs.inotify.max_user_instances = 524288
kernel.pid_max = 65535
09:18:39 CST stdout: [ecs-5b73]
net.ipv4.ip_forward = 1
vm.swappiness = 1
net.core.somaxconn = 1024
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_max_syn_backlog = 1024
net.bridge.bridge-nf-call-arptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_local_reserved_ports = 30000-32767
vm.max_map_count = 262144
fs.inotify.max_user_instances = 524288
kernel.pid_max = 65535
09:18:39 CST success: [node2]
09:18:39 CST success: [ecs-5b73]
09:18:39 CST [ConfigureOSModule] configure the ntp server for each node
09:18:39 CST skipped: [node2]
09:18:39 CST skipped: [ecs-5b73]
09:18:39 CST [KubernetesStatusModule] Get kubernetes cluster status
09:18:39 CST stdout: [ecs-5b73]
v1.21.5
09:18:39 CST stdout: [ecs-5b73]
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?
09:18:39 CST message: [ecs-5b73]
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
09:18:39 CST retry: [ecs-5b73]
09:18:44 CST stdout: [ecs-5b73]
v1.21.5
09:18:44 CST stdout: [ecs-5b73]
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?
09:18:44 CST message: [ecs-5b73]
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
09:18:44 CST retry: [ecs-5b73]
09:18:49 CST stdout: [ecs-5b73]
v1.21.5
09:18:49 CST stdout: [ecs-5b73]
The connection to the server lb.kubesphere.local:6443 was refused - did you specify the right host or port?
09:18:49 CST message: [ecs-5b73]
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
09:18:49 CST failed: [ecs-5b73]
error: Pipeline[AddNodesPipeline] execute failed: Module[KubernetesStatusModule] exec failed:
failed: [ecs-5b73] [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
补充: 执行kk命令之前 kubectl 命令正常使用。 执行kk add nodes 报错后, kubectl命令短暂无法使用,过一会儿自动恢复。