본문 바로가기

TEAM STUDY/대세는 쿠버네티스 [초급~중급]

▶ kubernetes - k8s-master , k8s-node1, k8s-node2 Join !!!

728x90
반응형

k8s-master 에서 key 생성

[root@k8s-master ~]# cat ~/join.sh
kubeadm join 192.168.56.30:6443 --token ck42o0.xn7jry44rt6f198l --discovery-token-ca-cert-hash sha256:aaa4b9734d3ff758d7ca399041bd2569b6a90d562589bb6367746c39776ba8f2

 

k8s-node1 에서 k8s-master 으로 조인

[root@k8s-node1 ~]# kubeadm join 192.168.56.30:6443 --token ck42o0.xn7jry44rt6f198l --discovery-token-ca-cert-hash sha256:aaa4b9734d3ff758d7ca399041bd2569b6a90d562589bb6367746c39776ba8f2
[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.

 

k8s-node2 에서 k8s-master 으로 조인

[root@k8s-node2 ~]# kubeadm join 192.168.56.30:6443 --token ck42o0.xn7jry44rt6f198l --discovery-token-ca-cert-hash sha256:aaa4b9734d3ff758d7ca399041bd2569b6a90d562589bb6367746c39776ba8f2
[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.

 

 

join 완료

[root@k8s-master ~]# kubectl get nodes
NAME         STATUS     ROLES                  AGE   VERSION
k8s-master   Ready      control-plane,master   17m   v1.22.0
k8s-node1    NotReady   <none>                 78s   v1.22.0
k8s-node2    Ready      <none>                 74s   v1.22.0

 

728x90
반응형