Kubernetes Operator for Tangled Spindles

upgrade embedded spindle to tangled core v1.20.1 #17

Open evan.jarrett.net
targeting main from core-v1.20
Open opened by evan.jarrett.net
targeting main from core-v1.20

tg and current Tangled clients find a spindle through its did:web DID and talk to it over org.tangled.*. Loom's embedded core v1.16 served neither: /.well-known/did.json, org.tangled.spindle.describeSpindle and org.tangled.ci.* all returned 404, so tg couldn't reach CI on loom.jarrett.net. Core v1.20.1 serves all of them.

Changes #

  • Dependency: core >= v1.20.0 can't be fetched as a Go module, because fixture paths with : in them break the module zip. tangled.org/core is replaced with tangled.org/evan.jarrett.net/core v1.20.1-loom.1, which is upstream v1.20.1 plus a localinfra/fixtures/go.mod. Drop the replace once upstream takes that fix (branch fixtures-gomod on the core fork).
  • Code: the engine, controller and main.go are ported to the v1.20 API. PipelineId is now a TID minted by the spindle. main sets up the quota manager, migrates pre-v1.20 log files, and releases reservations recovered from an interrupted run.
  • Image: v1.20 links hydrant (Rust) through cgo. A new Dockerfile stage builds libhydrant_ffi.a from the hydrant version go.mod pins. Go builder images are bumped to 1.26.
  • Deployment: Helm and kustomize gain the signing key Secret mount, SPINDLE_CONTACT_EMAIL, the hydrant dir on the spindle PVC, and admission/admins values. The dead tap setting is removed.

Verification #

  • make test and make lint pass, as do helm lint and kubectl kustomize config/default.
  • The amd64 image ran against envtest: did.json, describeSpindle, org.tangled.ci.queryPipelines and /_health answer, and hydrant reached plc.directory.
  • arm64: hydrant and the controller cross-compile to a static aarch64 binary. The full arm64 image is unverified, because the build machine has no qemu.
  • A v1.16 database migrates under v1.20. Only an empty one was tested.

Before deploying #

  1. Create the signing key Secret once and keep it, because rotating it changes the spindle's identity:
    openssl ecparam -name prime256v1 -genkey -noout -out spindle-key.pem
    kubectl create secret generic loom-spindle-key -n loom-system --from-file=spindle-key.pem=spindle-key.pem
    
    With Helm, set spindle.signingKey.existingSecret=loom-spindle-key.
  2. Set the contact email: spindle.contactEmail in Helm, or the TODO in config/manager/manager.yaml. The spindle won't start without it.
  3. Admission is closed by default: only the owner, spindle.admins and the allow-list get CI. v1.16 members aren't migrated.
  4. Hydrant shares the 1Gi spindle PVC; its growth is unknown.
  5. Back up spindle.db first.

The old sh.tangled.* routes are gone in v1.20.

🤖 Generated with Claude Code

Commits 3

pin the release pipeline to buildah 1.43.5
set the spindle contact placeholder and retry module downloads
upgrade embedded spindle to tangled core v1.20.1
Sign up or Sign in to add to the discussion.