Kubernetes : Kubeadm インストール2025/01/22 |
マルチノード Kubernetes クラスターを構成します。 当例では以下のように 4 台のノードを使用して設定します。
前提条件として、各ノードの [Hostname], [MAC address], [Product_uuid] は一意である必要があります。 +----------------------+ +----------------------+ | [ 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] | Manager ノードを除く Kubernetes クラスターを構成する全ノードで、システム要件を満たすよう各設定を適用しておきます。 |
[root@dlp ~]#
cat > /etc/sysctl.d/99-k8s-cri.conf <<EOF net.bridge.bridge-nf-call-iptables=1 net.ipv4.ip_forward=1 net.bridge.bridge-nf-call-ip6tables=1 EOF [root@dlp ~]# sysctl --system
# firewalld は無効化
[root@dlp ~]#
systemctl disable --now firewalld
# Swap オフの設定 [root@dlp ~]# swapoff -a
[root@dlp ~]#
vi /etc/fstab # Swap 行はコメント化 #UUID=eb7c7852-4114-4c8d-8eef-b176c28b5501 none swap defaults 0 0 |
[2] | Manager ノードを除く Kubernetes クラスターを構成する全ノードで、コンテナーランタイム, Kubeadm, Kubelet をインストールします。 コンテナーランタイムには、当例では CRI-O を利用します。 |
[root@dlp ~]#
dnf -y install https://mirror.stream.centos.org/SIGs/10-stream/cloud/x86_64/okd-4.19/Packages/c/cri-o-1.32.4-1.el10s.x86_64.rpm
[root@dlp ~]#
[root@dlp ~]# systemctl enable --now crio
cat <<'EOF' > /etc/yum.repos.d/kubernetes.repo
[kubernetes] name=Kubernetes baseurl=https://pkgs.k8s.io/core:/stable:/v1.32/rpm/ enabled=0 gpgcheck=1 gpgkey=https://pkgs.k8s.io/core:/stable:/v1.32/rpm/repodata/repomd.xml.key EOF
[root@dlp ~]#
[root@dlp ~]# dnf --enablerepo=kubernetes -y install kubeadm kubelet cri-tools iproute-tc container-selinux systemctl enable kubelet
|
Sponsored Link |
|