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

24,394 views
Skip to first unread message
Assigned to placi...@gmail.com by me

twel...@noon.com

unread,
May 14, 2017, 2:04:41 PM5/14/17
to Kubernetes user discussion and Q&A
I'm following the kubernetes getting started guide for the first time:

https://kubernetes.io/docs/getting-started-guides/gce/#starting-a-cluster

However, when I get to the step:

kubectl get --all-namespaces services


I get this error:

---
root@control:~# kubectl get --all-namespaces services
The connection to the server localhost:8080 was refused - did you specify the right host or port?
---

It doesn't look like a service was to be set up to run at any point on port 8080.
Why am I getting this error and how can I fix it?

Thanks in advance,
Traiano

secmask

unread,
May 15, 2017, 3:36:25 AM5/15/17
to Kubernetes user discussion and Q&A, twel...@noon.com
I got the same trouble since nearly release, seem must use KUBECONFIG explicit


sudo cp /etc/kubernetes/admin.conf $HOME/ sudo chown $(id -u):$(id -g) $HOME/admin.conf export KUBECONFIG=$HOME/admin.conf

Ahmet Alp Balkan

unread,
May 15, 2017, 3:46:14 PM5/15/17
to kubernet...@googlegroups.com, twel...@noon.com
Could you contribute back to the https://github.com/kubernetes/kubernetes.github.io repository please if you figured out the solution?

--
You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscribe@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

sarah....@crunchydata.com

unread,
May 20, 2017, 3:46:16 PM5/20/17
to Kubernetes user discussion and Q&A, twel...@noon.com

I'm having this same issue and haven't been able to come to a workaround yet. Have you managed to figure anything out?

nali...@gmail.com

unread,
Jul 24, 2017, 1:49:03 AM7/24/17
to Kubernetes user discussion and Q&A, twel...@noon.com
On Monday, May 15, 2017 at 1:06:25 PM UTC+5:30, secmask wrote:
> I got the same trouble since nearly release, seem must use KUBECONFIG explicit
>
> I also have same issue. please tell me if you figured it out. this is getting some times only. cant even access dashboard or anythings

nali...@gmail.com

unread,
Jul 24, 2017, 2:09:38 AM7/24/17
to Kubernetes user discussion and Q&A, twel...@noon.com
On Monday, May 15, 2017 at 1:06:25 PM UTC+5:30, secmask wrote:

I think my problem is api-server restarting always. don't have idea why this is happening

AJ NOURI

unread,
Aug 11, 2017, 8:37:05 PM8/11/17
to Kubernetes user discussion and Q&A, twel...@noon.com
Solved by getting credentials for the cluster:

> gcloud container clusters get-credentials <cluster-name> --zone us-east1-d --project <project-name>

rollr...@gmail.com

unread,
Jan 16, 2018, 11:50:26 PM1/16/18
to Kubernetes user discussion and Q&A
I'm facing the same issue on worker node, and this is on premises cluster setup not on google cloud.

Do we need to setup weave-net on worker nodes as well?

chellar...@gmail.com

unread,
Apr 13, 2018, 7:39:09 AM4/13/18
to Kubernetes user discussion and Q&A
On Wednesday, 17 January 2018 10:20:26 UTC+5:30, rollr...@gmail.com wrote:
> I'm facing the same issue on worker node, and this is on premises cluster setup not on google cloud.
>
> Do we need to setup weave-net on worker nodes as well?

On my case this is happening due to a failing kubelet service('service kubelet status') and I had to do 'swapoff -a' to disable paging and swapping which fixed the problem

#swapoff -a

Sunil Bhai

unread,
Apr 16, 2018, 12:28:07 PM4/16/18
to Kubernetes user discussion and Q&A
I have posted solutions and references on the below link. Kindly check
Reply all
Reply to author
Forward
0 new messages