Saltar a contenido

0022: API group tenax.run

Context

Tenax's custom resources, labels, annotations and finalizers used the group tenax.republic.global, the company's domain (ADR 0017). Tenax now has its own domain, tenax.run, and is about to be released publicly. The API group is the name everyone writes in their manifests (apiVersion: tenax.run/v1alpha1), so it should be the product's domain: it stays valid whoever owns or renames the company, and it reads as Tenax's own. Renaming is a breaking change, and it is cheapest now, while the only installation is our own cluster.

Decision

  • The group is tenax.run for every CRD, label (tenax.run/env, tenax.run/sandbox-client, ...), annotation (tenax.run/backup-now, ...) and finalizer.
  • For one release (0.6), the chart also keeps the CRDs of tenax.republic.global, unchanged. Without them a Helm upgrade would delete those CRDs and, with them, every object of the old group before anything could move it.
  • On start, the controller (leader only) moves the old group's objects (internal/controller/legacy.go):
  • BackupStores, BackupPolicies and BackupTargets are copied to tenax.run with the same name, namespace and spec, label and annotation keys rewritten, unless the new object already exists (applied by GitOps).
  • Every old object is released from its finalizers and deleted. Backups need no copy: the controller re-imports them from the store's manifests (ADR 0015). Restores are records of finished work; the migration waits while one still runs. Sandboxes are disposable: their namespaces go too.
  • Streamer Deployments that select their pods by old labels are deleted; the target reconcile recreates them under the same name, so the replication slot and the stream continue.
  • 0.7 drops the old CRDs and the migration.

Consequences

  • Upgrading from 0.5: change apiVersion and the tenax.republic.global/* label keys in your manifests to tenax.run, in the same change that upgrades the chart. Hand-made objects are copied by the controller. Pods that query sandboxes must carry tenax.run/sandbox-client instead of the old label. Sandboxes open at upgrade time are removed; an exposed sandbox's Cloudflare route is left behind and can be deleted by hand.
  • Skipping 0.6 (0.5 straight to 0.7) loses the old objects: upgrade through 0.6.
  • Annotations Tenax only writes for people (for example tenax.republic.global/age-recipient on an identity Secret created by an earlier bootstrap) are not read by Tenax and need no change.