CentOS 7
Sponsored Link

Kubernetes : Add Nodes2018/04/15

 
Add new Nodes to existing Kubernetes Cluster.
This example is based on the environment like follows and add a new Node [node03.srv.world] to it.
-----------+---------------------------+--------------------------+------------
           |                           |                          |
       eth0|10.0.0.30              eth0|10.0.0.51             eth0|10.0.0.52
+----------+-----------+   +-----------+----------+   +-----------+----------+
|   [ dlp.srv.world ]  |   | [ node01.srv.world ] |   | [ node02.srv.world ] |
|      Master Node     |   |      Worker Node     |   |      Worker Node     |
+----------------------+   +----------------------+   +----------------------+

[1]
[2] Confirm join command on Master Node.
[root@dlp ~]#
kubeadm token create --print-join-command

kubeadm join 10.0.0.30:6443 --token awkx6k.8ovqfwiwm76r5lci --discovery-token-ca-cert-hash sha256:f2caf4fe6f26dc6cc8188b55ee3c825e5b8d9779a61bfd4eda4b152627e56184
[3] Run join command on a new Node.
[root@node03 ~]#
kubeadm join 10.0.0.30:6443 --token awkx6k.8ovqfwiwm76r5lci \
--discovery-token-ca-cert-hash sha256:f2caf4fe6f26dc6cc8188b55ee3c825e5b8d9779a61bfd4eda4b152627e56184

[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[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...
[  120.917765] ip6_tables: (C) 2000-2006 Netfilter Core Team

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.
[4] Verify settings on Master Node. That's OK if the status of new Node turns to [STATUS = Ready].
[root@dlp ~]#
kubectl get nodes

NAME               STATUS   ROLES                  AGE   VERSION
dlp.srv.world      Ready    control-plane,master   16h   v1.21.1
node01.srv.world   Ready    <none>                 16h   v1.21.1
node02.srv.world   Ready    <none>                 16h   v1.21.1
node03.srv.world   Ready    <none>                 81s   v1.21.1

[root@dlp ~]#
kubectl get pods -A -o wide | grep node03

kube-system            kube-flannel-ds-tv2zb                        1/1     Running   0          106s   10.0.0.53     node03.srv.world   <none>           <none>
kube-system            kube-proxy-sk97b                             1/1     Running   0          106s   10.0.0.53     node03.srv.world   <none>           <none>
Matched Content