Kubernetes : Worker ノードの設定2023/07/28 |
Kubeadm をインストールして、マルチノード Kubernetes クラスターを構成します。 当例では以下のように 3 台のノードを使用して設定します。 -----------+---------------------------+--------------------------+------------ | | | 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] | Worker ノードとするホストから、Control Plane ノードで初期セットアップしたクラスターに Join します。 Join する際のコマンドは、初期セットアップのコマンド実行時の最後に表示された [kubeadm join ~] コマンドをそのままコピーして実行するのみです。 |
root@snode01:~# kubeadm join 10.0.0.25:6443 --token q1xuoi.v6meo9irmuv9g0y1 \ --discovery-token-ca-cert-hash sha256:1b96782423120e014e212197d34c56b029af1a8db85bf40a6602e19881bc7db1 [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. # This node has joined the cluster と表示されれば OK |
[3] | Control Plane ノードでノード情報を確認しておきます。全て STATUS = Ready であれば OK です。 |
root@ctrl:~# kubectl get nodes NAME STATUS ROLES AGE VERSION ctrl.srv.world Ready control-plane 4h54m v1.26.6 snode01.srv.world Ready <none> 2m12s v1.26.6 snode02.srv.world Ready <none> 83s v1.26.6 |
Sponsored Link |