
Kubernetes Course 04 — Inside kubeadm: certificates, static pods, and the join
In chapter 02 we ran kubeadm init and saw the cluster come up. It worked — but what exactly did that command do?
That's the difference between "having a cluster" and "operating a cluster". When something breaks at 3 a.m., you need to know where the certificates are, which pods are static, how to renew a token, and what happens during an upgrade.
Course seal: tested on Kubernetes 1.35 and Ubuntu 24.04. Fictional IPs (
192.168.56.x).
What kubeadm creates
When running kubeadm init, it generates:
| Path | Content |
|---|---|
/etc/kubernetes/manifests/ |
control plane static pods |
/etc/kubernetes/pki/ |
CA, apiserver, etcd, service account certificates |
/etc/kubernetes/*.conf |
kubeconfigs (admin, controller-manager, scheduler) |
/var/lib/kubelet/ |
kubelet configuration and data |
/etc/cni/net.d/ |
CNI configuration (later) |
The control plane is not a traditional "systemd service". It runs as static pods, which the kubelet starts from the manifests in /etc/kubernetes/manifests. If you edit the apiserver YAML there, the kubelet recreates the pod automatically.
ls -l /etc/kubernetes/manifests/
sudo crictl pods | head
kubectl -n kube-system get pods -o wide
You will see kube-apiserver, kube-controller-manager, kube-scheduler and etcd as pods with names ending in the node's hostname.
Certificates: what expires and when
The cluster lives on TLS. kubeadm creates a local PKI:
sudo ls -l /etc/kubernetes/pki/
sudo kubeadm certs check-expiration
The output shows the validity of each certificate. By default, many expire in 1 year. If the apiserver stops responding with a TLS error, check this first.
Manual renewal:
sudo kubeadm certs renew all
sudo systemctl restart kubelet
In long-lived clusters, automate renewal or make it part of the maintenance runbook. An expired certificate is not a "Kubernetes bug"; it's an operations issue.
Join tokens
kubeadm init prints a join command with token and hash. The token expires (24h by default). To generate another:
sudo kubeadm token list
sudo kubeadm token create --print-join-command
The hash is the sha256 of the public CA. If the token expired, the command above solves it. If the CA changed (cluster recreated), the old hash is not valid.
To add a control plane (HA), the command is different:
sudo kubeadm join 192.168.56.10:6443 \
--token \
--discovery-token-ca-cert-hash sha256: \
--control-plane --certificate-key
The --certificate-key is generated with kubeadm init phase upload-certs --upload-certs. We will use this in chapter 05.
The kubeconfig
The ~/.kube/config file points to the apiserver and loads the client certificate. If you lose access:
sudo cp /etc/kubernetes/admin.conf ~/.kube/config
sudo chown $(id -u):$(id -g) ~/.kube/config
kubectl get nodes
Never copy this file to insecure locations: it gives administrative access to the cluster.
Upgrading the control plane
Upgrading is a maintenance operation, not just any apt upgrade.
sudo kubeadm upgrade plan
sudo apt-mark unhold kubeadm
sudo apt install -y kubeadm=1.35.x-1.1
sudo apt-mark hold kubeadm
sudo kubeadm upgrade apply v1.35.x
Then, update kubelet and kubectl on the node and restart kubelet. In HA, one master at a time; never all together.
On workers, the flow is:
kubectl drain --ignore-daemonsets --delete-emptydir-data
sudo apt-mark unhold kubeadm kubelet
sudo apt install -y kubeadm=1.35.x-1.1 kubelet=1.35.x-1.1 kubectl=1.35.x-1.1
sudo kubeadm upgrade node
sudo systemctl restart kubelet
kubectl uncordon
The rule is: one node at a time, validating kubectl get nodes and the workloads before proceeding.
Reset: when to redo
If the lab breaks beyond repair:
sudo kubeadm reset -f
sudo rm -rf /etc/cni/net.d /var/lib/cni /var/lib/kubelet
sudo systemctl restart containerd kubelet
In HA, this is more delicate: remove the node from the cluster, clean etcd, and recreate. Take a backup first.
Chapter lab
- List the static pods:
kubectl -n kube-system get pods -o wide
sudo crictl pods | grep -E 'kube-apiserver|etcd|scheduler'
- Check certificate validity:
sudo kubeadm certs check-expiration
- Generate a new join token:
sudo kubeadm token create --print-join-command
- View the kubeconfig and endpoint:
kubectl config view --minify
kubectl cluster-info
- (Optional) On a disposable cluster, test
kubeadm upgrade plan.
Common errors
| Symptom | Probable cause |
|---|---|
x509: certificate has expired |
expired certificate; kubeadm certs renew |
bootstrap token expired |
join token expired; generate another |
etcdserver: request timed out |
slow disk or lost quorum |
| apiserver doesn't start after editing manifest | invalid YAML in /etc/kubernetes/manifests |
| upgrade fails midway | inconsistent kubelet/kubeadm version |
| node doesn't come back after upgrade | kubelet stopped or CNI without config |
Checklist
- [ ] I know where the control plane static pods are located.
- [ ] I know how to check certificate validity.
- [ ] I know how to generate a new join token.
- [ ] I understood the role of kubeconfig.
- [ ] I know the upgrade flow for a node.
- [ ] I know when (and how) to reset.
Glossary
- PKI: key and certificate infrastructure.
- static pod: pod managed directly by the kubelet via manifest.
- bootstrap token: temporary token for joining.
- certificate-key: key used to distribute certificates to new control planes.
- drain/uncordon: evacuate and release a node for maintenance.
Next
Now that you understand what kubeadm created, we'll put the control plane in HA: 3 masters, stable endpoint, and quorum etcd.
Keep reading
Read also
KubernetesKubernetes Course 05 — HA: 3 Masters, VIP, and etcd
A single master is a single point of failure. See how to set up a highly available control plane with a stable endpoint, 3 masters, and etcd with quorum.
5 min de leitura
KubernetesKubernetes Course 02 — Setting Up the Lab: 6 VMs and a Cluster That Fits in Your Pocket
Proxmox, Ubuntu 24.04, containerd and kubeadm: a step-by-step to go from zero to a working Kubernetes cluster on your network.
5 min de leitura
KubernetesKubernetes Course 03 — The First Pod and Deployment: YAML, kubectl, and What Actually Happens
From kubectl run to Deployment with Service: understand the path the YAML takes and how to diagnose when the pod doesn't come up.
5 min de leitura
Comments
No comments yet
Be the first to share your thoughts on this article.
Leave a comment