在安裝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
上面是默認位置。修改為你的訪問集群的配置文件位置即可。