Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions deploy/dind-evaluation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Docker-in-Kubernetes evaluation

This directory holds a shared test suite and per-candidate results for
comparing ways to run Docker inside Kubernetes workspaces: Envbox, direct
Sysbox, native user namespaces, rootless Podman, Kata Containers, KubeVirt,
and others.

Every candidate runs the same suite, so results can be compared side by side.
This work re-tests the August 2026 spikes in
[`plat-370-experiments`](https://github.com/coder/envbox/tree/george/plat-370-eks-dind-experiment/deploy/plat-370-experiments)
on current versions and adds candidates that were not tested then.

## Running the suite

Run the suite from inside a workspace that uses the candidate runtime:

```sh
./run-suite.sh -o results/<candidate>-<cluster>
```

| Flag | Meaning |
|---|---|
| `-o DIR` | Where to write results. Defaults to `./results/<hostname>-<timestamp>`. |
| `-l N` | Highest use-case level to run, from 1 to 3. Defaults to 3. |
| `-k` | Also create a kind cluster in level 3. This is slow and pulls a large image. |
| `-c` | Keep running later levels after a level fails, to see everything that works. |

| Variable | Meaning |
|---|---|
| `ENGINE` | Container CLI to test. Defaults to `docker`. `podman` also works. |
| `ALPINE_IMAGE`, `NGINX_IMAGE` | Test images. Point them at a mirror for air-gapped clusters. |

The script needs `bash`, `curl`, and `python3`. It exits non-zero if any check
fails.

## What it checks

Use cases run in order. A level runs only if every earlier level passed,
unless `-c` is set.

| Level | Use case | Checks |
|---|---|---|
| 1 | Docker commands | Engine reachable, pull, run, outbound network, detached container, exec, published port, named volume persistence, memory and CPU limits enforced in the container's cgroup, nested container has its own network namespace |
| 2 | Image builds | Single-stage build, multi-stage build, run the built image, Buildx available |
| 3 | Compose and nested tools | Compose with service-name networking, kind cluster (with `-k`) |

## Output

Each run writes two files:

- `results.jsonl`: one line per check with the level, check name, `pass` or
`fail`, duration in seconds, and the last lines of output for failures.
- `security-shape.txt`: what the workspace looks like from inside:
- user ID and capabilities;
- seccomp status;
- user namespace mapping;
- cgroup mode;
- which devices exist (`/dev/kvm`, `/dev/fuse`, `/dev/net/tun`,
`/dev/kmsg`);
- engine version and security options.

The suite can't see the node side of the security shape: privileged pods,
node runtime installs, cluster operators, and instance-type requirements. Each
candidate's `findings.md` must record those by hand.

## Results

| Candidate | Cluster | Levels passed | Findings |
|---|---|---|---|
| Kata Containers | dogfood EKS (`coder-kata`) | 1 to 3, 17 of 17 (kind needs a `/dev/kmsg` workaround) | [findings](results/kata-dogfood-eks/findings.md) |
| Rootless Podman | dogfood EKS (`podman-rootless`) | 2 only. 12 of 17: no limits, no network isolation, no Compose or kind | [findings](results/podman-rootless-dogfood-eks/findings.md) |
79 changes: 79 additions & 0 deletions deploy/dind-evaluation/results/kata-dogfood-eks/findings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Kata Containers on dogfood EKS

- **Run date:** 2026-12-04
- **Workspace:** dogfood `coder-kata` template (Kata VM on the dogfood-cdr EKS
cluster)
- **Command:** `./run-suite.sh -k -o results/kata-dogfood-eks`
- **Raw output:** [`results.jsonl`](results.jsonl),
[`security-shape.txt`](security-shape.txt)

## Result

All 17 checks passed, covering use-case levels 1 to 3, including creating a
kind cluster. Memory and CPU limits are enforced in each nested container's
cgroup, and every nested container gets its own network namespace.

| Level | Checks | Slowest check |
|---|---|---|
| 1. Docker commands | 11 of 11 passed | named volume, 1.2 s |
| 2. Image builds | 4 of 4 passed | about 0.5 s each |
| 3. Compose and kind | 2 of 2 passed | kind cluster: 31.3 s |

These durations are for operations inside an already-running workspace. They
are **not** workspace startup time, which still needs measuring (see "Not
measured yet").

## Security shape (inside the workspace)

From [`security-shape.txt`](security-shape.txt):

- The workspace user is uid 1000 and has no effective capabilities, but has
passwordless `sudo` to root with full capabilities. This is inside the VM
guest, so the VM stays the boundary.
- `dockerd` runs as root, with full capabilities, inside the Kata VM guest.
The isolation boundary is the VM, not the container.
- No user namespace is used inside the guest (identity mapping).
- No seccomp filter on the workspace process.
- cgroup v2 is read-only for the workspace user.
- No `/dev/kvm`, `/dev/fuse`, `/dev/net/tun`, or `/dev/kmsg` in the guest.
- Docker Engine 27.5.1, containerd 1.7.23, runc 1.1.14, overlay2 storage.

## Workarounds needed

- **kind needs `/dev/kmsg`.** The guest has no `/dev/kmsg`, so kubelet exits
with `open /dev/kmsg: no such file or directory`. Mounting `/dev/null` at
`/dev/kmsg` in the kind node fixes it. The suite applies this
automatically and records the check as `kind-create-cluster-kmsg-workaround`.

## Node side (not visible from inside, still to confirm)

TODO: confirm with the dogfood infra team.

- Which instance types the Kata node group uses: bare metal or
nested-virtualization capable.
- How the Kata runtime is installed on the nodes (for example kata-deploy
DaemonSet, custom AMI) and the `RuntimeClass` it registers.
- Whether the workspace pod itself is privileged or needs Pod Security
exceptions.
- Kata and guest kernel versions.

## Related dogfood history

[DOG-65](https://linear.app/codercom/issue/DOG-65/scale-dogfood-horizontally-by-moving-templates-to-kubernetes)
moved dogfood development to `coder-kata`. It records:

- a cgroup and Postgres failure that has since been fixed, with Docker memory
limits kept;
- prebuilds that work across clusters;
- an open question on whether network policies work inside Kata, for
`coder-workflow-bot`.

## Not measured yet

- Workspace startup time (create to agent Ready) as p50 and p95, compared
with a plain pod workspace on the same cluster.
- GKE.
- Air-gapped installation.
- Nested virtualization inside the guest. There is no `/dev/kvm`, even though
the CPU advertises `vmx`, so KubeVirt and Firecracker can't run nested
inside a Kata workspace as configured.
17 changes: 17 additions & 0 deletions deploy/dind-evaluation/results/kata-dogfood-eks/results.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{"level":1,"check":"engine-reachable","status":"pass","seconds":0.14,"detail":""}
{"level":1,"check":"pull-image","status":"pass","seconds":0.49,"detail":""}
{"level":1,"check":"run-container","status":"pass","seconds":0.58,"detail":""}
{"level":1,"check":"outbound-network","status":"pass","seconds":0.56,"detail":""}
{"level":1,"check":"run-detached","status":"pass","seconds":0.44,"detail":""}
{"level":1,"check":"exec-into-container","status":"pass","seconds":0.12,"detail":""}
{"level":1,"check":"published-port","status":"pass","seconds":0.10,"detail":""}
{"level":1,"check":"named-volume-persists","status":"pass","seconds":1.15,"detail":""}
{"level":1,"check":"memory-limit-enforced","status":"pass","seconds":0.59,"detail":""}
{"level":1,"check":"cpu-limit-enforced","status":"pass","seconds":0.55,"detail":""}
{"level":1,"check":"network-namespace-isolated","status":"pass","seconds":0.57,"detail":""}
{"level":2,"check":"build-image","status":"pass","seconds":0.48,"detail":""}
{"level":2,"check":"multi-stage-build","status":"pass","seconds":0.44,"detail":""}
{"level":2,"check":"run-built-image","status":"pass","seconds":0.54,"detail":""}
{"level":2,"check":"buildx-available","status":"pass","seconds":0.19,"detail":""}
{"level":3,"check":"compose-service-networking","status":"pass","seconds":1.65,"detail":""}
{"level":3,"check":"kind-create-cluster-kmsg-workaround","status":"pass","seconds":31.25,"detail":""}
63 changes: 63 additions & 0 deletions deploy/dind-evaluation/results/kata-dogfood-eks/security-shape.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
## identity
uid=1000 gid=1000 user=coder
passwordless sudo: yes
root capabilities via sudo: CapEff: 000001ffffffffff
## process status
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: 000001ffffffffff
CapAmb: 0000000000000000
NoNewPrivs: 0
Seccomp: 0
Seccomp_filters: 0
## user namespace (identity map means none)
0 0 4294967295
## kernel and virtualization
Linux 6.18.35 x86_64
docker
## cgroups
cgroupfs type: cgroup2fs
/sys/fs/cgroup read-only
## devices
/dev/kvm absent
/dev/fuse absent
/dev/net/tun absent
/dev/kmsg absent
## engine
Client: Docker Engine - Community
Version: 27.5.1
API version: 1.47
Go version: go1.22.11
Git commit: 9f9e405
Built: Wed Jan 22 13:41:31 2025
OS/Arch: linux/amd64
Context: default

Server: Docker Engine - Community
Engine:
Version: 27.5.1
API version: 1.47 (minimum version 1.24)
Go version: go1.22.11
Git commit: 4c9b3b0
Built: Wed Jan 22 13:41:31 2025
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.23
GitCommit: 57f17b0a6295a39009d861b89e3b3b87b005ca27
runc:
Version: 1.1.14
GitCommit: v1.1.14-0-g2c9f560
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Server Version: 27.5.1
Storage Driver: overlay2
Cgroup Driver: cgroupfs
Cgroup Version: 2
Runtimes: runc io.containerd.runc.v2
Default Runtime: runc
Security Options:
seccomp
cgroupns
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{"level":1,"check":"engine-reachable","status":"pass","seconds":0.10,"detail":""}
{"level":1,"check":"pull-image","status":"pass","seconds":2.52,"detail":""}
{"level":1,"check":"run-container","status":"pass","seconds":0.12,"detail":""}
{"level":1,"check":"outbound-network","status":"pass","seconds":0.36,"detail":""}
{"level":1,"check":"run-detached","status":"pass","seconds":0.08,"detail":""}
{"level":1,"check":"exec-into-container","status":"pass","seconds":0.07,"detail":""}
{"level":1,"check":"published-port","status":"pass","seconds":0.02,"detail":""}
{"level":1,"check":"named-volume-persists","status":"pass","seconds":0.25,"detail":""}
{"level":1,"check":"memory-limit-enforced","status":"fail","seconds":0.12,"detail":"memory limit seen in container: 8589934592 (want 33554432)"}
{"level":1,"check":"cpu-limit-enforced","status":"fail","seconds":0.12,"detail":"cpu limit seen in container: 400000 100000 (want a 50% quota)"}
{"level":1,"check":"network-namespace-isolated","status":"fail","seconds":0.12,"detail":"workspace netns net:[4026533416], container netns net:[4026533416]"}
{"level":2,"check":"build-image","status":"pass","seconds":0.29,"detail":""}
{"level":2,"check":"multi-stage-build","status":"pass","seconds":4.57,"detail":""}
{"level":2,"check":"run-built-image","status":"pass","seconds":0.13,"detail":""}
{"level":2,"check":"buildx-available","status":"pass","seconds":0.04,"detail":""}
{"level":3,"check":"compose-service-networking","status":"fail","seconds":0.24,"detail":"Attaching to client-1, web-1\n Container dindeval-2653-26257-web-1 Starting \n Container dindeval-2653-26257-web-1 Error response from daemon: setting up Pasta: could not find pasta, the network namespace can't be configured: exec: \"pasta\": executable file not found in $PATH \n Container dindeval-2653-26257-client-1 not started: interrupted by the failure of Container dindeval-2653-26257-web-1 \nError response from daemon: setting up Pasta: could not find pasta, the network namespace can't be configured: exec: \"pasta\": executable file not found in $PATH"}
{"level":3,"check":"kind-create-cluster-kmsg-workaround","status":"fail","seconds":0.11,"detail":"ERROR: failed to create cluster: running kind with rootless provider requires setting systemd property \"Delegate=yes\", see https://kind.sigs.k8s.io/docs/user/rootless/"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
## identity
uid=1000 gid=1000 user=coder
passwordless sudo: yes
root capabilities via sudo: CapEff: 00000000a80425fb
## process status
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: 00000000a80425fb
CapAmb: 0000000000000000
NoNewPrivs: 0
Seccomp: 0
Seccomp_filters: 0
## user namespace (identity map means none)
0 0 4294967295
## kernel and virtualization
Linux 6.18.56-125.164.amzn2023.x86_64 x86_64
docker
## cgroups
cgroupfs type: cgroup2fs
/sys/fs/cgroup read-only
## devices
/dev/kvm absent
/dev/fuse absent
/dev/net/tun absent
/dev/kmsg absent
## engine
Client: Docker Engine - Community
Version: 29.9.3
API version: 1.41 (downgraded from 1.56)
Go version: go1.26.10
Git commit: 5457199
Built: Tue Nov 3 21:42:07 2026
OS/Arch: linux/amd64
Context: default

Server: linux/amd64/ubuntu-26.04
Podman Engine:
Version: 5.7.0
APIVersion: 5.7.0
Arch: amd64
BuildTime: 2026-02-23T15:35:32Z
Experimental: false
GitCommit:
GoVersion: go1.25.0
KernelVersion: 6.18.56-125.164.amzn2023.x86_64
MinAPIVersion: 4.0.0
Os: linux
Conmon:
Version: conmon version 2.1.13, commit: unknown
Package: conmon_2.1.13+ds1-2_amd64
OCI Runtime (crun):
Version: crun version 1.21
commit: 10269840aa07fb7e6b7e1acff6198692d8ff5c88
rundir: /tmp/storage-run-1000/crun
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +WASM:wasmedge +YAJL
Package: crun_1.21-1ubuntu3_amd64
Engine:
Version: 5.7.0
API version: 1.41 (minimum version 1.24)
Go version:
Git commit:
Built:
OS/Arch: linux/amd64
Experimental:
Server Version: 5.7.0
Storage Driver: overlay
Cgroup Driver: cgroupfs
Cgroup Version: 2
Runtimes: runc runj runsc youki crun crun-vm crun-wasm kata krun ocijail
Default Runtime: crun
Security Options:
seccomp
rootless
Loading
Loading