実施すること
生成
[tsubame@control-plane01 ~]$ kubeadm token create --print-join-command
kubeadm join 192.168.64.4:6443 --token nyannyan --discovery-token-ca-cert-hash sha256:0d0d0d0d0d0d0d0d0d0d0d0d0d0d0
[tsubame@control-plane01 ~]$
kubeadm initにて出力されたコマンドを前ワーカーノードで実施
[tsubame@worker01 ~]$ sudo kubeadm join 192.168.64.4:6443 --token nyannyan --discovery-token-ca-cert-hash sha256:0d0d0d0d0d0d0d0d0d0d0d0d0d0d0
[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.
[tsubame@worker01 ~]$
コントロールプレーンで確認
- 対象のワーカーノードが存在すること
- STATUSがReadyであること
[tsubame@control-plane01 ~]$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
control-plane01 Ready control-plane 31h v1.27.4
worker01 Ready <none> 87s v1.27.4
worker02 Ready <none> 95s v1.27.4
worker03 Ready <none> 81s v1.27.4
[tsubame@control-plane01 ~]$
コピペ用
sudo kubeadm join 192.168.64.4:6443 --token foobarbaz\
--discovery-token-ca-cert-hash sha256:nyanwanpaooooon