Kubernetes : नोड्स जोड़ें2023/09/04 |
मौजूदा Kubernetes क्लस्टर में नए नोड्स जोड़ें।
यह उदाहरण निम्न प्रकार के वातावरण पर आधारित है और इसमें एक नया नोड [snode03.srv.world] जोड़ें।
-----------+---------------------------+--------------------------+------------ | | | eth0|10.0.0.25 eth0|10.0.0.71 eth0|10.0.0.72 +----------+-----------+ +-----------+-----------+ +-----------+-----------+ | [ ctrl.srv.world ] | | [snode01.srv.world] | | [snode02.srv.world] | | Control Plane | | Worker Node | | Worker Node | +----------------------+ +-----------------------+ +-----------------------+ |
[1] | |
[2] | Control Plane नोड पर जॉइन कमांड की पुष्टि करें। |
root@ctrl:~# kubeadm token create --print-join-command kubeadm join 10.0.0.25:6443 --token qwgblh.9kxwskja5sker8nt --discovery-token-ca-cert-hash sha256:6166ac8d73379081c2ca2b9625480b3f2cc992f571659e776b68d676e84cc3d9 |
[3] | नए नोड पर जॉइन कमांड चलाएँ। |
root@snode03:~# kubeadm join 10.0.0.25:6443 --token qwgblh.9kxwskja5sker8nt \ --discovery-token-ca-cert-hash sha256:6166ac8d73379081c2ca2b9625480b3f2cc992f571659e776b68d676e84cc3d9 [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... 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] | Control Plane नोड पर सेटिंग्स सत्यापित करें। यदि नए नोड की स्थिति [STATUS = Ready] में बदल जाती है तो यह ठीक है। |
root@ctrl:~# kubectl get nodes NAME STATUS ROLES AGE VERSION ctrl.srv.world Ready control-plane 25h v1.25.3 snode01.srv.world Ready <none> 25h v1.25.3 snode02.srv.world Ready <none> 25h v1.25.3 snode03.srv.world Ready <none> 85s v1.25.3root@ctrl:~# kubectl get pods -A -o wide | grep snode03 kube-system calico-node-762x8 1/1 Running 0 117s 10.0.0.73 snode03.srv.world <none> <none> kube-system kube-proxy-lm25n 1/1 Running 0 117s 10.0.0.73 snode03.srv.world <none> <none> |
Sponsored Link |
|