Kubernetes : Kubeadm स्थापित करें2025/11/21 |
|
मल्टी नोड्स Kubernetes क्लस्टर को कॉन्फ़िगर करने के लिए Kubeadm इंस्टॉल करें। यह उदाहरण निम्न प्रकार से पर्यावरण पर आधारित है।
सिस्टम आवश्यकताओं के लिए, प्रत्येक नोड में अद्वितीय होस्टनाम, मैक पता, Product_uuid होता है। इसके अलावा, यह पर्यावरण के आधार पर Firewalld अक्षम है।
-----------+---------------------------+--------------------------+------------
| | |
eth0|10.0.0.30 eth0|10.0.0.51 eth0|10.0.0.52
+----------+-----------+ +-----------+----------+ +-----------+----------+
| [ dlp.srv.world ] | | [ node01.srv.world ] | | [ node02.srv.world ] |
| Control Plane | | Worker Node | | Worker Node |
+----------------------+ +----------------------+ +----------------------+
|
| [1] | सभी नोड्स पर, सिस्टम आवश्यकताओं के लिए सेटिंग्स बदलें। |
|
[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
# स्वैप ऑफ सेटिंग सेट करें [root@dlp ~]# swapoff -a [root@dlp ~]# touch /etc/systemd/zram-generator.conf
# अक्षम करें [firewalld] [root@dlp ~]# systemctl disable --now firewalld
|
| [2] | सभी नोड्स पर, आवश्यक पैकेज स्थापित करें। यह उदाहरण कंटेनर रनटाइम के लिए CRI-O का उपयोग करना दिखाता है। |
|
[root@dlp ~]#
dnf -y install cri-o1.34 crun
[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.34/rpm/ enabled=0 gpgcheck=1 gpgkey=https://pkgs.k8s.io/core:/stable:/v1.34/rpm/repodata/repomd.xml.key EOF
[root@dlp ~]#
[root@dlp ~]# dnf --enablerepo=kubernetes -y install kubeadm kubelet kubectl cri-tools iproute-tc container-selinux systemctl enable kubelet
|
| [3] | सभी नोड्स पर, यदि SELinux सक्षम है, तो नीति बदलें। |
|
[root@dlp ~]#
vi k8s.te # नया निर्माण
module k8s 1.0;
require {
type cgroup_t;
type iptables_t;
class dir ioctl;
}
#============= iptables_t ==============
allow iptables_t cgroup_t:dir ioctl;
checkmodule -m -M -o k8s.mod k8s.te [root@dlp ~]# semodule_package --outfile k8s.pp --module k8s.mod [root@dlp ~]# semodule -i k8s.pp |
| Sponsored Link |
|
|