Upgrade EKS 1.16 Cluster to EKS 1.17 Using EKSCTL

Nitin goyal
3 min readOct 28, 2020

EKS is one of the services provided by AWS. It helps in running Kubernetes on AWS without requiring the user to maintain their own Kubernetes control plan or the worker nodes.

In this blog, we will discuss the steps which are necessary for upgrading the EKS cluster from version 1.16 to version 1.17.

Upgrading EKS Cluster Version:

The cluster managed or created by eksctl can be upgraded with below steps:

  1. Upgrade EKS Plane
  2. Create New Node Group
  3. Update Kube-proxy (Kubernetes add-ons or Components)
  4. Update aws-node (Kubernetes add-ons or Components)
  5. Update core-dns (Kubernetes add-ons or Components)
  6. Drain and Delete Old Nodegroups

Upgrade EKS Plane

To upgrade EKS cluster plane to another version just run simple commands

eksctl upgrade cluster --name=<clusterName> --approve

or

eksctl upgrade cluster --name=<clusterName> --version=1.17 --approve

or

update version in Yaml file and run below command

eksctl upgrade cluster --config-file <clusterFileName> --approve

Note:

  1. Control plane version can be upraded only by one minor version (For example 1.16 to 1.17 only), but you can upgrade your nodes up to two minor versions at a time.
  2. When you upgrade the cluster, Amazon EKS requires 2–3 free IP addresses from the subnets which you provided at the time of cluster creation. If subnets do not have enough available IP addresses, the upgrade can fail and result in “InsufficientFreeAddresses” error.
  3. If the EKS cluster has Fargate pods, check Fargate pod’s kubelete version. If kubelet version is less than 1.16, recycle Fargate pods, so that their kubelet version will be 1.16. Otherwise, cluster upgrade will fail.
  4. If any of the subnets or security groups that were provided during cluster creation have been deleted, the cluster upgrade proccess can fail.
  5. When you update your cluster, Amazon EKS does not upgrade any of your Kubernetes add-ons. After updating your cluster, you have to update add-ons version as well.

Create New Node Group

After running the above cluster upgrade commands, you are able to create or upgrade your node groups. You can create node groups in the following ways.

  1. If you have single node group, you can create node group by following CLI command
eksctl create nodegroup --cluster=<clusterName> --name=<newNodeGroupName>

2. If you have multiple node groups and have created them using a config file then, you can create node groups by config/yaml file also. Remove old node groups and add new node groups to this config file and then run command

eksctl create nodegroup --config-file=<pathToConfigFile>

Update add-ons (Kube-Proxy, aws-node and Core-DNS)

You can update Kubernetes addons by using following command

  1. For Kube-Proxy
eksctl utils update-kube-proxy --cluster=<clusterName> --approve

2. aws-node

eksctl utils update-aws-node --cluster=<clusterName> --approve

3. Core-DNS

eksctl utils update-coredns --cluster=<clusterName> --approve

Note:

Onces the above compoents are updated, you have to check whether all components are running state or not, by running following command

kubectl get pods -n kube-system

Drain and Delete Old Node Groups

The drain action isolates the worker nodes and tells Kubernetes to stop scheduling any new pods on the node. To drain the node groups, run the following command and if you want to undo the draining use “ — undo” with the command

eksctl drain nodegroup --cluster=<clusterName> --name=<nodeGroupName>

To delete the old node groups run the following command

eksctl delete nodegroup --cluster=<clusterName> --name=<nodeGroupName>

If you are using config file to create and delete node groups. then change the node groups in config file and run the following command

eksctl delete nodegroup --config-file=<pathToFile> --only-missing --approve

That’s all about upgrading the Amazon EKS cluster using “eksctl

--

--

Nitin goyal

working as DevSecOps Engineer at Pixlevide Solutions. Loves to solve everyday problems with Automation.