Kubernetes : Worker ノードの設定2015/12/13 |
|
Kubeadm をインストールして、マルチノード Kubernetes クラスターを構成します。
当例では以下のように 3台のホストを使用して設定します。
前提条件として、それぞれのノードの Hostname, MAC address, Product_uuid は一意である必要があります。
MAC address と Product_uuid は、通常の物理マシンや一般的な方法で作成した仮想マシンであれば、すでに一意となっているはずです。 Product_uuid は [dmidecode -s system-uuid] コマンドで確認できます。
-----------+---------------------------+--------------------------+------------
| | |
eth0|10.0.0.30 eth0|10.0.0.51 eth0|10.0.0.52
+----------+-----------+ +-----------+----------+ +-----------+----------+
| [ dlp.srv.world ] | | [ node01.srv.world ] | | [ node02.srv.world ] |
| Master Node | | Worker Node | | Worker Node |
+----------------------+ +----------------------+ +----------------------+
|
|
Worker ノードの設定を実施します。
|
|
| [1] | |
| [2] | Master ノードで初期セットアップしたクラスターに Join します。 Join する際のコマンドは、初期セットアップのコマンド実行時の最後に表示された [kubeadm join ~] コマンドをそのままコピーして実行するのみです。 |
|
[root@node01 ~]# kubeadm join 10.0.0.30:6443 --token 31eeyr.uxvpz3b0teajkaki \ --discovery-token-ca-cert-hash sha256:f2caf4fe6f26dc6cc8188b55ee3c825e5b8d9779a61bfd4eda4b152627e56184
[preflight] Running pre-flight checks
[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
[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] | Master ノードでノード情報を確認しておきます。全て STATUS = Ready であれば OK です。 |
|
[root@dlp ~]# kubectl get nodes NAME STATUS ROLES AGE VERSION dlp.srv.world Ready control-plane,master 6m55s v1.21.1 node01.srv.world Ready <none> 111s v1.21.1 node02.srv.world Ready <none> 45s v1.21.1 |
| Sponsored Link |
|
|