Skip to content

Commit 1a3d899

Browse files
authored
Merge pull request #102039 from mburke5678/nodes-remove-oci-artifact-mount
OCSDOCS 17279 Remove references to artifacts from Mounting an OCI image into a pod docs
2 parents d2df268 + 7003dbf commit 1a3d899

File tree

3 files changed

+68
-16
lines changed

3 files changed

+68
-16
lines changed

modules/nodes-pods-image-volume-about.adoc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
[id="nodes-pods-image-volume-about_{context}"]
77
= Understanding image volumes
88

9+
// Hiding artifacts in 4.20; artifacts to go TP in 4.21
10+
////
911
You can you use an _image volume_ to mount an Open Container Initiative (OCI)-compliant container image or artifact directly into a pod, making the files within the image accessible to the containers without the need to include them in the base image. This means you can host the data in an OCI-compliant registry.
12+
////
13+
14+
You can use an _image volume_ to mount an Open Container Initiative (OCI)-compliant container image directly into a pod, making the files within the image accessible to the containers without the need to include them in the base image. This means you can host the data in an OCI-compliant registry.
1015

1116
By using an image volume in a pod, you can take advantage of the OCI image and distribution specification standards to accomplish several tasks including the following use cases:
1217

@@ -15,8 +20,14 @@ By using an image volume in a pod, you can take advantage of the OCI image and d
1520
1621
* In an artificial intelligence environment, you can use image volumes to mount large language model weights or machine learning model weights in a pod alongside a model-server. You can efficiently serve model weights this way without including them in the model-server container image. Therefore, you can separate the model specifications and content from the executables that process them.
1722
18-
* You can package and distribute binary artifacts and mount them directly into your pods, allowing you to streamline your CI/CD pipeline. This allows you to maintain a small set of base images by attaching the CI/CD artifacts to the image volumes instead.
19-
2023
* You can use a public image for a malware scanner and mount it in a volume of private malware signatures, so that you can load those signatures without incorporating the image into a base image, which might not be allowed by the copyright on the public image.
2124
25+
////
26+
* You can package and distribute binary artifacts and mount them directly into your pods, allowing you to streamline your CI/CD pipeline. This allows you to maintain a small set of base images by attaching the CI/CD artifacts to the image volumes instead.
27+
////
28+
29+
////
2230
To mount an image volume, include a path to the image or artifact in your pod spec with an optional pull policy as described in _Adding an image volume to a pod_.
31+
////
32+
33+
To mount an image volume, include a path to the image in your pod spec with an optional pull policy as described in _Adding an image volume to a pod_.

modules/nodes-pods-image-volume-adding.adoc

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
[id="nodes-pods-image-volume-adding_{context}"]
77
= Adding an image volume to a pod
88

9+
//Hiding artifacts in 4.20; artifacts to go TP in 4.21
10+
////
911
To mount an Open Container Initiative (OCI)-compliant container image or artifact, use the `volume` parameter to include a path to the image or artifact in your pod spec with an optional pull policy. You can create the pod directly or use a controlling object, such as a deployment or replica set.
12+
////
13+
14+
To mount an Open Container Initiative (OCI)-compliant container image, use the `volume` parameter to include a path to the image in your pod spec with an optional pull policy. You can create the pod directly or use a controlling object, such as a deployment or replica set.
1015

1116
.Procedure
1217

@@ -29,18 +34,15 @@ spec:
2934
volumes:
3035
- name: volume
3136
image: <1>
32-
reference: quay.io/crio/artifact:v2 <2>
37+
reference: quay.io/crio/image:v2 <2>
3338
pullPolicy: Always <3>
3439
----
35-
<1> Specifies an OCI container image or artifact that is available on the host machine.
36-
<2> Specifies the path to the image or artifact.
40+
<1> Specifies an OCI container image that is available on the host machine.
41+
<2> Specifies the path to the image.
3742
<3> Specifies a pull policy, one of the following options:
38-
+
39-
--
4043
* If `Always`, the kubelet always attempts to pull the image. If the pull fails, the kubelet sets the pod to `Failed`.
41-
* If `Never`, the kubelet never pulls the image and only uses a local image or artifact. The pod becomes `Failed` if any layers of the image are not present locally, or if the manifest for that image is not already cached.
42-
* If `IfNotPresent` the kubelet pulls the image if it not present. The pod becomes `Failed` if the image is not present and the pull fails. This is the default.
43-
--
44+
* If `Never`, the kubelet never pulls the image and only uses a local image. The pod becomes `Failed` if any layers of the image are not present locally, or if the manifest for that image is not already cached.
45+
* If `IfNotPresent` the kubelet pulls the image if it is not present. The pod becomes `Failed` if the image is not present and the pull fails. This is the default.
4446
// Pull policy details from upstream: https://kubernetes.io/docs/concepts/storage/volumes/#image
4547

4648
. Create the pod by running the following command:
@@ -50,6 +52,41 @@ spec:
5052
$ oc create -f <file_name>.yaml
5153
----
5254

55+
////
56+
. Create a YAML file similar to the following.
57+
+
58+
[source,yaml]
59+
----
60+
apiVersion: v1
61+
kind: Pod
62+
metadata:
63+
name: image-volume
64+
spec:
65+
containers:
66+
- name: shell
67+
command: ["sleep", "infinity"]
68+
image: debian
69+
volumeMounts:
70+
- name: volume
71+
mountPath: /volume
72+
volumes:
73+
- name: volume
74+
image: <1>
75+
reference: quay.io/crio/image:v2 <2>
76+
pullPolicy: Always <3>
77+
----
78+
<1> Specifies an OCI container image or artifact that is available on the host machine.
79+
<2> Specifies the path to the image or artifact.
80+
<3> Specifies a pull policy, one of the following options:
81+
--
82+
+
83+
* If `Always`, the kubelet always attempts to pull the image. If the pull fails, the kubelet sets the pod to `Failed`.
84+
* If `Never`, the kubelet never pulls the image and only uses a local image or artifact. The pod becomes `Failed` if any layers of the image are not present locally, or if the manifest for that image is not already cached.
85+
* If `IfNotPresent` the kubelet pulls the image if it is not present. The pod becomes `Failed` if the image is not present and the pull fails. This is the default.
86+
--
87+
// Pull policy details from upstream: https://kubernetes.io/docs/concepts/storage/volumes/#image
88+
////
89+
5390
.Verification
5491

5592
* Examine the pod to view detailed information about the image pull and mount by using a command similar to the following:
@@ -67,17 +104,17 @@ Namespace: default
67104
# ...
68105
Volumes:
69106
volume: <1>
70-
Type: Image (a container image or OCI artifact)
71-
Reference: quay.io/crio/artifact:v2
107+
Type: Image
108+
Reference: quay.io/crio/image:v2
72109
PullPolicy: IfNotPresent
73110
# ...
74111
Events:
75112
Type Reason Age From Message
76113
---- ------ ---- ---- -------
77114
# ...
78-
Normal Pulling 46s kubelet Pulling image "quay.io/crio/artifact:v2"
79-
Normal Pulled 44s kubelet Successfully pulled image "quay.io/crio/artifact:v2" in 2.261s (2.261s including waiting). Image size: 6707 bytes. <2>
115+
Normal Pulling 46s kubelet Pulling image "quay.io/crio/image:v2"
116+
Normal Pulled 44s kubelet Successfully pulled image "quay.io/crio/image:v2" in 2.261s (2.261s including waiting). Image size: 6707 bytes. <2>
80117
# ...
81118
----
82-
<1> Indicates that the image volume was mounted to the pod.
119+
<1> Indicates that the image was mounted to the pod.
83120
<2> Indicates that the image was successfully pulled.

nodes/pods/nodes-pods-image-volume.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9-
9+
// Hiding artifacts in 4.20; artifacts to go TP in 4.21
10+
////
1011
You can mount an Open Container Initiative (OCI)-compliant container image or artifact directly into a pod, making the files within the image accessible to the containers without the need to include them in the base image, which allows you to host the data in OCI-compliant registries.
12+
////
13+
14+
You can mount an Open Container Initiative (OCI)-compliant container image directly into a pod, making the files within the image accessible to the containers without the need to include them in the base image, which allows you to host the data in OCI-compliant registries.
1115

1216
// The following include statements pull in the module files that comprise
1317
// the assembly. Include any combination of concept, procedure, or reference

0 commit comments

Comments
 (0)