feat(platform): empty the composition, hand the OpenBao CRs to Flux #686
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/retire-openbao-composition"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Empties the
platform-instancecomposition.resources: [], 549 lines down to 75. This is the step that actually hands the last ten Crossplane-managed resources to Flux.Sequencing -- do not land this before both of these:
wait: falseonplatform-seanfarm-instances) -- otherwise ten Kustomizations gate on an XR that is about to compose nothingRetainguard) -- this PR deletes the guard that currently protects the signing keysWhat it hands over
The composition owned the cluster's secrets and TLS authority: the shared
OpenBaoConnection, the internal-CA PKI (pki_root,pki_internal, and thecnpg-server/cnpg-client/bundle-exportissuing roles), and the transit backend holding the cosign image-signing keys, with its policy. Ten resources.All ten are already declared in seanfarm
kubernetes/flux/infrastructure/openbao-platform(#750), applied alongside Crossplane and co-managed bykustomize-controllerwith no field-ownership conflict. This hands over resources Flux already writes rather than moving them.The OpenBao server left Crossplane on 2026-06-10. This is the same move for what the server holds, and the last one: this XR tracks exactly ten composed resources, and there is one composition left in the cluster.
What happens on landing
The nine direct composed resources carry
ownerReferencesto the XR withblockOwnerDeletion: true, so ordinary Kubernetes GC removes them andopenbao-platformrecreates them on its next reconcile.The OpenBao-side state is not affected. Every one sets
spec.deletionPolicy: Retain, which is enforced rather than advisory --libseanfarm-operatorv0.4.13 (pinned by the deployedopenbao-operatorv0.12.32)reconcile/harness.go:401:The
UnmountSecretscall that would destroy a mount and every key in it is inside that block (openbaotransitbackend_impl.go:152), soRetainnever reaches it. Both PKI mounts, the intermediate CA, the three issuing roles, the transit mount and its three keys survive untouched. The window is one with no drift correction, not an outage.The tenth, the shared
OpenBaoConnection, is not collected at all -- its wrappingObjectwas set toOrphanin #684. It is referenced by name, over two hops, by five liveOpenBaoDynamicSecrets in four tenant namespaces, so it must survive continuously rather than be recreated.Guard changes
check-binjovi-forgejo-key.shremoved. It asserts onebinjovi-forgejo-jwtECDSA P-256 key by reading this composition, so emptying the file makes it fail -- which it did, and which is how the gap surfaced. It is ported and widened in seanfarm #756, which must land first so the invariant is never unguarded.check-composition-fmt-args.shcanary taught to tell empty from broken. Itsn == 0check guards against theyqextraction silently breaking, and an empty composition legitimately yields zero patches. It now counts composed resources to distinguish the two: resources present with no patches found still fails; composing nothing passes.That fix had a bug worth naming. The first version used
add, which thisyqbuild does not have, with stderr suppressed and an unset-to-zero default -- so the probe returned 0 and the canary silently passed when it should have fired. Exactly the failure class the canary exists to catch. It now uses a flat count, does not suppressyqerrors, and rejects a non-numeric count.Both behaviours verified: with a composed resource present and no string-combine patches, the canary fires (exit 1); with the composition empty, it passes.
What is left
The XRD, this composition, the
Platform/seanfarmclaim, and Crossplane itself -- removed in the next change, once this has soaked. Keeping the claim alive here means the Flux Kustomization applying it still has a resource to apply, and the handover can be verified on its own.tests/check.shexits 0.https://claude.ai/code/session_01GfkEuwuvGSqGyXVuxwT7PA
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.