Kubernetes : Worker ノードの設定2025/11/07 |
|
マルチノード Kubernetes クラスターを構成します。 当例では以下のように 4 台のノードを使用して設定します。
+----------------------+ +----------------------+
| [ ctrl.srv.world ] | | [ dlp.srv.world ] |
| Manager Node | | Control Plane |
+-----------+----------+ +-----------+----------+
eth0|10.0.0.25 eth0|10.0.0.30
| |
------------+--------------------------+-----------
| |
eth0|10.0.0.51 eth0|10.0.0.52
+-----------+----------+ +-----------+----------+
| [ node01.srv.world ] | | [ node02.srv.world ] |
| Worker Node#1 | | Worker Node#2 |
+----------------------+ +----------------------+
|
| [1] | |
| [2] | Worker ノードとするホストから、Control Plane ノードで初期セットアップしたクラスターに Join します。 Join する際のコマンドは、初期セットアップのコマンド実行時の最後に表示された [kubeadm join ~] コマンドをそのままコピーして実行するのみです。 |
|
node01:~ # kubeadm join 10.0.0.25:6443 --token abcdef.0123456789abcdef \ --discovery-token-ca-cert-hash sha256:fbbf173149bc275b687e3a772b81d2e127cbbcd49a5546902e1a99f7e37d4729 [preflight] Running pre-flight checks [preflight] Reading configuration from the "kubeadm-config" ConfigMap in namespace "kube-system"... [preflight] Use 'kubeadm init phase upload-config kubeadm --config your-config-file' to re-upload it. [kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/instance-config.yaml" [patches] Applied patch of type "application/strategic-merge-patch+json" to target "kubeletconfiguration" [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-check] Waiting for a healthy kubelet at http://127.0.0.1:10248/healthz. This can take up to 4m0s [kubelet-check] The kubelet is healthy after 502.546992ms [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] | Manager ノード または クラスター管理ユーザーを設定したクライアントホストで、ノード情報を確認しておきます。全て STATUS = Ready であれば OK です。 |
|
ctrl:~ # kubectl get nodes NAME STATUS ROLES AGE VERSION dlp.srv.world Ready control-plane 13m v1.34.1 node01.srv.world Ready <none> 4m11s v1.34.1 node02.srv.world Ready <none> 24s v1.34.1 |
| Sponsored Link |
|
|