Kubernetes Upgrades Are A Pain: How Devtron Can Help

Kubernetes Upgrades are typically never a fun process. With cloud providers, they’re definitely easier than when just running Kubernetes clusters on-prem. However, it still requires everything from backups to scaling to ensuring that applications perform as expected during the upgrade process.

In this blog post, you’ll learn about what Kubernetes upgrades consist of, how to perform an upgrade, and what Devtron can do to help on the Kubernetes Manifest front.

What Do Kubernetes Upgrades Consist Of?

A Kubernetes cluster upgrade is a process that involves updating the Kubernetes control plane and node components to a newer version. This includes upgrading the API server, controller manager, scheduler (control plane components), kubelet, and kubectl (node components) to the latest stable release. The upgrade process is crucial to ensure that your cluster runs the most recent and secure version of Kubernetes, which often includes important bug fixes, security patches, and new features.

The way you upgrade a cluster depends on how you initially deployed it and any subsequent changes. At a high level, the steps you perform are: Upgrade the control plane, upgrade the nodes in your cluster, and upgrade clients. It’s important to note that upgrading a cluster should be done carefully and systematically, as it can potentially disrupt running applications and services.

When you’re upgrading cloud providers, the process is pretty similar but can vary.

For example, to upgrade a cluster, AWS updates the version of the control plane and nodes are running. Clusters are upgraded to either a newer minor version (for example, 1.27 to 1.28) or a newer patch version (for example, 1.27.4-eks.5 to 1.27.13-eks.17). It’s also worth noting that while upgrades are necessary for maintaining the health and security of your cluster, they should be planned and executed during maintenance windows to minimize the impact on running applications.

How To Perform A Kubernetes Upgrade

Upgrading a Kubernetes cluster is a multi-step process that involves updating various components to a newer version. The process begins with planning the upgrade, which includes checking the current version of your cluster and deciding on the target version. It’s crucial to understand the changes that the new version brings, including any deprecated APIs or altered manifest configurations.

The next step is to upgrade the control plane, which includes components like the API server, controller manager, and scheduler. This is typically done using tools like Kubeadm, which provides commands to plan and apply the upgrade. During this stage, it’s important to ensure that all control plane components are upgraded to the target version.

Following the control plane upgrade, the next step is to upgrade the worker nodes. This involves draining the nodes to ensure that there are no running workloads, upgrading the kubelet and kubectl components, and then un-cordoning the nodes to bring them back into the cluster. It’s important to upgrade one node at a time to maintain the availability of your applications.

Finally, after the control plane and nodes have been upgraded, the last step is to update any client applications that interact with the Kubernetes API. This ensures that they are compatible with the new version of the cluster. It’s also a good practice to validate the successful completion of the upgrade by checking the version of the cluster and the status of the nodes and pods.

How Devtron Can Help

Deployment Template

While Devtron streamlines the CI/CD workflows for Kubernetes, it also significantly adds value to the process of K8s cluster upgrades. With each new Kubernetes release, there can be API deprecations and alterations in manifest configurations, such as the removal or introduction of parameters. If you’re managing your Kubernetes manifest manually, these changes can make upgrades a challenging task, as you’ll need to update all your manifests based on the changes in the target Kubernetes version.

As upgrades begin to deprecate resources, having a tool that can help with this is crucial. For example, when Pod Security Policies (PSP) were being deprecated, a lot of engineers were scrambling to ensure that their environment was up to date, running as expected, and wouldn’t go down.

However, Devtron’s Deployment Template eliminates this hassle. It manages both backward and forward compatibility, so you don’t have to worry about making these updates yourself. All you need to do is utilize the Deployment Template and ensure you’re using its latest chart version. With this approach, all your resources will be prepared for migration to the new cluster you’re upgrading to. This makes Devtron a valuable tool in managing Kubernetes deployments during upgrades.

If you have any queries, don't hesitate to connect with us. Join the lively discussions and shared knowledge in our actively growing Discord Community.