Switch BuildKit to privileged mode — rootless fails on k3s mount propagation

This commit is contained in:
Will Anderson
2026-04-26 01:20:45 -05:00
parent c6d42948ff
commit 6e67f62ffe
+7 -11
View File
@@ -1,7 +1,8 @@
---
# BuildKit daemon — rootless image builder for CI runners.
# Replaces the /var/run/docker.sock hostPath mount that gave containers
# full root access to the Legion host node.
# BuildKit daemon — privileged image builder for CI runners.
# Runs as root with privileged=true in the isolated ci namespace.
# Rootless mode (moby/buildkit:*-rootless) fails on k3s/containerd because
# rootlesskit cannot share mount propagation on the container root fs.
#
# Runners connect via TCP: DOCKER_HOST=tcp://buildkitd.ci.svc.cluster.local:1234
apiVersion: apps/v1
@@ -23,9 +24,8 @@ spec:
spec:
containers:
- name: buildkitd
image: moby/buildkit:v0.19.0-rootless
image: moby/buildkit:v0.19.0
args:
- --oci-worker-no-process-sandbox
- --addr
- tcp://0.0.0.0:1234
- --addr
@@ -34,11 +34,7 @@ spec:
- name: tcp
containerPort: 1234
securityContext:
seccompProfile:
type: Unconfined # BuildKit rootless requires this
runAsUser: 1000
runAsGroup: 1000
allowPrivilegeEscalation: true # required for newuidmap/newgidmap setuid binaries
privileged: true
readinessProbe:
exec:
command: ["buildctl", "debug", "workers"]
@@ -53,7 +49,7 @@ spec:
memory: 4Gi
volumeMounts:
- name: buildkit-storage
mountPath: /home/user/.local/share/buildkit
mountPath: /var/lib/buildkit
volumes:
- name: buildkit-storage
emptyDir: {}