Kubernetes : Add Nodes2020/08/19 |
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] |
On a new Node, Configure common settings to join in Cluster, refer to here.
|
[2] | Confirm join command on Master Node. |
root@dlp:~# kubeadm token create --print-join-command kubeadm join 10.0.0.30:6443 --token mf7wmw.i6lzmcweb1k5fhan --discovery-token-ca-cert-hash sha256:a2fe3ff26b45163db734448366299b00ab111754ac5cd8f0b941ea4a0ad07e11 |
[3] | Run join command on a new Node. |
root@node03:~# kubeadm join 10.0.0.30:6443 --token mf7wmw.i6lzmcweb1k5fhan \ --discovery-token-ca-cert-hash sha256:a2fe3ff26b45163db734448366299b00ab111754ac5cd8f0b941ea4a0ad07e11 W0819 13:43:45.078343 5986 join.go:346] [preflight] WARNING: JoinControlPane.controlPlane settings will be ignored when control-plane flag is not set. [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 -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. |
[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 master 135m v1.18.8 node01.srv.world Ready <none> 132m v1.18.8 node02.srv.world Ready <none> 131m v1.18.8 node03.srv.world Ready <none> 3m1s v1.18.8root@dlp:~# kubectl get pods -A -o wide | grep node03 NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES kube-system kube-flannel-ds-amd64-558tf 1/1 Running 0 16m 10.0.0.53 node03.srv.world <none> <none> kube-system kube-proxy-h79c2 1/1 Running 0 16m 10.0.0.53 node03.srv.world <none> <none> |
Sponsored Link |
|