Skip to main content

Upgrade EKS cluster

Our EKS clusters are created using the official terraform-aws-eks module. When a new EKS major version is released, it is usually followed by a new terraform module release.

Our EKS cluster upgrade consists of three parts:

  • Upgrade EKS Terraform Module
  • Upgrade Control Plane
  • Upgrade Node Group(s)

Pre-requisites

Before you begin, there are a few pre-requisites:

  • Your GPG key must be added to the infrastructure repo so that you are able to run git-crypt unlock.

  • You have the AWS CLI profile moj-cp with suitable credentials.

  • You have terraform and docker installed

  • Review the changelog of the Kubernetes release and the EKS release you are planning to upgrade to.

  • Review the official EKS upgrading a cluster document for any extra steps that are a part of a specific EKS release.

Upgrade Steps

Upgrade EKS Terraform Module

As mentioned previously; when a new EKS major version is released, it is normally followed by a release of an associated terraform-aws-eks module.

1) The first step of the EKS upgrade is to identify the corresposding module release in relation to the EKS major version you want to upgrade to. Review the changes in the changelog. Plan/make any necessary changes or required updates.

Create a PR in Cloud Platform Infrastructure repository against the EKS module making the change to the desired terraform-aws-eks version

 module "eks" {
   source  = "terraform-aws-modules/eks/aws"
-  version = "v16.2.0"
+  version = "v17.1.0"

2) Execute terraform plan (or the automated plan pipeline) and review changes. If changes are all as expected, run terraform apply to execute the changes.

Upgrade Control Plane

3) Create a PR in Cloud Platform Infrastructure repository against the EKS module making the change to the desired EKS cluster version.

 module "eks" {
   source  = "terraform-aws-modules/eks/aws"
-  cluster_version = "1.14"
+  cluster_version = "1.15"

4) Execute terraform plan (or the automated plan pipeline) and review changes.If changes are all as expected, run terraform apply to execute the changes.

Once applied, verify using the AWS CLI or the AWS Console to confirm the Control Plane is on the correct version.

$ aws eks describe-cluster --query 'cluster.version' --name manager
"1.15"
$

AWS Console

Upgrade Node Group(s)

The easiest way to upgrade node groups is through AWS Console. We advise to follow the official AWS EKS upgrade instructions from the Updating a Managed Node Group documentation.

This page was last reviewed on 17 August 2021. It needs to be reviewed again on 17 November 2021 by the page owner #cloud-platform .
This page was set to be reviewed before 17 November 2021 by the page owner #cloud-platform. This might mean the content is out of date.