Skip to main content
Knowledge Base

Upgrading Kubernetes and Terraform

Answer

<!-- slack:https://gruntwork-io.slack.com/archives/C0164GRE0RW/p1647539603977229 --> We are plotting our course through kubernetes upgrades from `v1.18` to `v1.21` to catch ourselves up before AWS EKS support ends and are currently using `v0.30.0` of the terraform-aws-eks module. What do you recommend for our approach? 1. Should we stay lock-step in line with the module's default kubernetes version and handle the TF upgrades along the way to `0.14`, `0.15`, `1.0.x`.. 2. E.g. 3. k8s `v1.19` TF >= `0.12.0` module `v0.33.0` 4. k8s `v1.20` TF >= `0.15.0` module `v0.40.0` 5. k8s `v1.21` TF >= `1.0.0` module `v0.44.0` 6. Or is there some support for a more flexible approach where we override the module's default kubernetes version to `v1.21` while remaining on the older module version and handle the module + TF upgrades separately afterwards?

`terraform-aws-eks` version `v0.30.0` is known to work with Terraform `1.0.x` and Kubernetes `v1.21` (provided you have `kubergrunt` version `v0.8.0` installed and available on the machine deploying). Given that, we recommend updating each in isolation, starting with `terraform` version and then moving on to upgrading the kubernetes version, before ending with upgrading the module versions. Since you are already on `terraform-aws-eks` version `v0.30.0`, upgrading the Terraform version should be fairly straight forward. Note that you will need to upgrade the `terraform` version one minor version at a time. That is, you will need to update your local CLI to terraform `0.13.x`, run `terraform apply`, and only after `apply` is successful do you update the CLI to version `0.14.x` and so on. For upgrading Kubernetes versions, you can refer to our docs, [How do I upgrade the Kubernetes Version of the cluster?](https://github.com/gruntwork-io/terraform-aws-eks/tree/v0.30.0/modules/eks-cluster-control-plane#how-do-i-upgrade-the-kubernetes-version-of-the-cluster). Finally, when upgrading the module versions, refer to our docs, [Updating to new versions](https://docs.gruntwork.io/guides/working-with-code/versioning/#updating-to-new-versions).