Deploying
Rootless BuildKit
on Kubernetes
About me
●
●
●
What is Rootless?
●
●
What is Rootless?
●
What is Rootless?
https://tinyurl.com/dockercon2019-rootless
In-cluster build
●
●
In-cluster build
●
In-cluster build
● securityContext.privileged
docker run --privileged
docker:dind
● hostPath
/var/run/docker.sock buildkitd.sock
myth 1: requires securityContext.privileged
●
●
--oci-worker-no-process-sandbox
○ /proc
myth 1: requires securityContext.privileged
RUN gcc
Process sandbox
myth 1: requires securityContext.privileged
--oci-worker-no-process-sandbox
RUN gcc
worker container can kill(2) the daemon
Host is still protected
Process sandbox
myth 1: requires securityContext.privileged
●
securityContext.procMount
Unmasked
○
myth 2: seccomp and AppArmor
need to be disabled
myth 2: seccomp and AppArmor
need to be disabled
●
●
○
myth 2: seccomp and AppArmor
need to be disabled
RUN gcc
seccomp
myth 2: seccomp and AppArmor
need to be disabled
RUN gcc
worker containers are still protected with seccompseccomp
Future work: gVisor integration?
●
●
●
Future work: gVisor integration?
● EINVAL
●
○
○
Comparison: Kaniko
●
●
○
●
myth 3: No OverlayFS support
●
○
●
myth 3: No OverlayFS support
●
/home/user/.local/share/buildkit
○ mkfs.xfs -m reflink=1
○
kubectl run & buildctl
docker buildx
Knative template is also available
●
●
Knative template is also available
If you don’t like daemon..
●
●
○
Questions?

DCSF 19 Deploying Rootless buildkit on Kubernetes