创建部署问题时,请参考下面模板,你提供的信息越多,越容易及时获得解答。如果未按模板创建问题,管理员有权关闭问题。
确保帖子格式清晰易读,用 markdown code block 语法格式化代码块。
你只花一分钟创建的问题,不能指望别人花上半个小时给你解答。
操作系统信息
例如:虚拟机/物理机,Centos7.5/Ubuntu18.04,4C/8G
CentOS 7.9.2009 , 6C/64G
Kubernetes版本信息
将 kubectl version
命令执行结果贴在下方
Client Version: v1.28.15
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
The connection to the server localhost:8080 was refused - did you specify the right host or port?
容器运行时
将 docker version
/ crictl version
/ nerdctl version
结果贴在下方
Client:
Version: 24.0.9
API version: 1.43
Go version: go1.20.13
Git commit: 2936816
Built: Thu Feb 1 00:47:46 2024
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 24.0.9
API version: 1.43 (minimum version 1.12)
Go version: go1.20.13
Git commit: fca702d
Built: Thu Feb 1 00:49:16 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.7.13
GitCommit: 7c3aca7a610df76212171d200ca3811ff6096eb8
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e94
docker-init:
Version: 0.19.0
GitCommit: de40ad0
KubeSphere版本信息
例如:v2.1.1/v3.0.0。离线安装还是在线安装。在已有K8s上安装还是使用kk安装。
v4.1.2
问题是什么
报错日志是什么,最好有截图。
./kk create cluster -f config-sample.yaml -a kubesphere.tar.gz –with-local-storage -y
执行这个命令离线安装kubernetes集群时报错
注意:我只有一个物理服务器
config-sample.yml配置:
apiVersion: kubekey.kubesphere.io/v1alpha2
kind: Cluster
metadata:
name: sample
spec:
hosts:
{name: node1, address: 10.30.100.15, internalAddress: 10.30.100.15, user: root, password: “xxx”}
roleGroups:
etcd:
node1
control-plane:
node1
worker:
node1
controlPlaneEndpoint:
Internal loadbalancer for apiservers
internalLoadbalancer: haproxy
domain: lb.kubesphere.local
address: ""
port: 6443
kubernetes:
version: v1.28.15
clusterName: cluster.local
autoRenewCerts: true
containerManager: containerd
etcd:
type: kubekey
network:
plugin: calico
kubePodsCIDR: 10.30.100.0/18
kubeServiceCIDR: 10.30.0.0/18
multusCNI:
enabled: false
registry:
type: none
auths:
“harbor.ai.sthj.wang”:
username: admin
password: Harbor12345
plainHTTP: false # 如果 Harbor 使用 HTTPS,请将该参数设置为 false
privateRegistry: “harbor.ai.sthj.wang”
registryMirrors: []
insecureRegistries: []
addons: []
报错信息如下 :
10:58:55 CST [InstallETCDBinaryModule] Generate access address
10:58:55 CST success: [node1]
10:58:55 CST [ETCDConfigureModule] Health check on exist etcd
10:58:56 CST command: [node1]
sudo -E /bin/bash -c “export ETCDCTL_API=2;export ETCDCTL_CERT_FILE=‘/etc/ssl/etcd/ssl/admin-node1.pem’;export ETCDCTL_KEY_FILE=‘/etc/ssl/etcd/ssl/admin-node1-key.pem’;export ETCDCTL_CA_FILE=‘/etc/ssl/etcd/ssl/ca.pem’;/usr/local/bin/etcdctl –endpoints=https://10.30.100.15:2379 cluster-health | grep -q ‘cluster is healthy’”
10:58:56 CST stdout: [node1]
Error: client: etcd cluster is unavailable or misconfigured; error #0: dial tcp 10.30.100.15:2379: connect: connection refused
error #0: dial tcp 10.30.100.15:2379: connect: connection refused
10:58:56 CST stderr: [node1]
Failed to exec command: sudo -E /bin/bash -c “export ETCDCTL_API=2;export ETCDCTL_CERT_FILE=‘/etc/ssl/etcd/ssl/admin-node1.pem’;export ETCDCTL_KEY_FILE=‘/etc/ssl/etcd/ssl/admin-node1-key.pem’;export ETCDCTL_CA_FILE=‘/etc/ssl/etcd/ssl/ca.pem’;/usr/local/bin/etcdctl –endpoints=https://10.30.100.15:2379 cluster-health | grep -q ‘cluster is healthy’”
Error: client: etcd cluster is unavailable or misconfigured; error #0: dial tcp 10.30.100.15:2379: connect: connection refused
error #0: dial tcp 10.30.100.15:2379: connect: connection refused: Process exited with status 1
10:58:56 CST message: [node1]
etcd health check failed: Failed to exec command: sudo -E /bin/bash -c “export ETCDCTL_API=2;export ETCDCTL_CERT_FILE=‘/etc/ssl/etcd/ssl/admin-node1.pem’;export ETCDCTL_KEY_FILE=‘/etc/ssl/etcd/ssl/admin-node1-key.pem’;export ETCDCTL_CA_FILE=‘/etc/ssl/etcd/ssl/ca.pem’;/usr/local/bin/etcdctl –endpoints=https://10.30.100.15:2379 cluster-health | grep -q ‘cluster is healthy’”
Error: client: etcd cluster is unavailable or misconfigured; error #0: dial tcp 10.30.100.15:2379: connect: connection refused
error #0: dial tcp 10.30.100.15:2379: connect: connection refused: Process exited with status 1