summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMatt Heon <mheon@redhat.com>2024-04-17 08:23:38 -0400
committerMatt Heon <mheon@redhat.com>2024-04-25 14:12:27 -0400
commit30e2c923d6f0b7e9fc46e353288804e3fbbbad67 (patch)
tree4b3d6ea9c1bccbac156a185a293c2b41739244b6 /docs
parent693ae0ebc60d648b870eb25c6d2fb155c280da61 (diff)
Add the ability to automount images as volumes via play
Effectively, this is an ability to take an image already pulled to the system, and automatically mount it into one or more containers defined in Kubernetes YAML accepted by `podman play`. Requirements: - The image must already exist in storage. - The image must have at least 1 volume directive. - The path given by the volume directive will be mounted from the image into the container. For example, an image with a volume at `/test/test_dir` will have `/test/test_dir` in the image mounted to `/test/test_dir` in the container. - Multiple images can be specified. If multiple images have a volume at a specific path, the last image specified trumps. - The images are always mounted read-only. - Images to mount are defined in the annotation "io.podman.annotations.kube.image.automount/$ctrname" as a semicolon-separated list. They are mounted into a single container in the pod, not the whole pod. As we're using a nonstandard annotation, this is Podman only, any Kubernetes install will just ignore this. Underneath, this compiles down to an image volume (`podman run --mount type=image,...`) with subpaths to specify what bits we want to mount into the container. Signed-off-by: Matt Heon <mheon@redhat.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/source/markdown/podman-kube-play.1.md.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/source/markdown/podman-kube-play.1.md.in b/docs/source/markdown/podman-kube-play.1.md.in
index ea2ebf4a0..21a929a13 100644
--- a/docs/source/markdown/podman-kube-play.1.md.in
+++ b/docs/source/markdown/podman-kube-play.1.md.in
@@ -158,6 +158,17 @@ spec:
and as a result environment variable `FOO` is set to `bar` for container `container-1`.
+`Automounting Volumes`
+
+An image can be automatically mounted into a container if the annotation `io.podman.annotations.kube.image.automount/$ctrname` is given. The following rules apply:
+
+- The image must already exist locally.
+- The image must have at least 1 volume directive.
+- The path given by the volume directive will be mounted from the image into the container. For example, an image with a volume at `/test/test_dir` will have `/test/test_dir` in the image mounted to `/test/test_dir` in the container.
+- Multiple images can be specified. If multiple images have a volume at a specific path, the last image specified trumps.
+- The images are always mounted read-only.
+- Images to mount are defined in the annotation "io.podman.annotations.kube.image.automount/$ctrname" as a semicolon-separated list. They are mounted into a single container in the pod, not the whole pod. The annotation can be specified for additional containers if additional mounts are required.
+
## OPTIONS
@@option annotation.container