Update on Terraform OKE module

Ali Mukadam
2 min readMar 26, 2021

We recently released version 3.0.0 of the terraform-oci-oke module. I’ll do a brief break down of the changes here.

Terraform 0.13

The biggest motivation for releasing a major version was compatibility with Terraform 0.13. Besides a couple of deprecation warnings, the rest of the code base was ready for 0.13. However, since the OKE module also uses a few remote submodules (base, vcn, bastion, operator), we upgraded those as well.

New Features

In terms of new features, the major addition is the support for using Flex Shapes for worker node pools. You can now specify your node pool using Flex Shapes, custom boot volume size as well as custom memory sizes.

This necessitated a change in the variable file format e.g. in the previous version, you could specify node pools in the following manner:

node_pools = { 
np1 = ["VM.Standard.E2.2", 1],
np2 = ["VM.Standard2.8", 2],
np3 = ["VM.Standard.E2.2", 1]
#np4 = ["VM.Standard.E2.2", 4]
}

It was a simple map and each key represented a node pool which was specified using shape and the size of the node pool. Since we now have configuration options, we need to be able to both specify these but also set sensible defaults in case the user does not specify them, regardless of using the Flex shape or not.

You can now set your node pool in the following manner:

node_pools = { 
np1 = {
shape = "VM.Standard.E3.Flex",
ocpus=2,
memory=20,
node_pool_size=2,
boot_volume_size=150
},
np2 = {
shape= "VM.Standard.E2.2",
node_pool_size=2,
boot_volume_size=150
}
np3 = {
shape = "VM.Standard.E2.2",
node_pool_size=1
}
}

When using Flex Shapes, if you do not specify the boot volume size, the number of OCPUs or memory, a default of 50GB, 1 OCPU and 16 GB are used respectively.

We also added the ability to have the script enable Vertical Pod Autoscaling as well as updated the Calico installation so it’s no longer tied to a particular Calico version.

Kubernetes Tools

We have also reorganized the installation of kubectl and helm into a new file called k8stools.tf. As new and interesting Kubernetes tools get developed and adopted by the Kubernetes community and users, we want to be able to eventually add them ourselves or give our users a pattern and mechanism to add their own tools.

Bug fixes

Lastly, we fixed a few bugs as well as updated the documentation and topology to use the new OCI icons.

Community and contributing

We would like to thank the community for its contributions in all forms: whether they are new features, bug fixes, enhancements or new ideas.

--

--