Orca on Kubernetes in Practice: Architecture, Persistence, and Security Boundaries of a Headless Agent Worktree Server¶
Overview and Background¶
When running multiple coding agents in parallel, turning a local laptop into an always-on agent host quickly runs into compute, memory, and lid-close sleep limits. On the other hand, adopting a full cloud desktop or browser-based Web IDE often introduces heavy container images, fragmented terminal state, and higher multi-replica operational overhead.
Orca (stablyai/orca) is an MIT-licensed open-source coding agent workbench featuring parallel Git worktree isolation, a persistent PTY terminal daemon, automatic local dev-server port discovery, and lightweight multi-agent orchestration primitives. Beyond its desktop and mobile apps, the project ships an official headless Linux server archive (orca-server-linux-x64.tar.gz) starting in v1.4.x, requiring no Electron, GTK, X11, or Xvfb. The single archive is roughly 64 MB and bundles Node.js alongside the orcad daemon.
Based on Orca v1.4.284 (orcad 0.1.0+b6ee1e6fc3b6, bundled Node 24.22.3), this guide documents a complete containerized deployment and cross-node end-to-end validation on Kubernetes v1.37.2 (containerd://2.4.2, multi-node linux/amd64 cluster with local LVM persistent volumes), covering Orca's true positioning, production-ready StatefulSet manifests, measured resource and recovery data, and four real engineering pitfalls uncovered during rollout.
One-Sentence Conclusion¶
Orca Server is not a self-hosted browser Web IDE, but an X25519 end-to-end encrypted (E2EE v2) headless worktree and terminal server built for Orca Desktop, Mobile, and CLI clients: on Kubernetes, running it as a single-replica StatefulSet backed by an RWO PVC (persisting both HOME and ORCA_USER_DATA_PATH) with --refuse-public --no-pairing is the cleanest pattern; in our cluster tests, deleting the Pod recovered to Ready in 9.47 s and resumed cross-node RPC in 11.96 s without re-pairing, preserving server identity, uncommitted worktree files, and orchestration DAG state with zero loss, while live PTY sessions and headless browser automation carry clear operational boundaries.
Key Findings¶
- Calibrate the positioning first: the official
orca-serverlistens only on:6768for E2EE v2 WebSocket RPC and serves the embedded mobile bundle—it does not include a standalone browser Web IDE; engineers connect via Orca Desktop, Orca Mobile, or theorca-ideCLI. - Zero-re-pair state recovery: after
kubectl delete pod, as long as the PVC remains intact andHOMEpoints to the PVC,installationId, the X25519 server keypair, paired device grants, Git repos, all4worktrees (including uncommitted files), and multi-agent orchestration DAG state survive untouched; only live PTY processes reset cleanly from6to0(because the container PID namespace is destroyed). - Low footprint and predictable latency: idle resident memory sits at
650.9–695.3 MiB, rising to782.2 MiBtotal RSS with6active PTY terminals plus1Node dev server; cross-node ClusterIP E2EE RPC (including CLI cold start and handshake) takes529–565 ms, and creating an isolated Git worktree has a three-run median of728 ms. - Critical production hardening flag: by default, startup prints a complete pairing URL containing a live
deviceTokento container stdout, risking exposure through centralized log collectors; enabling--no-pairingsuppresses all tokens from startup logs while keeping previously paired clients working, and operators can still mint one-off pairing offers with zero restart via RBAC-gatedkubectl exec ... -- orca-ide pair. - Four real-world deployment pitfalls:
DockerfileWORKDIRcolliding withfsGroupto make mounted directories unwritable, K8scommand:overridingtiniPID 1, failing to persistHOMEso$HOME/orca/workspaces/disappears on Pod recreation, and the absence of per-terminal systemd memory scopes inside containers alongside at-rest credential keys living on the same volume.
Project Highlights and Comparison with Similar Tools¶
Five Standout Design Highlights of Orca¶
Amid a crowded wave of coding-agent tools, stablyai/orca stands out not by building yet another proprietary model, but by turning parallel multi-agent engineering workflows into cohesive, composable primitives:
- Bring Your Own Everything without vendor lock-in: Orca avoids locking you into a closed model or bespoke agent loop; it directly orchestrates tools developers already use—Claude Code, Codex CLI, Copilot CLI, and Amp—across local machines, SSH hosts, per-worktree cloud VMs, and remote
orca-serverinstances. - Lossless switching between Chat UI and raw terminal: a single agent conversation can be inspected in a structured Chat surface or switched back to the underlying CLI PTY without losing context, balancing readability with low-level terminal control.
- Self-bootstrapping CLI parity for agents: anything a human can trigger in the UI—creating worktrees, spawning workers, inspecting ports, raising approval gates, scheduling automations, or driving browsers and emulators—an agent can invoke through the
orca-ideCLI, making coordinator-to-parallel-worker execution work end to end. - Human-in-the-loop "Bots inside your IDE": tasks can be triggered from Slack, Linear, or GitHub, with bot personality and memory stored as inspectable plain Markdown files (
SOUL.md,MEMORY.md); blockers ping Orca Mobile for quick replies, while desktop users can annotate exact diff lines and route focused feedback back to the agent. - Worktree-centric lightweight parallelism and multi-host aggregation: instead of heavy full-repo clones or heavy containers per task, Orca binds branch isolation, dedicated PTYs, and local port discovery into one lightweight unit aggregated across remote hosts in a single desktop client.
Similarities and Differences Across Three Adjacent Categories¶
Engineering teams evaluating Orca frequently compare it against three neighboring tool categories. The table below breaks down where they overlap and where they fundamentally diverge:
| Category | Representative Tools | What Is Similar | Key Differences |
|---|---|---|---|
| AI IDEs and single-agent coding CLIs | Cursor, Windsurf, Claude Code, Codex CLI | All target the daily loop of AI code generation, diff inspection, terminal execution, and PR submission | Single-agent tools center on one repo and one session; Orca sits above them, coordinating multiple CLI agents in parallel worktrees, aggregating multiple hosts, and unifying line-level diff annotations |
| Multi-agent collaboration and async bot platforms | AgentTeams, OpenClaw, Multica, hosted async coding agents | All decompose larger tasks across parallel workers with IM/ticket triggers, async status reports, and human checkpoints | Chat-first tools center on messaging streams where live terminal takeover and line-level diff review feel bolted on; closed cloud agents trap execution inside a hosted black box; Orca runs bots inside worktrees on your own machines or cluster so you can jump into any tab immediately |
| Cloud desktops and agent execution sandboxes | Rakazo, CubeSandbox, OpenSandbox, Firecracker sandboxes | All offload long-running builds, dev servers, and terminal state from laptops onto cloud or Kubernetes infrastructure | Sandboxes and cloud PCs prioritize strong isolation boundaries, untrusted code execution, and browser-accessible desktops; Orca Server prioritizes parallel developer workflow throughput, omits a standalone browser Web IDE, and isolates at the process/worktree layer—making them complementary rather than mutually exclusive |
Architecture Positioning and Boundaries¶
Before bringing Orca into Kubernetes, it helps to separate it cleanly from cloud desktops, browser sandboxes, and chat-centric multi-agent platforms. Orca follows a "Server Owns State, Client Renders UI" model: orcad owns repositories, Git worktrees, the PTY daemon, SQLite session and orchestration databases, and provider CLI credentials; clients aggregate multiple remote hosts, render diffs, and handle human approvals over an X25519 E2EE v2 channel.

Figure 1: Process topology, E2EE v2 client access paths, and PVC persistence boundaries of Orca Headless Server on Kubernetes.
Cross-checking upstream documentation (docs/site/content/docs/remote-servers.mdx and cloud/apps/relay) against our cluster deployment clarifies the exact boundary between open-source and hosted components:
| Component / Capability | Open-Source Status and Runtime Location | Observed Kubernetes Behavior |
|---|---|---|
orca-server (orcad + daemon-entry) |
MIT open source, official linux-x64 archive |
Zero GUI dependencies, ready in 1–2 s offline, exposes 403 capabilities |
orca-ide CLI remote control |
MIT open source, bundled in server archive | Supports persistent environment add pairing and full orchestration / terminal / port commands |
| Standalone browser Web IDE | Not included in headless server | Headless install omits browser panes and dictation; Desktop or Mobile clients consume RPC |
Headless browser automation (browser.headless.v1) |
Optional extension requiring external Chromium | Default status --json reports browser_unavailable; unlocked by setting ORCA_BROWSER_EXECUTABLE |
Cross-network Relay (cloud/apps/relay) |
MIT open source (Director + Cell frame splicer) | Not needed for LAN / Tailscale / Port-Forward direct connections; degrades gracefully to relay offline |
| Slack / GitHub / Linear webhooks and push gateway | Hosted cloud backend (outside core headless archive) | Not required in air-gapped clusters; core local and cross-node workflows stay intact |
For platform teams evaluating options, the table below compares Orca Server against common cluster-native alternatives:
| Dimension | Orca Headless Server | CubeSandbox / OpenSandbox | Rakazo / Cloud PC | AgentTeams |
|---|---|---|---|---|
| Primary interface | Desktop / Mobile / CLI (E2EE RPC) | API / SDK + optional noVNC | Browser desktop / Web IDE | Matrix chat rooms + shared storage |
| Parallel code isolation | Native Git Worktree + dedicated PTY | Per-task microVM / container sandbox | Single cloud desktop or container | Manager dispatches to isolated Workers |
| Multi-agent primitives | Native Run / Task DAG / Gate / Mail |
Focused on isolated execution & snapshots | Focused on persistent single-user desktop | Focused on chat coordination & room updates |
| Isolation security tier | Process + worktree level (shared UID in Pod) | Strong isolation (supports Kata / Firecracker) | Container / VM level | Pod-level Worker isolation |
| Idle resource footprint | Single Pod ~650–700 MiB RAM |
Warm pools or on-demand spin-up | Higher when bundling full desktop GUI | Control plane + Matrix + Worker stack |
In short, Orca shines as a high-density parallel coding workbench for an individual developer or trusted small team, not as a multi-tenant untrusted-code sandbox. If your workload runs untrusted generated code or hundreds of concurrent ephemeral sandboxes, prefer CubeSandbox / Firecracker or pair Orca as a control plane with externally isolated execution nodes.
Production Container Image and Kubernetes Manifests¶
Minimal Non-Root Container Image¶
The official Linux server archive targets glibc >= 2.28 (linux-x64-glibc) and already bundles its own Node.js runtime, so debian:12-slim (GLIBC 2.36) is sufficient without installing system Node.js or GUI libraries. Include tini as PID 1 to reap orphaned terminal subprocesses, plus git, openssh-client, jq, and procps for worktree management and port scanning.
FROM debian:12-slim
ARG ORCA_VERSION=1.4.284
ARG ORCA_ARCHIVE=orca-server-linux-x64.tar.gz
ARG ORCA_SHA256=ed9885a892e59f373a0d192e982d1d56b60b9e776133d5c20bdcad9a744c11fa
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
jq \
openssh-client \
procps \
tini \
&& rm -rf /var/lib/apt/lists/*
COPY artifacts/${ORCA_ARCHIVE} /tmp/${ORCA_ARCHIVE}
RUN echo "${ORCA_SHA256} /tmp/${ORCA_ARCHIVE}" | sha256sum -c - \
&& mkdir -p /opt/orca-server \
&& tar -xzf /tmp/${ORCA_ARCHIVE} -C /opt/orca-server --strip-components=1 \
&& rm -f /tmp/${ORCA_ARCHIVE} \
&& ln -sf /opt/orca-server/bin/orca-ide /usr/local/bin/orca-ide \
&& ln -sf /opt/orca-server/bin/orca-ide /usr/local/bin/orca
RUN groupadd -g 1000 orca \
&& useradd -m -u 1000 -g 1000 -d /var/lib/orca -s /bin/bash orca \
&& mkdir -p /var/lib/orca/data /var/lib/orca/workspaces /var/lib/orca/orca \
&& chown -R orca:orca /var/lib/orca
USER orca
WORKDIR /var/lib/orca/workspaces
ENV HOME=/var/lib/orca \
ORCA_USER_DATA_PATH=/var/lib/orca/data \
ORCA_BACKGROUND_LAUNCH=1 \
PATH="/opt/orca-server/bin:/usr/local/bin:/usr/bin:/bin"
EXPOSE 6768
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["orca-ide", "serve", "--bind", "0.0.0.0", "--port", "6768", "--pairing-address", "127.0.0.1", "--refuse-public", "--no-pairing"]
Note: On Linux distributions, Orca installs its CLI as
orca-ideto avoid colliding with the GNOME screen reader/usr/bin/orca; symlinking bothorca-ideandorcainside the container keeps automation scripts portable.
Hardened StatefulSet and Service Manifest¶
Because orcad manages single-instance state through SQLite (agent-session-domain.db, orchestration.db) and a local file lock (orcad.lock), it must run as a single-replica StatefulSet with an RWO PVC rather than a multi-replica Deployment sharing one volume. Below is the sanitized, hardened manifest verified on our cluster:
apiVersion: v1
kind: Namespace
metadata:
name: orca-lab
---
apiVersion: v1
kind: Service
metadata:
name: orca-server
namespace: orca-lab
labels:
app: orca-server
spec:
selector:
app: orca-server
ports:
- name: rpc
port: 6768
targetPort: 6768
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: orca-server
namespace: orca-lab
spec:
serviceName: orca-server
replicas: 1
selector:
matchLabels:
app: orca-server
template:
metadata:
labels:
app: orca-server
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
fsGroupChangePolicy: OnRootMismatch
initContainers:
- name: init-dirs
image: ghcr.io/example/orca-server:v1.4.284
securityContext:
runAsUser: 0
runAsGroup: 0
command:
- sh
- -ec
- |
mkdir -p /var/lib/orca/data /var/lib/orca/workspaces /var/lib/orca/orca /var/lib/orca/.local/bin
chown -R 1000:1000 /var/lib/orca/data /var/lib/orca/workspaces /var/lib/orca/orca /var/lib/orca/.local
volumeMounts:
- name: orca-data
mountPath: /var/lib/orca
containers:
- name: orca-server
image: ghcr.io/example/orca-server:v1.4.284
args:
- orca-ide
- serve
- --bind
- 0.0.0.0
- --port
- "6768"
- --pairing-address
- orca-server.orca-lab.svc.cluster.local
- --refuse-public
- --no-pairing
env:
- name: HOME
value: /var/lib/orca
- name: ORCA_USER_DATA_PATH
value: /var/lib/orca/data
- name: ORCA_INSTANCE_ID
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: ORCA_BACKGROUND_LAUNCH
value: "1"
ports:
- name: rpc
containerPort: 6768
readinessProbe:
tcpSocket:
port: 6768
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 3
livenessProbe:
tcpSocket:
port: 6768
initialDelaySeconds: 15
periodSeconds: 15
timeoutSeconds: 3
resources:
requests:
cpu: 500m
memory: 1Gi
limits:
cpu: "4"
memory: 8Gi
securityContext:
allowPrivilegeEscalation: false
volumeMounts:
- name: orca-data
mountPath: /var/lib/orca
volumeClaimTemplates:
- metadata:
name: orca-data
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: local-lvm
resources:
requests:
storage: 10Gi
Six configuration details deserve explicit attention:
- Use
args:instead ofcommand:: preserves the imageENTRYPOINT ["/usr/bin/tini", "--"]sotinistays PID 1. - Persist both state and home: mounting
/var/lib/orcawithHOME=/var/lib/orcaandORCA_USER_DATA_PATH=/var/lib/orca/datakeeps SQLite databases, keys, and default worktrees under$HOME/orca/workspaces/on the same PVC. - Explicit
ORCA_INSTANCE_ID: bound tometadata.nameso cloned PVC snapshots never share an identical X25519 pairing identity. --refuse-public: restricts connections strictly to localhost, private RFC 1918 / link-local ranges, and Tailscale ranges, rejecting public source IPs.--no-pairing: prevents pairing tokens from being emitted into container stdout on boot, paired with RBAC-gatedorca-ide pairon demand.- Dedicated
init-dirs: initializes volume directory ownership once as root while keeping the main server container strictly atrunAsUser: 1000andallowPrivilegeEscalation: false.
Cross-Node Verification Results and Metrics¶
To exercise a realistic network path, we ran orca-server-0 and a standalone orca-client Pod on different worker nodes, routing every command across nodes through the Kubernetes ClusterIP Service orca-server.orca-lab.svc.cluster.local:6768 over X25519 E2EE v2. Complete sanitized measurements are stored in results.json.

Figure 2: Measured Pod memory breakdown, cross-node E2EE RPC latency, and Pod deletion recovery metrics for Orca Server on Kubernetes.
Cross-Node E2EE Pairing and Persistent Environments¶
An operator minted a zero-restart pairing URL inside orca-server-0, and orca-client on another worker node saved it as a persistent environment named aik8s-orca:
# 1. 在服务端 Pod 按需签发配对码(零重启,不落盘日志)
PAIR_URL=$(kubectl -n orca-lab exec orca-server-0 -c orca-server -- \
orca-ide pair --address orca-server.orca-lab.svc.cluster.local --json \
| jq -r '.. | strings | select(startswith("orca://pair?"))' | head -n1)
# 2. 在远端客户端节点保存持久化 E2EE 环境并检查远端状态
orca-ide environment add --name aik8s-orca --pairing-code "$PAIR_URL" --json
orca-ide status --environment aik8s-orca --json
Observed results:
environment addcompleted the cross-node X25519 handshake and persisted client credentials in552 ms.status --environment aik8s-orca --jsonreturned in546 mswithok: true,state: "ready",appVersion: "1.4.284", and403reported runtime capabilities (covering orchestration, federation, worktrees, terminals, and the mobile web bundle).- Runtime self-diagnostics transparently surfaced
1expected degradation:browser_unavailable(browser.headless.v1), noting thatORCA_BROWSER_EXECUTABLEis not configured in the headless container.
Parallel Git Worktrees, Server PTYs, and Port Discovery¶
After initializing and registering /var/lib/orca/workspaces/demo-service on the server PVC, orca-client remotely created 3 parallel Git worktrees on independent branches (feat-auth, fix-cache, bench-metrics), opened server-side PTY terminals, and launched a local listener:
# 跨节点创建并行 Git 工作树
orca-ide worktree create --environment aik8s-orca \
--repo name:demo-service --name feat-auth --branch feat/auth-jwt --no-parent --json
# 在 feat-auth 工作树打开服务端 PTY 并写入隔离代码
orca-ide terminal create --environment aik8s-orca \
--worktree name:feat-auth --title "auth-dev" \
--command 'echo "export const jwt = true;" > auth.mjs' --json
# 启动监听 18080 端口的开发服务并触发工作树级端口探测
orca-ide ports --environment aik8s-orca --worktree name:feat-auth --json
Measured outcomes:
- Worktree creation latency: three cross-node
worktree createcalls completed in992 ms,728 ms, and689 ms(median728 ms), with Orca automatically provisioning a live default PTY terminal for each new worktree. - Strict filesystem isolation: writing
auth.mjsinsidefeat-authandcache.mjsinsidefix-cacheleftmainandbench-metricscompletely clean across all4worktree checkouts, with each feature branch seeing only its own changes. - Worktree-scoped live port discovery: after launching a Node HTTP server bound to
127.0.0.1:18080inside thefeat-authPTY,orca-ide ports --worktree name:feat-auth --jsondetected it in565 ms, returningport: 18080,protocol: "http",kind: "workspace",owner.displayName: "feat-auth",owner.confidence: "cwd", and automatically extractingadvertisedUrl: "http://127.0.0.1:18080"from terminal output.
Multi-Agent DAG Orchestration, Gates, and Mail¶
Orca ships a lightweight built-in multi-agent orchestration engine persisted in orchestration.db, requiring no external message broker. Using the remote CLI, we verified the full Run -> Task DAG -> Decision Gate -> Mail lifecycle and automatic dependency unlocking:
- Created Run
run_0aa2a92a2abcwith two dependent tasks:task_a2fa82f6bb3d(auth-worker, startingready) andtask_e6af918b2c93(cache-worker, depending on the first task and startingpending). - Attached a human decision gate
gate_9be0b30f454eto the first task (choosing betweenEdDSAandHS256for JWT signing), then ranorchestration gate-resolve --id gate_9be0b30f454e --resolution "EdDSA", transitioning the gate toresolved. - Running
orchestration task-update --id task_a2fa82f6bb3d --status completedimmediately auto-unlocked the downstream tasktask_e6af918b2c93frompendingtoreadyas confirmed bytask-list. - Dispatched inter-agent mail
msg_41f853b2c961viaorchestration send --type handoffand verified exact subject and body delivery viaorchestration check --terminal <handle>.
Pod Deletion and Stateful Recovery¶
To test node eviction and rolling upgrades, we ran kubectl -n orca-lab delete pod orca-server-0, timed the full recovery window, and immediately issued remote RPC queries from orca-client on the other worker node without re-pairing:
| Check Item | Before Pod Delete | After Pod Recreation | Verdict |
|---|---|---|---|
| Delete to Pod Ready | — | 9.471 s |
Includes reschedule, init-dirs, PTY self-test, TCP probe |
| Delete to first cross-node RPC | — | 11.958 s |
Subsequent warm RPCs settle at 529–546 ms |
| Re-pairing required | Saved aik8s-orca |
No (zero re-pair) | E2EE keys and device grants persist on PVC |
installationId / runtimeId |
7e900db7-... / old UUID |
7e900db7-... unchanged / new UUID |
Long-lived identity preserved; per-process ID rotates |
| Registered repos and worktrees | 1 repo / 4 worktrees |
1 repo / 4 worktrees |
Includes uncommitted auth.mjs and cache.mjs |
| Orchestration Run and Task DAG | completed + ready |
completed + ready |
orchestration.db preserved intact |
| Live PTY terminals | 6 active PTYs |
0 (clean reset) |
stale-lock-reclaim clears old locks with no hang |
This cleanly defines the difference between bare-metal and containerized operation: on a host VM, daemon-entry.js keeps PTYs alive across orcad restarts; in Kubernetes, Pod deletion terminates the entire PID namespace so live terminal processes always reset, while identity, Git checkouts, worktrees, and orchestration state survive 100%.
Memory Footprint and Air-Gapped Degradation¶
Process-level RSS sampling and offline startup logs provide concrete sizing baselines:
| Operating State | orcad-server |
CLI Supervisor | daemon-entry |
Other (tini / PTYs / Server) |
Total RSS |
|---|---|---|---|---|---|
| Cold boot idle | 448.1 MiB |
109.9 MiB |
92.0 MiB |
0.9 MiB |
650.9 MiB |
| Post-recovery idle | 482.4 MiB |
111.7 MiB |
91.9 MiB |
9.3 MiB |
695.3 MiB |
6 PTYs + 1 Node server |
459.9 MiB |
111.9 MiB |
106.1 MiB |
104.3 MiB |
782.2 MiB |
- Even inside an air-gapped corporate cluster where GitHub
:443is unreachable,orcadsimply logsrelay offlineand skips rule downloads without blocking startup or any core RPC. - Under light worktree activity, the entire PVC data footprint is only
7.4 MB(primarily two SQLite WAL databases and terminal history); actual PVC sizing should follow your repository sizes and build caches (20–100 GiBrecommended). - For production single-user Pods, configure at least
requests.memory: 1Giandlimits.memory: 8Gi(raise the limit to16Giwhen running compilers, language servers, or multiple coding agent CLIs concurrently inside worktrees).
Four Kubernetes Pitfalls and Security Hardening¶
Dockerfile WORKDIR and fsGroup Directory Permission Trap¶
Symptom: On the initial rollout, creating a Git repository under /var/lib/orca/workspaces inside the non-root (UID 1000) server container failed immediately with Permission denied.
Root cause: Because Dockerfile declared WORKDIR /var/lib/orca/workspaces, containerd pre-created that directory on the freshly mounted empty LVM PVC as root:root 0755. Kubernetes fsGroup: 1000 only changed group ownership to root:orca 2755 without adding group-write bits, leaving UID 1000 unable to write or chown from a non-root initContainer.
Fix: Run a dedicated init-dirs initContainer (runAsUser: 0) to explicitly create and chown -R 1000:1000 all mounted subdirectories once, while keeping the main container strictly at runAsUser: 1000 and allowPrivilegeEscalation: false.
Overriding ENTRYPOINT Disables tini PID 1¶
Symptom: Setting command: ["orca-ide", "serve", ...] in the first manifest caused ps inside the Pod to show orca-ide instead of tini as PID 1.
Root cause: Kubernetes command: replaces the Dockerfile ENTRYPOINT ["/usr/bin/tini", "--"]. Because Orca spawns and tears down many short-lived PTY child processes, running without tini risks accumulating zombie processes over long uptimes and breaks clean SIGTERM propagation.
Fix: Pass startup flags via args: only so the image ENTRYPOINT stays intact; after the fix, tini remained PID 1 at just 0.9 MiB RSS.
Ephemeral HOME Drops Worktrees Across Pod Recreations¶
Symptom: After creating parallel worktrees, the primary repo lived at /var/lib/orca/workspaces/demo-service, whereas Orca placed managed worktrees under /var/lib/orca/orca/workspaces/demo-service/<name> (i.e., $HOME/orca/workspaces/<repo>/<name>).
Root cause: Mounting only ORCA_USER_DATA_PATH onto a PVC while leaving HOME on the ephemeral container root filesystem (such as /home/orca) means a Pod restart preserves SQLite worktree metadata while wiping every worktree checkout on disk.
Fix: Mount the PVC at /var/lib/orca and explicitly set both HOME=/var/lib/orca and ORCA_USER_DATA_PATH=/var/lib/orca/data so identity, databases, and managed worktrees share the same persistent volume.
Startup Log Token Leakage, PVC Keys, and Container Memory Limits¶
Hands-on testing also exposed three runtime behaviors that belong in every enterprise security baseline:
- Startup stdout token leak and
--no-pairinghardening: by default,orca-ide serveprints a livePairing URL: orca://pair?code=...containing an activedeviceTokendirectly to stdout, which centralized collectors like Loki or Elasticsearch will ingest. We verified that adding--no-pairingtoargs:achieves three things simultaneously: - Startup logs print only
Pairing unavailable: disabled_by_operatorwith zero token exposure; - Existing paired clients (
orca-client) keep connecting normally; - Operators can still issue fresh on-demand pairing codes with zero restart through RBAC-restricted
orca-ide pair --address ...viapods/exec. - At-rest credential key co-located on PVC: headless startup explicitly warns that sealed credentials and their unsealing key live together inside the private data directory, meaning any actor who can read the PVC or its snapshots can decrypt stored credentials. Enable storage-layer encryption at rest, lock down
pods/execand PVC RBAC, and govern volume snapshot access tightly. - No per-terminal systemd memory scopes in containers: startup logs report
Terminal process ceiling: off (disabled)because containers lack per-terminal systemd user scopes, disablingORCA_TERMINAL_MEMORY_MAXisolation per terminal. Enforce upper bounds via Podresources.limits.memoryandLimitRange, keeping in mind that one runaway build can OOM-kill the Pod (mitigated by sub-10 srecovery with preserved worktrees).
Suitable Scenarios and Selection Advice¶
Combining the architecture review with cluster measurements, we recommend the following adoption guidelines for enterprise Kubernetes platforms:
- Recommended pattern: provision one dedicated Pod plus one RWO PVC per developer as a persistent remote coding worktree host, accessed from local Orca Desktop / Mobile / CLI over private LAN, Tailscale, or
kubectl port-forward, offloading heavy builds, parallel worktrees, and long-running coding agents to cluster compute nodes. - External mobile access: avoid exposing
:6768directly via a public Ingress; prefer corporate VPN / Tailscale, or evaluate self-hosting the MIT-licensedcloud/apps/relayservice separately. - When headless browser automation is needed: if workflows depend on
browser.headless.v1, bake Chromium dependencies into your custom image, setORCA_BROWSER_EXECUTABLE, and raise Pod memory limits to8–16 GiB. - When not to use it: do not share one Orca Server Pod across multiple untrusted tenants or run untrusted external code inside it—any process granted a terminal inside the Pod can read the workspace and credential directory; use microVM- or strong-isolation-backed agent sandboxes for those workloads instead.
Architectural Takeaways for Building Your Own¶
For platform teams considering an in-house cloud coding-agent workbench, our source review and Kubernetes experiments distill into two actionable checklists.
Design Patterns Worth Adopting Directly¶
- Two-tier state decoupling (Server Owns State, Client Renders UI): sink repositories, worktrees, terminals, databases, and orchestration into a lean headless daemon while keeping clients stateless projections—enabling effortless multi-device viewing and reconnects.
- Split control plane from the PTY host daemon: separate the RPC control process from the terminal host (analogous to
orcad+daemon-entry) so upgrading or restarting the control plane never drops active terminal sessions. - Promote Git worktrees and port discovery to first-class primitives: modeling parallel work as
1 Worktree = 1 Branch = 1 PTY = 1 Port Scopeavoids shared-directory collisions while running one to two orders of magnitude faster than booting a full container per task. - Zero-broker SQLite WAL orchestration with idempotent writes: prove out
Run / Task DAG / Gate / Mailwith embedded storage first, and attach idempotency tokens like--retry-requestto every remote mutation so agent retries never duplicate side effects. - Separate terminal input from agent messaging plus capability negotiation: forbid typing into another agent's TTY to communicate (use structured mailboxes instead), and expose explicit
capabilitiesanddegradationsduring startup so clients degrade gracefully across versions and air-gapped networks.
Gaps to Address in an Enterprise In-House Build¶
- Add a native Web UI backed by enterprise SSO/OIDC: requiring every engineer on a corporate network to install a desktop app and manually run
port-forwardcreates adoption friction; drive both a browser Web UI and CLI from the same WebSocket RPC behind a unified OIDC gateway instead of static pairing codes. - Make the execution backend pluggable into strong sandboxes: keep Orca's lightweight control plane and worktree DAG ergonomics, while routing untrusted code, multi-tenant workloads, or high-risk commands to
CubeSandbox, Kata, or Firecracker backends. - Lower idle memory cost with a lighter runtime and scale-to-zero: a Node.js daemon idling at
~650 MiBmeans65 GiBof idle RAM for 100 always-on developer Pods; building the headless daemon in Go or Rust (tens of MiB idle) plus idle hibernation cuts cluster costs dramatically. - Decouple long-task recovery from container PID namespaces: because Kubernetes Pod deletion clears in-container PTYs, design agent sessions around structured event logs and Git checkpoints for lossless
resume, or offload long builds to dedicated sandbox Pods. - Externalize secrets and bake in enterprise observability: suppress all tokens from startup logs, integrate KMS / Vault for credential sealing, and instrument the RPC gateway with audit logs, OpenTelemetry traces, and token/compute cost attribution.
Summary¶
Through full containerization and cross-node verification of stablyai/orca v1.4.284, we established a lean, repeatable Kubernetes deployment recipe: a non-root debian:12-slim image anchored by tini, a single-replica StatefulSet + RWO PVC unifying HOME and ORCA_USER_DATA_PATH, and --refuse-public, --no-pairing, and ORCA_INSTANCE_ID closing off public ingress, log token leakage, and cloned-identity collisions. Within a 650–780 MiB resident memory envelope, one Pod reliably delivers cross-node E2EE orchestration, parallel Git worktrees, live PTY port discovery, and sub-10 s zero-re-pair recovery.