Skip to content

Commit c67176a

Browse files
committed
rootless: guide for Bottlerocket OS (sysctl -w user.max_user_namespaces=N)
Signed-off-by: Akihiro Suda <[email protected]>
1 parent 2fed51a commit c67176a

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

docs/rootless.md

+11
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ spec:
2424
2525
See also the [example manifests](#Kubernetes).
2626
27+
### Bottlerocket OS
28+
29+
Needs to run `sysctl -w user.max_user_namespaces=N` (N=positive integer, like 63359) on the host nodes.
30+
31+
See [`../examples/kubernetes/sysctl-userns.privileged.yaml`](../examples/kubernetes/sysctl-userns.privileged.yaml).
32+
2733
<details>
2834
<summary>Old distributions</summary>
2935

@@ -104,6 +110,11 @@ See https://rootlesscontaine.rs/getting-started/common/subuid/
104110
### Error `Options:[rbind ro]}]: operation not permitted`
105111
Make sure to mount an `emptyDir` volume on `/home/user/.local/share/buildkit` .
106112

113+
### Error `fork/exec /proc/self/exe: no space left on device` with `level=warning msg="/proc/sys/user/max_user_namespaces needs to be set to non-zero."`
114+
Run `sysctl -w user.max_user_namespaces=N` (N=positive integer, like 63359) on the host nodes.
115+
116+
See [`../examples/kubernetes/sysctl-userns.privileged.yaml`](../examples/kubernetes/sysctl-userns.privileged.yaml).
117+
107118
## Containerized deployment
108119

109120
### Kubernetes
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Run `sysctl -w user.max_user_namespaces=63359` on all the nodes,
2+
# for errors like "/proc/sys/user/max_user_namespaces needs to be set to non-zero"
3+
# on running rootless buildkitd pods.
4+
#
5+
# This workaround is known to be needed on Bottlerocket OS.
6+
apiVersion: apps/v1
7+
kind: DaemonSet
8+
metadata:
9+
labels:
10+
app: sysctl-userns
11+
name: sysctl-userns
12+
spec:
13+
selector:
14+
matchLabels:
15+
app: sysctl-userns
16+
template:
17+
metadata:
18+
labels:
19+
app: sysctl-userns
20+
spec:
21+
containers:
22+
- name: sysctl-userns
23+
image: busybox
24+
command: ["sh", "-euxc", "sysctl -w user.max_user_namespaces=63359 && sleep infinity"]
25+
securityContext:
26+
privileged: true

0 commit comments

Comments
 (0)