Kubernetes Best Practices on Clear Linux OS
Use swupd to update clusters
This tutorial shows you how to manage your Kubernetes cluster while using swupd to update Clear Linux* OS.
In our tutorial Run Kubernetes*, we explain how to set up a Kubernetes cluster on Clear Linux OS using kubeadm. Kubeadm documentation often builds on the assumption that the distribution uses a traditional package manager (e.g., RPM/DEB).
In contrast, Clear Linux OS uses swupd to update the OS, which in this case updates all of the kubernetes node and client binaries simultaneously, as part of the cloud-native-basic bundle (e.g., kubectl, kubeadm, kubelet). Running sudo swupd update requires special care to ensure the OS incorporates the latest Kubernetes upgrades.
This document describes best practices to manage cluster upgrades with kubeadm on a Clear Linux OS-based cluster.
Prerequisites
Assure that you:
- Completed Run Kubernetes*
- Installed the bundle cloud-native-basic
Note
Other Linux* distros shown in Kubernetes upgrade documentation reflect apt-get update, apt-mark hold kubeadm, and similar commands; however, such commands are not valid on Clear Linux OS.
Update the control plane
Read kubernetes documentation before you begin.
On your master node, run the command:
sudo swupd update
Note
If the minor version of Kubernetes changes, Clear Linux OS shows a message-of-the-day, or motd. When the motd appears, you must postpone a kubelet restart on master and nodes until the control plane is properly updated. swupd update does not restart services automatically unless explicitly configured to do so.
Now follow these instructions in kubernetes documentation.
Update worker nodes
On each worker node, run the command:
sudo swupd update
Now follow these instructions in kubernetes documentation: