OrbitSpaceDocs
Deploy & operate

Deploy Runtime on Kubernetes

Start with one Worker-only StatefulSet connected to an approved remote Runtime Host. This separates engine coordination from sandbox execution and makes node identity and persistent storage explicit.

Deployment prerequisites

Complete node onboarding first. This example requires an enrollment credential for Worker-only mode with deployment mode kubernetes, plus a ready remote Host, resource endpoint, protocol credential and matching Runtime Profile.

Agree on a StorageClass, image architecture, registry access and network policy with the cluster operator. The CPU, memory and 20 GiB disk values are a starting point, not universal sizing. A platform deployment pool does not replace a missing Kubernetes deployment controller.

Download the StatefulSet example. It uses one stable identity, one PVC, a read-only root filesystem, a non-root user and health probes. It mounts no Docker socket, grants no Kubernetes API access and creates no VM.

Separate configuration and credentials

Use the enrollment CLI on a controlled Linux operations machine to generate worker.env and secrets/worker-token, then create the objects below. Use an authorized operations identity that can read the restricted credential files and has the intended cluster kubeconfig. Operators prepare these file paths; do not commit their contents to Git.

bash
kubectl create namespace orbitspace-runtime
kubectl -n orbitspace-runtime create configmap worker-enrollment \
  --from-env-file=/etc/orbitspace/node-01/worker.env
kubectl -n orbitspace-runtime create secret generic worker-auth \
  --from-file=worker-token=/etc/orbitspace/node-01/secrets/worker-token \
  --from-file=remote-runtime-token=/etc/orbitspace/node-01/secrets/remote-runtime-token \
  --from-file=nats-url=/etc/orbitspace/node-01/secrets/nats-url
kubectl -n orbitspace-runtime create configmap worker-remote-route \
  --from-env-file=/etc/orbitspace/node-01/remote-route.env

The remote-runtime-token comes from the remote Host's enrollment and must be distributed through controlled Secret management. A Worker-only enrollment does not generate the remote Host's credential. The nats-url file contains only the raw complete connection URL, with no variable name or trailing newline.

Put these non-secret route fields in remote-route.env:

dotenv
ORBITSPACE_REMOTE_RUNTIME_RESOURCE_ID=REVIEWED_RESOURCE_UUID
ORBITSPACE_REMOTE_RUNTIME_ENDPOINT_ID=REVIEWED_ENDPOINT_UUID
ORBITSPACE_REMOTE_RUNTIME_HOST_ID=STABLE_HOST_ID
ORBITSPACE_REMOTE_RUNTIME_DIRECT_ADDR=PRIVATE_HOST:9300
ORBITSPACE_REMOTE_RUNTIME_PROFILE=native

The three IDs must identify the same admitted endpoint. The Profile must be supported by that Host and allowed by the environment. Use the actual configured Docker profile for a Docker Host instead of copying native.

The manifest mounts both Tokens as files and references the NATS URL with secretKeyRef. Kubernetes Secret Base64 encoding is not encryption: configure etcd encryption at rest, restricted RBAC or an external Secret manager. Never dump the complete Pod environment containing secrets.

Apply the single-node manifest

Edit runtime-worker.yaml: replace RUNTIME_IMAGE_REFERENCE with an approved immutable digest and REPLACE_WITH_STORAGE_CLASS with the actual StorageClass. Add approved imagePullSecrets for private images and node selectors/tolerations for an execution pool where required. Do not embed registry credentials in an image reference.

Check that ORBITSPACE_WORKER_MODEL_ROUTES=codex/openai matches the installed model configuration, then run:

bash
kubectl -n orbitspace-runtime apply --dry-run=server -f runtime-worker.yaml
kubectl -n orbitspace-runtime apply -f runtime-worker.yaml
kubectl -n orbitspace-runtime rollout status statefulset/orbitspace-worker --timeout=180s
kubectl -n orbitspace-runtime get pod,pvc
kubectl -n orbitspace-runtime port-forward pod/orbitspace-worker-0 9100:9100

Request http://127.0.0.1:9100/readyz in another terminal. After the Pod is Ready, check its stable Worker ID, heartbeat, model route and remote Host capacity in the platform. Run a small task and confirm the actual Host and artifacts.

Identity, scaling and upgrades

Keep this manifest at one replica: worker-enrollment contains one fixed Worker identity. Changing replicas to three would make multiple processes compete for that identity. Enroll each additional instance separately with its own configuration and PVC, or use a controller that implements per-instance credential management.

The update strategy is OnDelete. Cordon new scheduling in the platform, wait for tasks and reservations to drain, update the image, then delete the drained Pod for StatefulSet replacement. Do not force-stop active tasks. Verify identity, PVC continuity and health before enabling scheduling again.

PVCs are retained when deleting or scaling the workload. After credential rotation, update the Secret through a controlled process and restart processes that read it; do not assume every process hot-reloads values. Retention and reclamation must cover caches and engine state, not only Pod lifecycle.

Where should the Host run?

LocationWhat to verify
Dedicated Host outside the clusterWorker-to-resource connectivity, Host-to-Control-Plane connectivity, persistent directories and actual sandbox capabilities
Separate Host in the clusterStable Host identity, dedicated state volumes, endpoint-to-instance mapping and execution isolation
Host embedded in a WorkerCoupled permissions/lifecycle, explicit per-task sandboxing and host path mappings

Do not place several stateful Hosts behind an arbitrary load-balanced Service and assume reconnection reaches the original node. Resource handles, workspaces and Host identity must remain associated.

Operators should review dedicated execution nodes and permissions for Docker, cgroup delegation or Firecracker. An ordinary unprivileged Pod does not automatically gain delegated cgroups, host Docker or /dev/kvm. A Pod resource limit covers its process group, not the platform's per-task resource contract.

Network policy and troubleshooting

Allow DNS, Control Plane gRPC, NATS, model gateway, artifact endpoints and approved Host routes according to cluster policy. Public model addresses may change; a temporary resolved IP is not a permanent allowlist. A private egress gateway can enforce destination policy centrally. Do not expose the Host resource port through a public Ingress.

SymptomCheck
Pod exits on startupImage architecture, Secret file permissions, gRPC h2c endpoint and protected tunnel/proxy
Ready but receives no taskNATS authentication/event scope, model routes, scheduling state and concurrency
Remote Runtime requiredComplete route settings and matching resource/endpoint/Host IDs
Sandbox admission rejectedProfile, actual capabilities, image digest, CPU/memory and network requirements
Tool cannot access codeBind paths visible to the Docker daemon host and correct PVC path mapping
History/files missing after restartReused PVC, unchanged state roots and accidentally deleted retained data

Collect node ID, task ID, image digest and error codes, not full environment variables or Tokens. See troubleshooting and the application developer quickstart.