본문 바로가기

K8S

쿠버네티스(Kubernetes) 신규 노드 추가 방법

728x90

■ 쿠버네티스 신규 노드 추가 

#master node 진행
kubeadm token create --print-join-command
#결과값을 신규 node에 입력, sudo 필수

#신규 node 진행
sudo kubeadm join 192.168.56.10:6443 --token qgkuto.h6sl7hx68odr6v0t --discovery-token-ca-cert-hash sha256:d4f955570781216fdd6aa2cc53f82787e367cf8bb6e1cb16d08c879783998e5c
[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.

#master node 진행
#CNI 설치까지 약간의 시간이 소요되며, NotReady에서 잠시 후 Ready 상태 변경
kubectl get nodes
NAME        STATUS     ROLES           AGE     VERSION
k8smaster   Ready      control-plane   4h11m   v1.28.11
k8snode1    Ready      <none>          114m    v1.28.11
k8snode2    Ready      <none>          114m    v1.28.11
k8snode3    Ready      <none>          11s     v1.28.11

 

728x90