Cluster Maintenance
OS Upgrades
If you only want to make the node unschedulable you can run:
kubectl cordon node01 # Make sure no pods are scheduled on node01Lab:
Kubernetes Releases

Cluster Upgrade Process
If kube-apiserver is at v1.10, then:

When shall we upgrade?

Upgrading Process

If we have cluster with master and worker nodes, and they are at v1.10, there are 2 major steps:
Upgrading worker nodes has 3 strategies:
Kubeadm - Upgrade
We can see components versions and additional useful information if we run:

Through this page in the k8s docs, you can upgrade the cluster step by step, starting with the control plane:
Lab (IMPORTANT):


After changing the Kubernetes package repository to v1.29, I ran:

So I had to:
For example:
And then upgrade kubelet and kubectl:
Then restart the kubelet daemon:
Now, our work is done, so we can exit the worker node and uncordon it from the control plane:
Backup & Restore Methods
Backup - Resource Configs
One way to backup all services is to query kube-apiserver or use the kubectl utility:
Backup - ETCD

We could also take a snapshot from the ETCD server, which is a feature built-in in the ETCD server:

Restore - ETCD
To restore an ETCD snapshot, we must first stop the kube-apiserver because kube-apiserver depends on ETCD:

Then we need to reload daemon and etcd services:
Finally, start the kube-apiserver:
Lab 1 (IMPORTANT):
First Restore the snapshot:
Next, update the /etc/kubernetes/manifests/etcd.yaml:
/etc/kubernetes/manifests/etcd.yaml:

Lab 2 (IMPORTANT):
Most important things to note in this lab:

On the student-node:
student-node:
Step 1
Step 2
Step 3
Step 4

Step 5
Working with ETCDCTL
This can be done as follows:
Example:
Slides
Last updated
