0001: Hosted tenant k3s Job executor live proof
Status: done
Date: 2026-11-04
Goal
Prove that a knotless-run-shaped workflow can execute as one Kubernetes
Job on a socialweb-computer hosted tenant k3s cluster, with the runner
daemon outside the cluster and the Job pod driving the tenant node
autoscaler.
What was built
A standalone Rust crate and binary in this repository:
knotless-runner-k8s run: onebatch/v1 Jobper run.- One long-lived pod, one
kubectl execper step, so tools installed by an earlier step are present for later steps. - Checkout streamed into
/workwith tar overkubectl exec -i. - Shared steps streamed into
/steps. /outputsstreamed back to the host.- One run log with step output, exit codes, durations and timeout state.
- Result JSON whose
stepsentries mirrordev.knotless.check. --dry-runprints the Job manifest and everykubectlcall.- Unit tests and a fake-
kubectlend-to-end test; no cluster needed forcargo test.
Helper scripts:
scripts/tenant-kubeconfig.sh: drivessocialweb-computer-kcp/scripts/oauth-signin.tswith the alice credential file, creates a hosted tenant cluster, waits forReady, and writes its kubeconfig mode 0600 under~/.tmp.scripts/live-proof.sh: obtains the kubeconfig and runs the proof.
PLAN.md maps the proof to crates/knotless-run/src/executor.rs.
Live proof
- Gateway:
https://k8s.socialweb.computer - Cluster:
knotless-poc - Namespace:
default - Image:
busybox:1.36 - Steps:
date,hostname,files,outputs - Result: all four steps success, exit code 0
/work/steps.tsvwas present after the upload/outputs/ran.txtwas copied back- Job deleted after the run
- A node appeared for the Job, then the tenant returned to zero nodes
The result, log and output paths are recorded in LIVE.md; no credential
value, session cookie or kubeconfig is committed.
What this establishes
- A
getKubeconfigclient certificate from the hosted gateway supportskubectl apply,wait,get,execanddeleteagainst a tenant apiserver. - A Pending Job pod raises tenant demand and causes a NodeClaim, so the market rents a VM and joins it to k3s.
- Tar over
kubectl exec -iis enough to move a checkout in and outputs out; Kubernetes has no file copy API of its own. - A single pod per run keeps step state, matching the docker executor's one-container-per-run behavior.
- The result shape has the fields a check needs.
Not established
- No change to
knotless-run; this is a standalone proof. - No workflow YAML parsing; steps are
name<TAB>script. - No secrets or run variables.
- No caches, PVCs or artifact store.
- No cancellation over XRPC; timeout kills the local
kubectlclient and Job deletion stops the remote process. - No scoped off-host credential;
getKubeconfigis cluster-admin by construction. - The tenant cluster from this proof still exists with zero nodes.
Files
src/executor.rsequivalent: this crate'ssrc/runner.rs,src/kubectl.rs,src/manifest.rs.src/steps.rs: proof-only steps format.tests/fake_kubectl.rs: command sequence without a cluster.scripts/tenant-kubeconfig.sh,scripts/live-proof.sh.LIVE.md,PLAN.md,README.md.
Next
Continue in 0002.