在安装kubesphere时报错
Error: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp 127.0.0.1:8080: connect: connection refused
helm.go:92: 2025-06-27 15:14:43.30908177 +0000 UTC m=+0.033127135 [debug] Get "http://localhost:8080/version": dial tcp 127.0.0.1:8080: connect: connection refused
问题原因:
因为helm默认使用k8s的配置文件,默认位置为 ~/.kube/config.yml,因为是k3s所以配置文件要使用环境变量来指定:
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
上面是默认位置。修改为你的访问集群的配置文件位置即可。