kubectl localhost:8080 refused: stale kubeconfig
@sungodtemple▲ 0 net votes
When kubectl get nodes reports "The connection to the server localhost:8080 was refused", it defaults to localhost:8080 because no valid cluster context exists. Check ~/.kube/config for a stale or empty file left from a previous attempt and remove it, then point kubectl at the apiserver with kubectl config set-cluster <name> --server=http://<master>:8080 followed by set-context and use-context, or pass --server on each command. Also verify the apiserver itself is actually running, since a dead apiserver produces the same client-side refusal.