0
votes

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

1
Where is your Kubernetes cluster?Rico
That error means that you do not have a valid kubeconfig file. Please follow this steps (gcloud container clusters get-credentials )[cloud.google.com/sdk/gcloud/reference/container/clusters/… to get your kubeconfig file. Confirm with us if the error persist.Armando Cuevas
Is your master private?guillaume blaquiere

1 Answers

1
votes

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.