Volume

Volume represents a named volume in a pod that may be accessed by any container in the pod.

import "k8s.io/api/core/v1"

Volume

Volume represents a named volume in a pod that may be accessed by any container in the pod.


  • name (string), required

    Volume's name. Must be a DNS_LABEL and unique within the pod. More info:

Exposed Persistent volumes

Projections

Local / Temporary Directory

Persistent volumes

Alpha level

  • ephemeral (EphemeralVolumeSource)

    Ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.

    Use this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity tracking are needed, c) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through a PersistentVolumeClaim (see EphemeralVolumeSource for more information on the connection between this volume type and PersistentVolumeClaim).

    Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.

    Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.

    A pod can use both types of ephemeral volumes and persistent volumes at the same time.

    Represents an ephemeral volume that is handled by a normal storage driver.

Deprecated

DownwardAPIVolumeFile

DownwardAPIVolumeFile represents information to create the file containing the pod field


KeyToPath

Maps a string key to a path within a volume.


  • key (string), required

    The key to project.

  • path (string), required

    The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.

  • mode (int32)

    Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.

Last modified December 08, 2021 at 9:34 AM PST: