Repository navigation
Run tasks as Kubernetes pods when there is no Agent Substrate - #10
Merged
Merged
Conversation
rax-server --runner=pod implements the server's Reconciler and Actors over plain pods in one namespace, for clusters that cannot host Substrate (a small single node, no gVisor). Each resume runs the task once in a new pod; a pod that exits 0 is the task suspended again, a non-zero exit or a pod that cannot start fails it with the reason. Secrets reach tasks only through --pod-env-from-secret, chosen by the server. The Kubernetes client is a few JSON calls over the TLS dialer rax-substrate already has, not kube-rs. Actors gains absent_actor, so a task with no pod reads as suspended rather than failed; Substrate keeps the old behaviour.
h0ffmann
added a commit
to piabrota/nix-os
that referenced
this pull request
Oct 31, 2026
…m the box (#36) k8s/ax-tasks holds the task namespace, a quota (two 768Mi agents) and a Role for rax-server's service account on pods there. rax-server moves to the pod runner (piabrota/rax#10, image sha-458aae3). piabrota.kubesolo.secrets turns a root-only env file on the box into a Kubernetes Secret, re-applied when the file changes; the agents' credentials go in ax-tasks/agents that way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
rax-server --runner=podruns tasks as plain Kubernetes pods instead of actors on Agent Substrate. It is for clusters that cannot host Substrate, such as piabrota/nix-os's single-node KubeSolo VPS (1 vCPU, 4 GB, no gVisor), where rax-server already runs with its store in PGX but cannot run a task.It is RAX's own mode, not AX's: no sandbox, snapshot, workspace setup or
ssh. Each resume runs the task once:Running,ResumingRunning,PendingSuspendedFailedcrates/rax-server/src/pods.rs:PodRunner, which implements the existingReconcilerandActorstraits, andKubeClient, a few JSON calls over the TLS dialerrax-substratealready has (in-cluster token and CA, the token re-read on every request). Nokube-rs: the build gains no new crates.spec.env,AX_TASK_NAME,AX_TASK_ATESPACE,AX_TASK_YAML, limits (requests equal) fromspec.resources.limitsor the server's defaults,restartPolicy: Never, no privilege escalation, no capabilities,RuntimeDefaultseccomp andrunAsNonRoot.--pod-env-from-secret, chosen by the server; a task'senvcannot name one.exceeded quota), a conflict, 429, 5xx or an unreachable API leaves the taskPending, to retry.Actors::absent_actor(defaultNone): a task with no pod reads asSuspendedunder the pod runner, notFailed; Substrate keeps its behaviour.--runner(RAX_RUNNER),--pod-namespace,--pod-env-from-secret,--pod-service-account,--pod-cpu-limit,--pod-memory-limit. The default stayssubstrate.Tests
ImagePullBackOffand exit codes), which errors are transient, a task's lifecycle across create, resume, finish, resume again and suspend, listing and deleting by label, and an unreachable API leaving the taskPending.--runner=pod --store=memory://, the in-cluster token of a service account with a Role onpodsinax-tasks, and theraxCLI:Suspended, and its log showedAX_TASK_NAME,AX_TASK_ATESPACEand a key from--pod-env-from-secret;exit 3→Failed, "The task's pod exited with code 3 (Error)";Failed(runAsNonRoot);cargo fmt --check,cargo clippy --all-targets -- -D warningsandcargo test --allpass.What comes next
In piabrota/nix-os: a namespace
ax-taskswith a quota and RBAC, rax-server with--runner=pod, and two agents run as tasks (a failed-deploy diagnosis and a daily health digest).