Merge pull request 'Switch BuildKit to privileged mode' (#9) from fix/buildkit-privileged into main
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
---
|
---
|
||||||
# BuildKit daemon — rootless image builder for CI runners.
|
# BuildKit daemon — privileged image builder for CI runners.
|
||||||
# Replaces the /var/run/docker.sock hostPath mount that gave containers
|
# Runs as root with privileged=true in the isolated ci namespace.
|
||||||
# full root access to the Legion host node.
|
# 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
|
# Runners connect via TCP: DOCKER_HOST=tcp://buildkitd.ci.svc.cluster.local:1234
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
@@ -23,9 +24,8 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: buildkitd
|
- name: buildkitd
|
||||||
image: moby/buildkit:v0.19.0-rootless
|
image: moby/buildkit:v0.19.0
|
||||||
args:
|
args:
|
||||||
- --oci-worker-no-process-sandbox
|
|
||||||
- --addr
|
- --addr
|
||||||
- tcp://0.0.0.0:1234
|
- tcp://0.0.0.0:1234
|
||||||
- --addr
|
- --addr
|
||||||
@@ -34,11 +34,7 @@ spec:
|
|||||||
- name: tcp
|
- name: tcp
|
||||||
containerPort: 1234
|
containerPort: 1234
|
||||||
securityContext:
|
securityContext:
|
||||||
seccompProfile:
|
privileged: true
|
||||||
type: Unconfined # BuildKit rootless requires this
|
|
||||||
runAsUser: 1000
|
|
||||||
runAsGroup: 1000
|
|
||||||
allowPrivilegeEscalation: true # required for newuidmap/newgidmap setuid binaries
|
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
exec:
|
exec:
|
||||||
command: ["buildctl", "debug", "workers"]
|
command: ["buildctl", "debug", "workers"]
|
||||||
@@ -53,7 +49,7 @@ spec:
|
|||||||
memory: 4Gi
|
memory: 4Gi
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: buildkit-storage
|
- name: buildkit-storage
|
||||||
mountPath: /home/user/.local/share/buildkit
|
mountPath: /var/lib/buildkit
|
||||||
volumes:
|
volumes:
|
||||||
- name: buildkit-storage
|
- name: buildkit-storage
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
|
|||||||
Reference in New Issue
Block a user