Programmers learn & share
+1 vote
75 views

Problem :

I am getting following kubernetes error and dont understand why command line is trying to connect to localhost?
the connection to the server localhost:8080 was refused - did you specify the right host or port?
by (6.9k points)   | 75 views

1 Answer

0 votes

Solution :

Please make sure your config is set to the project

gcloud config set project [PROJECT_ID]

Kindly run a checklist of the Clusters in the account: 

gcloud container clusters list

Must check the output : 

NAME LOCATION MASTER_VERSION MASTER_IP MACHINE_TYPE NODE_VE. alpha-cluster asia-south1-a 1.9.7-gke.6 35.200.254.78 f1-micro 1.9.7- NUM_NODES STATUS gke.6 3 RUNNING

Run the cmd

-gcloud container clusters get-credentials your-cluster-name --zone your-zone --project your-project

 

The output follows:

Fetching cluster endpoint and auth data. kubeconfig entry generated for alpha-cluster.

 

Now check the details of the node running kubectl like
-kubectl get nodes -o wide

If you follow above steps your issues will be resolved.

by (36.1k points)  
edited by
2,187 questions
2,514 answers
59 comments
241 users