Skip to content

Commit 376259e

Browse files
authored
Merge pull request #71401 from DCChadwick/osdocs9297
OSDOCS9297: Using /dev/fuse to access faster builds
2 parents cb616e9 + 8dca89b commit 376259e

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2508,6 +2508,8 @@ Topics:
25082508
File: nodes-containers-port-forwarding
25092509
- Name: Using sysctls in containers
25102510
File: nodes-containers-sysctls
2511+
- Name: Accessing faster builds with /dev/fuse
2512+
File: nodes-containers-dev-fuse
25112513
- Name: Working with clusters
25122514
Dir: clusters
25132515
Topics:
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * nodes/nodes-containers-dev-fuse.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="nodes-containers-dev-fuse-configuring_{context}"]
7+
= Configuring /dev/fuse on unprivileged pods
8+
9+
As an alternative to the virtual filesystem, you can configure the `/dev/fuse` device to the `io.kubernetes.cri-o.Devices` annotation to access faster builds within unprivileged pods. Using `/dev/fuse` is secure, efficient, and scalable, and allows unprivileged users to mount an overlay filesystem as if the unprivileged pod was privileged.
10+
11+
.Procedure
12+
13+
. Create the pod.
14+
+
15+
[source,terminal]
16+
----
17+
$ oc exec -ti no-priv -- /bin/bash
18+
----
19+
+
20+
[source,terminal]
21+
----
22+
$ cat >> Dockerfile <<EOF
23+
FROM registry.access.redhat.com/ubi9
24+
EOF
25+
----
26+
+
27+
[source,terminal]
28+
----
29+
$ podman build .
30+
----
31+
32+
. Implement `/dev/fuse` by adding the `/dev/fuse` device to the `io.kubernetes.cri-o.Devices` annotation.
33+
+
34+
[source,yaml]
35+
----
36+
io.kubernetes.cri-o.Devices: "/dev/fuse"
37+
----
38+
+
39+
For example:
40+
+
41+
[source,yaml]
42+
----
43+
apiVersion: v1
44+
kind: Pod
45+
metadata:
46+
  name: podman-pod
47+
  annotations:
48+
    io.kubernetes.cri-o.Devices: "/dev/fuse"
49+
----
50+
51+
. Configure the `/dev/fuse` device in your pod specifications.
52+
+
53+
[source,yaml]
54+
----
55+
spec:
56+
  containers:
57+
  - name: podman-container
58+
    image: quay.io/podman/stable
59+
    args:
60+
    - sleep
61+
    - "1000000"
62+
    securityContext:
63+
      runAsUser: 1000
64+
----
65+
66+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
:context: nodes-containers-dev-fuse
3+
[id="nodes-containers-dev-fuse"]
4+
= Accessing faster builds with /dev/fuse
5+
include::_attributes/common-attributes.adoc[]
6+
7+
toc::[]
8+
9+
You can configure your pods with the `/dev/fuse` device to access faster builds.
10+
11+
include::modules/nodes-containers-dev-fuse-configuring.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)