Step-by-Step Guide to Upgrading an Existing AWS EKS Cluster

Mahmoud Ahmed - Sep 10 - - Dev Community

Upgrading your Amazon Elastic Kubernetes Service (EKS) cluster is crucial, but why is it necessary? Why not leave it as it is if it’s already functioning?”
To answer these questions you need to know some points about Kubernetes and AWS EKS in general:

First, Kubernetes is a rapidly evolving open-source project with periodic releases and adopt concept of regular upgrades. They have created a versioning and releasing process that follows a quarterly release cycle, with a cadence ranging between 2 to 5 months.

Second, The Pricing, any running software prefer to use minimal resources that costs an affordable amount of money, but what if I told you this: "your running software will cost you x6 times the current cost starting from next month", I'm sure you won't be happy with that especially if you have high scale solutions.

AWS introduced two types of support for EKS :

1- Standard support: begins when a version becomes available in Amazon EKS and continues for 14 months — the same as the upstream Kubernetes support window for minor versions, which will cost you $0.10 per cluster per hour.

2- Extended support: in Amazon, EKS begins immediately at the end of standard support and continues for 12 months but with $0.60 per cluster per hour, and if you don't upgrade the EKS cluster until end of extended support AWS will force upgrade the cluster to next version of extended support, which is not recommended because it's can produce incompatibility or downtime for your cluster.

So it's always recommended that you update it yourself and stay in the standard support plan to ensure you are taking advantage of the latest features, security fixes, and low pricing plan. However, it is a process that must be handled carefully to avoid any downtime.

In this article, we will walk you through safely upgrading your EKS cluster using the command line.

Before You Begin

Before diving into the upgrade process, ensure you have:

  • AWS CLI installed and configured with appropriate permissions, you can check this guide.
  • kubectl configured to interact with your EKS cluster, here's is how to configure it?

Step 1: Assess Your Current Environment

Begin by assessing your current cluster version:

aws eks describe-cluster --name your-cluster-name --query "cluster.version"
Enter fullscreen mode Exit fullscreen mode

Then, list the available upgrade versions:

aws eks list-updates --name your-cluster-name
Enter fullscreen mode Exit fullscreen mode

Step 2: Plan Your Upgrade

Choose an appropriate version to upgrade to, It's recommended to review the release notes for the target version to understand any changes or necessary actions before and after the upgrade.

Be aware of the upgrading plan:
The Upgrading comes to many points in the cluster (Control plane, Data plane, Add-ons, policies, and other related components like a load balancer, ... etc)
And can be concluded into some points:

  • Understand Deprecation Policies.
  • Review Kubernetes upgrade insights provided by AWS EKS, to understand any possible impact on your cluster, such as breaking changes that may affect your workloads.
  • Check Cluster Add-Ons Compatibility, understand the compatibility of any existing cluster add-ons with the cluster version you intend to upgrade to, as EKS doesn’t automatically upgrade add-ons when new versions are released or after a cluster update.
  • Validate that your services still work, nodes are in active status and pulled images correctly, endpoints are routed to the right resources, and any other components that don't upgrade automatically with the cluster are compatible and running.

Step 3: Upgrade the AWS EKS Cluster

Now, initiate the upgrade:

aws eks update-cluster-version --name your-cluster-name --kubernetes-version new-version
Enter fullscreen mode Exit fullscreen mode

Monitor the update status:

aws eks describe-cluster --name the-cluster-name --query "cluster.status"
Enter fullscreen mode Exit fullscreen mode

Step 4: Update Your Node Groups

If your cluster uses managed node groups, they will also require updating:

List your node groups:

aws eks list-nodegroups --cluster-name the-cluster-name
Enter fullscreen mode Exit fullscreen mode

Update the node group:

aws eks update-nodegroup-version --cluster-name the-cluster-name --nodegroup-name the-nodegroup-name --kubernetes-version new-version
Enter fullscreen mode Exit fullscreen mode

Step 5: Upgrade Add-Ons

For those using AWS EKS add-ons, ensure they are also updated:

aws eks update-addon --cluster-name the-cluster-name --addon-name the-addon-name --addon-version the-new-addon-version
Enter fullscreen mode Exit fullscreen mode

Step 6: Verify system functionality

After the upgrade, it’s essential to check the cluster’s health and functionality:

  • Use kubectl to check the pods and deployments status.
  • Verify that all services are operating smoothly and test essential functionalities.

Step 7: Update Your Kubeconfig

Lastly, update your kubeconfig file:

aws eks update-kubeconfig --name the-cluster-name
Enter fullscreen mode Exit fullscreen mode

Conclusion

Now you have an initial insight about upgrading your AWS EKS cluster which is a direct process when done carefully. Always follow best practices, such as backing up your data and carefully reading version release notes. And don't forget to re-deploy a service that may surface a failure and require you to update your objects/charts to support the new version.
Regular upgrades are essential for security, performance, accessing new features, and saving your budget, making this knowledge an invaluable part of managing Kubernetes infrastructure.

. . . . . . .
Terabox Video Player