@@ -543,6 +543,68 @@ spec:
543
543
type: FileOrCreate
544
544
` ` `
545
545
546
+ # ## image
547
+
548
+ {{< feature-state feature_gate_name="ImageVolume" >}}
549
+
550
+ An `image` volume source represents an OCI object (a container image or
551
+ artifact) pulled and mounted on the kubelet's host machine.
552
+
553
+ One example to use the `image` volume source is :
554
+
555
+ {{% code_sample file="pods/image-volumes.yaml" %}}
556
+
557
+ The volume is resolved at pod startup depending on which `pullPolicy` value is
558
+ provided :
559
+
560
+ - `Always` : the kubelet always attempts to pull the reference. Container
561
+ creation will fail if the pull fails.
562
+ - `Never` : the kubelet never pulls the reference and only uses a local image or
563
+ artifact. Container creation will fail if the reference isn't present.
564
+ - `IfNotPresent` : the kubelet pulls if the reference isn't already present on
565
+ disk. Container creation will fail if the reference isn't present and the pull
566
+ fails.
567
+
568
+ The volume gets re-resolved if the pod gets deleted and recreated, which means
569
+ that new remote content will become available on pod recreation. A failure to
570
+ resolve or pull the image during pod startup will block containers from starting
571
+ and may add significant latency. Failures will be retried using normal volume
572
+ backoff and will be reported on the pod reason and message.
573
+
574
+ The types of objects that may be mounted by this volume are defined by the
575
+ container runtime implementation on a host machine and at minimum must include
576
+ all valid types supported by the container image field. The OCI object gets
577
+ mounted in a single directory (`spec.containers[*].volumeMounts.mountPath`) by
578
+ merging the manifest layers in the same way as for container images. The volume
579
+ will be mounted read-only (`ro`) and non-executable files (`noexec`).
580
+
581
+ Beside that :
582
+ - Sub path mounts for containers are not supported
583
+ (`spec.containers[*].volumeMounts.subpath`).
584
+ - The field `spec.securityContext.fsGroupChangePolicy` has no effect on this
585
+ volume type.
586
+ - The [`AlwaysPullImages` Admission Controller](/docs/reference/access-authn-authz/admission-controllers/#alwayspullimages)
587
+ does also work for this volume source like for container images.
588
+
589
+ The following fields are available for the `image` type :
590
+
591
+ - `reference` : Image or artifact reference to be used.
592
+ Behaves in the same way as `pod.spec.containers[*].image`.
593
+ Pull secrets will be assembled in the same way as for the container image by
594
+ looking up node credentials, service account image pull secrets, and pod
595
+ spec image pull secrets. This field is optional to allow higher level config
596
+ management to default or override container images in workload controllers
597
+ like Deployments and StatefulSets.
598
+
599
+ [More info about container images](/docs/concepts/containers/images)
600
+
601
+ - `pullPolicy` : Policy for pulling OCI objects. Possible values are: `Always`,
602
+ ` Never` or `IfNotPresent`. Defaults to `Always` if `:latest` tag is
603
+ specified, or `IfNotPresent` otherwise.
604
+
605
+ See the [_Use an Image Volume With a Pod_](/docs/tasks/configure-pod-container/image-volumes)
606
+ example for more details on how to use the volume source.
607
+
546
608
# ## iscsi
547
609
548
610
An `iscsi` volume allows an existing iSCSI (SCSI over IP) volume to be mounted
0 commit comments