Skip to content

Blog

Terraform, OpenTofu and the 1 MiB Secret

Every CAPTF module image carries one of two runtimes, Terraform or OpenTofu, and both keep their state in Kubernetes Secrets through a backend with the same name: kubernetes. Same labels, same lock, same gzip payload, and for most objects the same bytes. The two part ways at one number: 1 MiB, the most data the API server lets a Secret hold. Terraform splits state that grows past it across more Secrets. OpenTofu does not, and an apply that crosses the line loses the record of what it just created.

This post walks through both write paths, what CAPTF does with each, and how to pick a runtime before the difference matters.

CAPTF v0.1 is released

Cluster API Provider Terraform has its first releases. v0.1.0 was tagged on October 5, and v0.1.1 followed a day later. Together they put every part of the project into a versioned, installable form: the provider, the two runtime base images, the 17 reference modules on the Terraform Registry, and a module image for each of them, on both runtimes.

You can install it with clusterctl today and bring up a cluster with the no-op modules on any management cluster. This post covers what shipped, why it is 0.1 and not 1.0, and how every artifact is built, signed and checked, so you can verify it yourself.

Quick Start Release notes

Lint your module in CI with one step

A module that breaks the CAPTF contract does not fail where you wrote it. It fails in a runner Job, on a management cluster, with a Cluster waiting on it: a missing output, a variable name the contract reserves, a backend block the generated root cannot accept. tfcapi-lint finds those mistakes statically, before a Job ever runs, and since v0.1.1 it no longer needs a provider checkout to do it. It ships as a signed container image and a GitHub Action, and all 17 reference module repositories now lint with it on every pull request.

The Cluster Autoscaler on CAPTF machine pools

Until this week the docs said the Kubernetes Cluster Autoscaler cannot drive a CAPTF machine pool. That was true of one way of running it and wrong about the rest. The Cluster Autoscaler’s clusterapi provider cannot drive a pool. Its aws, azure and oci cloud providers can, because they never go through Cluster API at all: they resize the cloud’s scaling group directly, and a CAPTF pool already knows how to live with a group that something else resizes.

The AWS, Azure and OCI machine pool modules gained one variable in v0.1.1 to make that safe: autoscaler = "external". This post shows why the clusterapi route is closed, how the cloud route works, and how to set it up.

Reference modules for five clouds

The CAPTF project now maintains reference modules for five clouds: AWS, Google Cloud, Azure, Oracle Cloud Infrastructure (OCI) and OpenStack. Each set implements the v1alpha1 module contract and ships as module images you reference from a TerraformCluster, TerraformMachineTemplate or TerraformMachinePool. Use them as they are, or fork them as the starting point for your own.

Choose a cloud Try the no-op modules