connection refused after kubeadm init

539 views
Skip to first unread message

bilal achahbar

unread,
Mar 1, 2018, 10:24:32 AM3/1/18
to Kubernetes developer/contributor discussion
I am trying to setup a kubernetes cluster on a raspberry pi cluster.

In the time i was waiting for my pi's to arrive i tried the kubernetes cluster in virtualbox.
Oké that wasn't an arm system but turorials online say it's the same setup.

I initialized my master with the following command

-sudo kubeadm init --config configfile.yaml


the config file
----------------------
apiVersion: kubeadm.k8s.io/v1alpha1
kind: MasterConfiguration
controllerManagerExtraArgs:
        pod-eviction-timeout: 10s
        node-monitor-grace-period: 10s
        node-monitor-period: 2s
-----------------------

when i execute the init command , i get the usual output to create a .kube folder in the $home directory and copy the config file and give more rights to it.

After that i tried to test my cluster with the command , sudo kubectl get nodes
But i got the error
`the connection to the server localhost:8080 was refused - did you specify the right host or port`
I got this error before but it was when i didn't copy the config file to the home folder .

I think i did everything right to set up my kubernetes master. Can someone pls help me in the right direction.

lu...@luxaslabs.com

unread,
Mar 1, 2018, 11:04:28 AM3/1/18
to Kubernetes developer/contributor discussion
Hi! I think your system is functioning okay, you just need to switch to the root user and point kubectl to the local cluster by executing this command:

export KUBECONFIG=/etc/kubernetes/admin.conf

This will tell kubectl to use the credentials in that file to talk to the cluster. Without that, kubectl doesn't have the right URL to connect to, nor the necessary credentials.

Hope this helps,
Lucas
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages