kubesphere / kubekey

Install Kubernetes/K3s only, both Kubernetes/K3s and KubeSphere, and related cloud-native add-ons, it supports all-in-one, multi-node, and HA 🔥 ⎈ 🐳
https://kubesphere.io
Apache License 2.0
2.36k stars 549 forks source link

The connection to the server localhost:8080 was refused #1174

Open xiaoheiren04 opened 2 years ago

xiaoheiren04 commented 2 years ago

Your current KubeKey version

Version:"1.1.1", my system version is centos7.6.

Describe this feature

Hi, guys, I followed this document to try the "All-in-One Installation of Kubernetes and KubeSphere on Linux" https://v3-1.docs.kubesphere.io/zh/docs/quick-start/all-in-one-on-linux/#%e4%be%9d%e8%b5%96%e9%a1%b9%e8%a6%81%e6%b1%82

but I encounterd this issue, could somebody take a look? Thank you.

[root@myk8s opt]# ./kk create cluster --with-kubernetes v1.20.4 ..... [upload-certs] Storing the certificates in Secret "kubeadm-certs" in the "kube-system" Namespace [upload-certs] Using certificate key: 4cfa77a07c42b00e2bf83d1184485208b1e6a744655c1d5d158c798555aa0835 WARN[20:23:28 CST] Task failed ... WARN[20:23:28 CST] error: Failed to patch kubeadm secret: Failed to exec command: sudo -E /bin/sh -c "/usr/local/bin/kubectl patch -n kube-system secret kubeadm-certs -p '{\"data\": {\"external-etcd-ca.crt\": \"\"}}'" The connection to the server localhost:8080 was refused - did you specify the right host or port?: Process exited with status 1 Error: Failed to get cluster status: Failed to patch kubeadm secret: Failed to exec command: sudo -E /bin/sh -c "/usr/local/bin/kubectl patch -n kube-system secret kubeadm-certs -p '{\"data\": {\"external-etcd-ca.crt\": \"\"}}'" The connection to the server localhost:8080 was refused - did you specify the right host or port?: Process exited with status 1

Describe the solution you'd like

Looks like the kubekey lost the kubeconfig?

Additional information

I tried to fix it by the following command, but issue still existed.

1.echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile

  1. source ~/.bash_profile
pixiake commented 2 years ago

You can try to delete the cluster ./kk delete cluster -f xxx.yaml and reinstall it.

chenhw commented 5 months ago

how did you solve this problem