Kubernetes error Did you speciy the right host or port

0 votes

'm trying to run the following command:

kubectl run hello-node --image=gcr.io/PROJECT_ID/hello-node:v1 --port=8080

But I get this error: The connection to the server localhost:8080 was refused - did you specify the right host or port?

What's happening here? Why is the CLI trying to connect to localhost?

Jan 9, 2019 in Kubernetes by Atul
• 10,240 points
1,585 views

1 answer to this question.

0 votes

Try and auto generate your kubeconfig.

Use:

gcloud container clusters get-credentials "CLUSTER NAME"

This seemed to work for me.

answered Jan 9, 2019 by DareDev
• 6,890 points

Related Questions In Kubernetes

0 votes
1 answer

The connection to the server 192.168.99.101:8443 was refused - did you specify the right host or port?

Hi@akhtar, This error may occur because of network ...READ MORE

answered May 21, 2020 in Kubernetes by MD
• 95,440 points
3,896 views
0 votes
1 answer

The connection to the server localhost:8080 was refused - did you specify the right host or port?

Hi@akhtar, You may get this error if Kubectl ...READ MORE

answered Jun 6, 2020 in Kubernetes by MD
• 95,440 points
40,500 views
0 votes
2 answers

Not able to expose port 80 on the host, kubernetes ingress

I was facing the same error. The nginix ...READ MORE

answered Sep 11, 2018 in Kubernetes by Kalgi
• 52,360 points
1,755 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
14,614 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,360 points

reshown Apr 12, 2019 by Kalgi 6,104 views
0 votes
1 answer

What's the difference between kubernetes load balancer and ingress controller?

Load Balancer: So Kubernetes LoadBalancer just points ...READ MORE

answered Jan 4, 2019 in Kubernetes by DareDev
• 6,890 points
13,512 views
0 votes
1 answer

deleting pods using kubernetes replication controller

The pods which are managed by ReplicationController ...READ MORE

answered Jul 24, 2018 in Kubernetes by DareDev
• 6,890 points
873 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP