kubeadm(1)
Bootstrap a Kubernetes cluster with kubeadm, a tool for initializing and managing cluster control planes and worker nodes.
Synopsis
kubeadm [command] [flags]Description
kubeadm is a command-line tool that handles the tedious setup work required to get a Kubernetes cluster running. It performs the essential steps to bootstrap a cluster: installing system packages, configuring container runtimes, initializing the control plane, and joining worker nodes to the cluster.
kubeadm works by wrapping low-level steps into higher-level commands that abstract away the complexity of certificate generation, kubeconfig creation, and component deployment. It is designed to be simple, portable, and extensible across different environments.
Common options
| Flag | What it does |
|---|---|
--config=string | Path to a kubeadm configuration file; configuration specified here overrides command-line flags |
--kubernetes-version=string | The Kubernetes version for the control plane; defaults to the version of kubeadm binary |
--apiserver-advertise-address=string | The IP address the API server will advertise (must be reachable by worker nodes) |
--pod-network-cidr=string | Specify the range of IP addresses for the pod network; required for some network plugins |
--service-cidr=string | Use alternative range of IP address for service VIPs; default is 10.96.0.0/12 |
--token=string | The token to use for establishing bidirectional trust between nodes and the control plane |
--token-ttl=duration | The duration before the token is automatically deleted; 0 means it never expires |
--discovery-token-ca-cert-hash=string | For kubeadm join: hash of the cluster's root CA certificate |
--control-plane | Mark this node as a control plane component during join operation |
--dry-run | Run through the motions, collecting errors, without actually modifying the system |
-v, --verbose=int | Set the verbosity level; higher numbers produce more detailed output |
Examples
Initialize a control plane on the current machine with specific advertise IP and pod network CIDR for Flannel CNI
kubeadm init --apiserver-advertise-address=192.168.1.100 --pod-network-cidr=10.244.0.0/16Generate a new bootstrap token and print the complete join command with discovery token CA cert hash
kubeadm token create --print-join-commandJoin a worker node to an existing cluster using the control plane IP, token, and CA cert hash
kubeadm join 192.168.1.100:6443 --token abc123.def456token --discovery-token-ca-cert-hash sha256:abc123def456Check which versions you can upgrade to and what important upgrades are available
kubeadm upgrade planUpgrade the control plane components on this node to v1.28.0
kubeadm upgrade apply v1.28.0Perform a dry run of cluster initialization using a config file to validate without making changes
kubeadm init --config=/etc/kubernetes/kubeadm-config.yaml --dry-runUndo changes made to this host by kubeadm init or kubeadm join; removes all Kubernetes files and certificates
kubeadm reset --forceCheck the expiration dates of all certificates in the cluster
kubeadm certs check-expiration