Unable to set Kubernete cluster

7/18/2017

I'm following steps mentioned here to configure kubernete cluster.But when I'm executing kubectl get nodes to check the status of my newly created cluster, that time I'm getting error message The connection to the server localhost:8080 was refused - did you specify the right host or port? In this link it is mentioned for Ubuntu 14.04 LTS 64bit server, but I'm using Ubuntu 16,04 64 Bit. Can you expert please help me to solve this issue?

-- Python Learner
kubernetes

3 Answers

7/18/2017

It looks like your client configuration thinks the server runs on localhost:8080 which is probably not the case. Can you look at the ~/.kube/config file to see what is configured there? Also try running kubectl --server=<SERVER_IP>:<SERVER_PORT> get nodes and see if this helps.

-- srfrnk
Source: StackOverflow

2/16/2018

You need to run the following commands (as a regular user) after you have initialized your cluster:

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

Follow this issue on GitHub if you still encounter it.

-- Sibtain
Source: StackOverflow

7/18/2017

The document your following is more then year old, its not update to date steps.

I would recommend creating cluster using the kubeadm with version v.1.7.0

https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/

use this configure master

kubeadm init --pod-network-cidr=10.244.0.0/16 --kubernetes-version v1.7.0
-- sfgroups
Source: StackOverflow