This is an old revision of the document!


Joining to a Kubernetes Cluster is done from the joining machine and verified on the Control Panel (e.g. master) machine. The joining process itself is pretty straight forward and require only one command. The command which was given to us when we initialized the cluster.

So let's get going.

Be sure that you installed the necessary packages from the introduction section. Once this is done we can add the node to the cluster as follow:

Add node

root@node-1:~# kubeadm join 192.168.50.10:6443 --token k7cnjt.c0vkn3i6sc9qp2it --discovery-token-ca-cert-hash sha256:8c7874be67b9670c52a729b7a26bdefb4b55f5a49402624c0d262c0253732228
W0421 10:28:13.551137   21280 join.go:346] [preflight] WARNING: JoinControlPane.controlPlane settings will be ignored when control-plane flag is not set.
[preflight] Running pre-flight checks
        [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
[kubelet-start] Downloading configuration for the kubelet from the "kubelet-config-1.18" ConfigMap in the kube-system namespace
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Starting the kubelet
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...

This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.

Run 'kubectl get nodes' on the control-plane to see this node join the cluster.

root@node-1:~#

As with the master node, it might take sometime until you see the node as Ready and all components running from the Control Panel Machine:

Check the newly added Node

ubuntu@k8s-master:~/.kube$ kubectl get nodes
NAME         STATUS   ROLES    AGE   VERSION
k8s-master   Ready    master   67m   v1.18.2
node-1       Ready    <none>   82s   v1.18.2
ubuntu@k8s-master:~/.kube$
ubuntu@k8s-master:~/.kube$ kubectl get pods --all-namespaces
NAMESPACE     NAME                                       READY   STATUS    RESTARTS   AGE
kube-system   calico-kube-controllers-77c5fc8d7f-88lsl   1/1     Running   0          65m
kube-system   calico-node-bqw8q                          1/1     Running   0          65m
kube-system   calico-node-wwfc5                          0/1     Running   0          75s
kube-system   coredns-66bff467f8-rgh8d                   1/1     Running   0          67m
kube-system   coredns-66bff467f8-tql72                   1/1     Running   0          67m
kube-system   etcd-k8s-master                            1/1     Running   0          67m
kube-system   kube-apiserver-k8s-master                  1/1     Running   0          67m
kube-system   kube-controller-manager-k8s-master         1/1     Running   2          67m
kube-system   kube-proxy-hnmxb                           1/1     Running   0          75s
kube-system   kube-proxy-jkmql                           1/1     Running   0          67m
kube-system   kube-scheduler-k8s-master                  1/1     Running   2          67m

Please execute that step on all nodes. In the end you should have something like this:

Check the newly added Node

ubuntu@k8s-master:~/.kube$ kubectl get nodes
NAME         STATUS   ROLES    AGE   VERSION
k8s-master   Ready    master   77m   v1.18.2
node-1       Ready    <none>   11m   v1.18.2
node-2       Ready    <none>   88s   v1.18.2
ubuntu@k8s-master:~/.kube$ kubectl get pods --all-namespaces
NAMESPACE     NAME                                       READY   STATUS    RESTARTS   AGE
kube-system   calico-kube-controllers-77c5fc8d7f-88lsl   1/1     Running   0          75m
kube-system   calico-node-bqw8q                          1/1     Running   0          75m
kube-system   calico-node-fl6ft                          1/1     Running   0          84s
kube-system   calico-node-wwfc5                          1/1     Running   0          11m
kube-system   coredns-66bff467f8-rgh8d                   1/1     Running   0          77m
kube-system   coredns-66bff467f8-tql72                   1/1     Running   0          77m
kube-system   etcd-k8s-master                            1/1     Running   0          77m
kube-system   kube-apiserver-k8s-master                  1/1     Running   0          77m
kube-system   kube-controller-manager-k8s-master         1/1     Running   2          77m
kube-system   kube-proxy-hnmxb                           1/1     Running   0          11m
kube-system   kube-proxy-jkmql                           1/1     Running   0          77m
kube-system   kube-proxy-s4nrh                           1/1     Running   0          84s
kube-system   kube-scheduler-k8s-master                  1/1     Running   2          77m
  • docker_advanced_k8s_join.1587465604.txt.gz
  • Last modified: 2020/04/21 10:40
  • by andonovj