Skip to content

Kubernetes pre-installation system prerequisites

Before initializing a cluster with kubeadm, the underlying operating system of all nodes (master and workers) must be configured to meet specific requirements. These prerequisites ensure that the container runtime and Kubernetes components can function correctly.

Hostname configuration

Each node within the cluster must possess a unique hostname.^[400-devops__06-Kubernetes__k8s-learning__00.install__01.使用部署工具安装_Kubernetes.md] Duplicates will prevent nodes from joining or functioning correctly.

SELinux settings

SELinux (Security-Enhanced Linux) must be configured to permissive mode or be disabled.^[400-devops__06-Kubernetes__k8s-learning__00.install__01.使用部署工具安装_Kubernetes.md] This setting is required to allow the necessary container and networking interactions without policy interference.

Swap memory

Swap memory must be disabled.^[400-devops__06-Kubernetes__k8s-learning__00.install__01.使用部署工具安装_Kubernetes.md] The kubelet service typically fails to start if swap is active. This action can be performed temporarily using swapoff -a and made permanent by commenting out swap entries in /etc/fstab.^[400-devops__06-Kubernetes__k8s-learning__00.install__01.使用部署工具安装_Kubernetes.md]

Bridge networking and IP forwarding

The Linux kernel must be configured to allow iptables to inspect bridged traffic (e.g., traffic passing through br_netfilter).^[400-devops__06-Kubernetes__k8s-learning__00.install__01.使用部署工具安装_Kubernetes.md] This ensures that packets traversing virtual networks are properly processed by Kubernetes networking rules. This is achieved by loading the br_netfilter module and setting net.bridge.bridge-nf-call-iptables and net.bridge.bridge-nf-call-ip6tables to 1.^[400-devops__06-Kubernetes__k8s-learning__00.install__01.使用部署工具安装_Kubernetes.md]

Container runtime cgroup driver

The container runtime (e.g., Docker) must be configured to use the systemd cgroup driver.^[400-devops__06-Kubernetes__00.install__01.使用部署工具安装_Kubernetes.md] Kubernetes defaults its cgroup driver to systemd; if the runtime uses a different driver (such as cgroupfs), the kubelet will fail to run health checks.^[400-devops__06-Kubernetes__k8s-learning__00.install__01.使用部署工具安装_Kubernetes.md]

Sources

  • 400-devops__06-Kubernetes__k8s-learning__00.install__01.使用部署工具安装_Kubernetes.md