网页
综合
更新时间 2026-11-14 02:14:26
Installing kubeadm | Kubernetes
自动蜘蛛
kubernetes.io
正文约 5389 字
This page shows how to install the kubeadm toolbox. For information on how to create a cluster with kubeadm once you have performed this installation process, see the Creating a cluster with kubeadm page.
This installation guide is for Kubernetes v1.37. If you want to use a different Kubernetes version, please refer to the following pages instead:
For more information, see Linux Kernel Requirements.
For more information, see Windows OS version compatibility.
A Kubernetes cluster created by kubeadm depends on software that use kernel features. This software includes, but is not limited to the container runtime, the kubelet, and a Container Network Interface plugin.
To help you avoid unexpected errors as a result of an unsupported kernel version, kubeadm runs the SystemVerification pre-flight check. This check fails if the kernel version is not supported.
You may choose to skip the check, if you know that your kernel provides the required features, even though kubeadm does not support its version.
It is very likely that hardware devices will have unique addresses, although some virtual machines may have identical values. Kubernetes uses these values to uniquely identify the nodes in the cluster. If these values are not unique to each node, the installation process may fail.
If you have more than one network adapter, and your Kubernetes components are not reachable on the default route, we recommend you add IP route(s) so Kubernetes cluster addresses go via the appropriate adapter.
These required ports need to be open in order for Kubernetes components to communicate with each other. You can use tools like netcat to check if a port is open. For example:
The pod network plugin you use may also require certain ports to be open. Since this differs with each pod network plugin, please see the documentation for the plugins about what port(s) those need.
The default behavior of a kubelet is to fail to start if swap memory is detected on a node. This means that swap should either be disabled or tolerated by kubelet.
To run containers in Pods, Kubernetes uses a container runtime.
By default, Kubernetes uses the Container Runtime Interface (CRI) to interface with your chosen container runtime.
If you don't specify a runtime, kubeadm automatically tries to detect an installed container runtime by scanning through a list of known endpoints.
If multiple or no container runtimes are detected kubeadm will throw an error and will request that you specify which one you want to use.
See container runtimes for more information.
The tables below include the known endpoints for supported operating systems:
You will install these packages on all of your machines:
kubeadm: the command to bootstrap the cluster.
kubelet: the component that runs on all of the machines in your cluster and does things like starting pods and containers.
kubectl: the command line util to talk to your cluster.
kubeadm will not install or manage kubelet or kubectl for you, so you will need to ensure they match the version of the Kubernetes control plane you want kubeadm to install for you. If you do not, there is a risk of a version skew occurring that can lead to unexpected, buggy behaviour. However, one minor version skew between the kubelet and the control plane is supported, but the kubelet version may never exceed the API server version. For example, the kubelet running 1.7.0 should be fully compatible with a 1.8.0 API server, but not vice versa.
For information about installing kubectl, see Install and set up kubectl.
For more information on version skews, see:
These instructions are for Kubernetes v1.37.
Update the apt package index and install packages needed to use the Kubernetes apt repository:
Download the public signing key for the Kubernetes package repositories. The same signing key is used for all repositories so you can disregard the version in the URL:
Add the appropriate Kubernetes apt repository. Please note that this repository have packages only for Kubernetes 1.37; for other Kubernetes minor versions, you need to change the Kubernetes minor version in the URL to match your desired minor version (you should also check that you are reading the documentation for the version of Kubernetes that you plan to install).
Update the apt package index, install kubelet, kubeadm and kubectl, and pin their version:
(Optional) Enable the kubelet service before running kubeadm:
Set SELinux to permissive mode:
These instructions are for Kubernetes 1.37.
Add the Kubernetes yum repository. The exclude parameter in the repository definition ensures that the packages related to Kubernetes are not upgraded upon running a normal dnf update as there's a special procedure that must be followed for upgrading Kubernetes. Please note that this repository has packages only for Kubernetes 1.37; for other Kubernetes minor versions, you need to change the Kubernetes minor version in the URL to match your desired minor version (you should also check that you are reading the documentation for the version of Kubernetes that you plan to install).
Install kubelet, kubeadm and kubectl:
For systems with DNF4 (Fedora < 41, RHEL/CentOS < 10)
For Fedora systems with DNF5:
For RHEL/CentOS 10 and later, to avoid pulling in iptables as a dependency:
(Optional) Enable the kubelet service before running kubeadm:
Install CNI plugins (required for most pod network):
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。