Kubeadm is a command-line tool that streamlines the process of bootstrapping a minimum viable Kubernetes cluster adhering to best practices. It offers a simplified and automated approach for setting up a Kubernetes cluster that is conformant and ready for testing or running applications.
1. **Initializing the Control Plane:**
```bash kubeadm init –pod-network-cidr=10.244.0.0/16 ```
This command initializes the Kubernetes control plane on the current node, setting up essential components like the API server, controller manager, and scheduler. It also specifies the pod network CIDR range, which is required for pod-to-pod communication within the cluster.
2. **Joining a Worker Node to the Cluster:**
```bash kubeadm join <control-plane-host>:<control-plane-port> –token <token> \
--discovery-token-ca-cert-hash sha256:```
This command joins a worker node to the cluster, connecting it to the control plane and making it available for running pods. The token, port, and certificate hash are provided during the `kubeadm init` process.
3. **Upgrading a Cluster:**
```bash kubeadm upgrade plan kubeadm upgrade apply v1.25.0 ```
These commands check for available upgrades and then upgrade the cluster to Kubernetes version 1.25.0.