Reputation: 101
The Google cloud SDK console showing "Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it." below error when I'm trying to run kubectl commands
Upvotes: 1
Views: 1349
Reputation: 3613
This error indicates that your kubeconfig
is not correct.
In order to use connect to cluster you can run:
gcloud container clusters list
to get the name of your cluster and then run:
gcloud container clusters get-credentials <cluster-name>
to generate kubeconfig
for chosen cluster.
Upvotes: 1