Skip to content

virtual devices: S1 spike VM delivered by GitOps (flag off) - #8

Merged
tekn0ir merged 1 commit into
teknoir-cloudfrom
vd-spike-s1
Oct 11, 2026
Merged

tekn0ir merged 1 commit into
teknoir-cloudfrom
vd-spike-s1

Conversation

@tekn0ir

@tekn0ir tekn0ir commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

What

Delivers the S1 spike VM through GitOps instead of a hand-run render.sh + kubectl create, so the device keys never go into git or onto a workstation. Nothing deploys from this PR: virtualDevices.spike.enabled is false, and the chart refuses to render until renderer.digest is pinned.

  • charts/virtual-device-spike (new): <teamspace>-vdev namespace (identical to hack/virtual-device-spike/manifests/teknoir-demo-vdev.yaml, enforced by test/run.sh), a separate PSA-restricted namespace teknoir-vdev-spike for a one-shot render Job (so the -vdev egress policy needs no API-server hole), least-privilege RBAC, and the VirtualMachine (wave 2).
  • RBAC of the Job's ServiceAccount: get the one Device; get (that one name) and create Secrets in teknoir-demo-vdev. No list/watch/update/patch/delete, no ClusterRole.
  • charts/app-of-apps/templates/virtual-device-spike.yaml: Application behind virtualDevices.spike.enabled + the teknoir-cloud allowlist, with resources-finalizer, so flag off removes the VM (VMI, DataVolume/PVC), both namespaces and the Role/RoleBinding. The KubeVirt/CDI runtime stays.
  • hack/virtual-device-spike/renderer: -in-cluster mode (standard library only, SA token + CA; create-if-absent keeps the k3s token stable across syncs; refuses k3s >= 1.34.12 without keyCertSign). The cloud-init moved from a render.sh heredoc into renderer/userdata.tmpl, which render.sh now also uses (one source). New Dockerfile (cli checked out at the pinned VDS_CLI_REF) and .github/workflows/vdev-spike-render.yaml (builds ghcr.io/teknoir/vdev-spike-render; PRs build without pushing).
  • check.sh N8-N10: the render ServiceAccount can get its Device and nothing else.

Verification (offline)

  • hack/virtual-device-spike/test/run.sh: 164 ok, 0 fail (shellcheck, gofmt, existing render assertions unchanged, new: renderer -in-cluster against a fake HTTPS API server for fresh / secret-exists / Device-missing / k3s guard / bad key / bad name; chart helm template + kubeconform -strict; chart namespace and VM equal to the render.sh output; Job, RBAC and render-namespace assertions).
  • docker build of the renderer image succeeds; actionlint and gitleaks clean.
  • helm template charts/app-of-apps: default render byte-identical to before; with the flag on it renders virtual-device-spike once for teknoir-cloud and 0 times for teknoir-online / teknoir-local.

Order after merge (see hack/virtual-device-spike/README.md, "S1 delivered by GitOps")

  1. Merge. The workflow builds the image on teknoir-cloud and prints the digest. Make the ghcr package vdev-spike-render public (r415 only has ghcr-token in teknoir-system).
  2. PR pins renderer.digest.
  3. Create Device vd-spike-1 in Backstage (teknoir-demo, Generic PC, user mode create, no device-group: test, not Virtual).
  4. PR sets spike.enabled: true.
  5. Cleanup: PR sets spike.enabled: false, then delete the Device in Backstage.

Staging only; no change to teknoir-online.

🤖 Generated with Claude Code

…t render

GitOps delivery of the S1 spike VM (default off, teknoir-cloud only):

- charts/virtual-device-spike: <teamspace>-vdev namespace (identical to the
  kit manifest), a separate PSA-restricted namespace for a one-shot render
  Job with least-privilege RBAC (get one Device, get/create Secrets in the
  vdev namespace), and the VirtualMachine (sync wave 2).
- app-of-apps: Application virtual-device-spike behind
  virtualDevices.spike.enabled (false) with the resources-finalizer, so
  turning the flag off removes the VM and both namespaces.
- renderer: -in-cluster mode (standard library, SA token, create-if-absent
  keeps the k3s token stable), -userdata mode, cloud-init moved from a
  render.sh heredoc into renderer/userdata.tmpl (one source), Dockerfile and
  the vdev-spike-render workflow (builds ghcr.io/teknoir/vdev-spike-render).
- tests: fake API server for -in-cluster, chart assertions and kubeconform;
  check.sh N8-N10 for the render ServiceAccount.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tekn0ir
tekn0ir merged commit 5ead5b1 into teknoir-cloud Oct 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant