harish hari
harish hari

Reputation: 101

kubectl get node getting unable to connect to the server

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

click here to view image

Upvotes: 1

Views: 1349

Answers (1)

kool
kool

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

Related Questions