kubernetes cluster installation: connection refused when joining nodes to master

4/5/2018

I'm trying to install a kubernetes cluster, one server and two slaves running Ubuntu 16.04, following the instructions in this article

when arriving at the steps to join slave nodes to the master, I perform (as suggested by the kubeadm init output step) the following command:

sudo kubeadm join <master ip>:6443 --token 6wz<...etc...>goj --discovery-token-ca-cert-hash sha256:ac3<...etc...>54a

Here, I get an error

.
.
.
[discovery] Trying to connect to API Server "<master ip>:6443"
[discovery] Created cluster-info discovery client, requesting info from "https://<master ip>:6443"
[discovery] Failed to request cluster info, will try again: [Get https://<master ip>:6443/api/v1/namespaces/kube-public/configmaps/cluster-info: 
    dial tcp <master ip>:6443: getsockopt: connection refused]
.
.
.

My questions are:

  • how can I check that the master is correctly running? (kubeadm init printed a message Your Kubernetes master has initialized successfully!, but I don't know how to actually check this is true)
  • what could cause the connection refused error?
  • could the error depend on the docker version? (during kubeadm init I got a wanring docker version is greater than the most recently validated version. Docker version: 17.05.0-ce. Max validated version: 17.03, don't know if this could be related to my problem)
-- chrx
docker
kubernetes

1 Answer

4/5/2018

This can happen if you change your TLS certificates on your apiserver. You will have invalid tokens on your service account and would have to delete and make one again. Do this:

 kubectl delete serviceaccount default
 kubectl delete serviceaccount --namespace=kube-system default

You can verify if your master node is successfully hosted by. This will let you know your master-url-dns.

kubectl cluster-info
-- papaya
Source: StackOverflow