struct
Kubernetes::Volume
- Kubernetes::Volume
- Struct
- Value
- Object
Overview
Volume represents a named volume in a pod that may be accessed by any container in the pod.
Included Modules
- JSON::Serializable
- Kubernetes::Serializable
- YAML::Serializable
Defined in:
generated/models/io_k8s_api_core_v1.crConstructors
- .new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
- .new(pull : ::JSON::PullParser)
- .new(*, __pull_for_json_serializable pull : ::JSON::PullParser)
- .new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
Macro Summary
-
field(name, type = nil, **options, &block)
Helper macro for defining fields with automatic camelCase conversion
Instance Method Summary
-
#aws_elastic_block_store : AWSElasticBlockStoreVolumeSource | Nil
awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod.
-
#aws_elastic_block_store=(aws_elastic_block_store : AWSElasticBlockStoreVolumeSource | Nil)
awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod.
-
#azure_disk : AzureDiskVolumeSource | Nil
azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
-
#azure_disk=(azure_disk : AzureDiskVolumeSource | Nil)
azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
-
#azure_file : AzureFileVolumeSource | Nil
azureFile represents an Azure File Service mount on the host and bind mount to the pod.
-
#azure_file=(azure_file : AzureFileVolumeSource | Nil)
azureFile represents an Azure File Service mount on the host and bind mount to the pod.
-
#cephfs : CephFSVolumeSource | Nil
cephFS represents a Ceph FS mount on the host that shares a pod's lifetime.
-
#cephfs=(cephfs : CephFSVolumeSource | Nil)
cephFS represents a Ceph FS mount on the host that shares a pod's lifetime.
-
#cinder : CinderVolumeSource | Nil
cinder represents a cinder volume attached and mounted on kubelets host machine.
-
#cinder=(cinder : CinderVolumeSource | Nil)
cinder represents a cinder volume attached and mounted on kubelets host machine.
-
#config_map : ConfigMapVolumeSource | Nil
configMap represents a configMap that should populate this volume
-
#config_map=(config_map : ConfigMapVolumeSource | Nil)
configMap represents a configMap that should populate this volume
-
#csi : CSIVolumeSource | Nil
csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers.
-
#csi=(csi : CSIVolumeSource | Nil)
csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers.
-
#downward_api : DownwardAPIVolumeSource | Nil
downwardAPI represents downward API about the pod that should populate this volume
-
#downward_api=(downward_api : DownwardAPIVolumeSource | Nil)
downwardAPI represents downward API about the pod that should populate this volume
-
#empty_dir : EmptyDirVolumeSource | Nil
emptyDir represents a temporary directory that shares a pod's lifetime.
-
#empty_dir=(empty_dir : EmptyDirVolumeSource | Nil)
emptyDir represents a temporary directory that shares a pod's lifetime.
-
#ephemeral : EphemeralVolumeSource | Nil
ephemeral represents a volume that is handled by a cluster storage driver.
-
#ephemeral=(ephemeral : EphemeralVolumeSource | Nil)
ephemeral represents a volume that is handled by a cluster storage driver.
-
#fc : FCVolumeSource | Nil
fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.
-
#fc=(fc : FCVolumeSource | Nil)
fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.
-
#flex_volume : FlexVolumeSource | Nil
flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.
-
#flex_volume=(flex_volume : FlexVolumeSource | Nil)
flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.
-
#flocker : FlockerVolumeSource | Nil
flocker represents a Flocker volume attached to a kubelet's host machine.
-
#flocker=(flocker : FlockerVolumeSource | Nil)
flocker represents a Flocker volume attached to a kubelet's host machine.
-
#gce_persistent_disk : GCEPersistentDiskVolumeSource | Nil
gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod.
-
#gce_persistent_disk=(gce_persistent_disk : GCEPersistentDiskVolumeSource | Nil)
gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod.
-
#git_repo : GitRepoVolumeSource | Nil
gitRepo represents a git repository at a particular revision.
-
#git_repo=(git_repo : GitRepoVolumeSource | Nil)
gitRepo represents a git repository at a particular revision.
-
#glusterfs : GlusterfsVolumeSource | Nil
glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime.
-
#glusterfs=(glusterfs : GlusterfsVolumeSource | Nil)
glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime.
-
#host_path : HostPathVolumeSource | Nil
hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container.
-
#host_path=(host_path : HostPathVolumeSource | Nil)
hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container.
-
#image : ImageVolumeSource | Nil
image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.
-
#image=(image : ImageVolumeSource | Nil)
image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.
-
#iscsi : ISCSIVolumeSource | Nil
iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod.
-
#iscsi=(iscsi : ISCSIVolumeSource | Nil)
iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod.
-
#name : String | Nil
name of the volume.
-
#name=(name : String | Nil)
name of the volume.
-
#nfs : NFSVolumeSource | Nil
nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs
-
#nfs=(nfs : NFSVolumeSource | Nil)
nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs
-
#persistent_volume_claim : PersistentVolumeClaimVolumeSource | Nil
persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace.
-
#persistent_volume_claim=(persistent_volume_claim : PersistentVolumeClaimVolumeSource | Nil)
persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace.
-
#photon_persistent_disk : PhotonPersistentDiskVolumeSource | Nil
photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine.
-
#photon_persistent_disk=(photon_persistent_disk : PhotonPersistentDiskVolumeSource | Nil)
photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine.
-
#portworx_volume : PortworxVolumeSource | Nil
portworxVolume represents a portworx volume attached and mounted on kubelets host machine.
-
#portworx_volume=(portworx_volume : PortworxVolumeSource | Nil)
portworxVolume represents a portworx volume attached and mounted on kubelets host machine.
-
#projected : ProjectedVolumeSource | Nil
projected items for all in one resources secrets, configmaps, and downward API
-
#projected=(projected : ProjectedVolumeSource | Nil)
projected items for all in one resources secrets, configmaps, and downward API
-
#quobyte : QuobyteVolumeSource | Nil
quobyte represents a Quobyte mount on the host that shares a pod's lifetime.
-
#quobyte=(quobyte : QuobyteVolumeSource | Nil)
quobyte represents a Quobyte mount on the host that shares a pod's lifetime.
-
#rbd : RBDVolumeSource | Nil
rbd represents a Rados Block Device mount on the host that shares a pod's lifetime.
-
#rbd=(rbd : RBDVolumeSource | Nil)
rbd represents a Rados Block Device mount on the host that shares a pod's lifetime.
-
#scale_io : ScaleIOVolumeSource | Nil
scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.
-
#scale_io=(scale_io : ScaleIOVolumeSource | Nil)
scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.
-
#secret : SecretVolumeSource | Nil
secret represents a secret that should populate this volume.
-
#secret=(secret : SecretVolumeSource | Nil)
secret represents a secret that should populate this volume.
-
#storageos : StorageOSVolumeSource | Nil
storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.
-
#storageos=(storageos : StorageOSVolumeSource | Nil)
storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.
-
#vsphere_volume : VsphereVirtualDiskVolumeSource | Nil
vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine.
-
#vsphere_volume=(vsphere_volume : VsphereVirtualDiskVolumeSource | Nil)
vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine.
Constructor Detail
Macro Detail
Helper macro for defining fields with automatic camelCase conversion
Instance Method Detail
awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Deprecated: AWSElasticBlockStore is deprecated. All operations for the in-tree awsElasticBlockStore type are redirected to the ebs.csi.aws.com CSI driver. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Deprecated: AWSElasticBlockStore is deprecated. All operations for the in-tree awsElasticBlockStore type are redirected to the ebs.csi.aws.com CSI driver. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. Deprecated: AzureDisk is deprecated. All operations for the in-tree azureDisk type are redirected to the disk.csi.azure.com CSI driver.
azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. Deprecated: AzureDisk is deprecated. All operations for the in-tree azureDisk type are redirected to the disk.csi.azure.com CSI driver.
azureFile represents an Azure File Service mount on the host and bind mount to the pod. Deprecated: AzureFile is deprecated. All operations for the in-tree azureFile type are redirected to the file.csi.azure.com CSI driver.
azureFile represents an Azure File Service mount on the host and bind mount to the pod. Deprecated: AzureFile is deprecated. All operations for the in-tree azureFile type are redirected to the file.csi.azure.com CSI driver.
cephFS represents a Ceph FS mount on the host that shares a pod's lifetime. Deprecated: CephFS is deprecated and the in-tree cephfs type is no longer supported.
cephFS represents a Ceph FS mount on the host that shares a pod's lifetime. Deprecated: CephFS is deprecated and the in-tree cephfs type is no longer supported.
cinder represents a cinder volume attached and mounted on kubelets host machine. Deprecated: Cinder is deprecated. All operations for the in-tree cinder type are redirected to the cinder.csi.openstack.org CSI driver. More info: https://examples.k8s.io/mysql-cinder-pd/README.md
cinder represents a cinder volume attached and mounted on kubelets host machine. Deprecated: Cinder is deprecated. All operations for the in-tree cinder type are redirected to the cinder.csi.openstack.org CSI driver. More info: https://examples.k8s.io/mysql-cinder-pd/README.md
configMap represents a configMap that should populate this volume
configMap represents a configMap that should populate this volume
csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers.
csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers.
downwardAPI represents downward API about the pod that should populate this volume
downwardAPI represents downward API about the pod that should populate this volume
emptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
emptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
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.
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.
fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.
fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.
flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. Deprecated: FlexVolume is deprecated. Consider using a CSIDriver instead.
flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. Deprecated: FlexVolume is deprecated. Consider using a CSIDriver instead.
flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running. Deprecated: Flocker is deprecated and the in-tree flocker type is no longer supported.
flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running. Deprecated: Flocker is deprecated and the in-tree flocker type is no longer supported.
gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Deprecated: GCEPersistentDisk is deprecated. All operations for the in-tree gcePersistentDisk type are redirected to the pd.csi.storage.gke.io CSI driver. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Deprecated: GCEPersistentDisk is deprecated. All operations for the in-tree gcePersistentDisk type are redirected to the pd.csi.storage.gke.io CSI driver. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
gitRepo represents a git repository at a particular revision. Deprecated: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.
gitRepo represents a git repository at a particular revision. Deprecated: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.
glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported.
glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported.
hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided:
- Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided:
- Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes/#iscsi
iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes/#iscsi
name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs
nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs
persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine. Deprecated: PhotonPersistentDisk is deprecated and the in-tree photonPersistentDisk type is no longer supported.
photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine. Deprecated: PhotonPersistentDisk is deprecated and the in-tree photonPersistentDisk type is no longer supported.
portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate is on.
portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate is on.
projected items for all in one resources secrets, configmaps, and downward API
projected items for all in one resources secrets, configmaps, and downward API
quobyte represents a Quobyte mount on the host that shares a pod's lifetime. Deprecated: Quobyte is deprecated and the in-tree quobyte type is no longer supported.
quobyte represents a Quobyte mount on the host that shares a pod's lifetime. Deprecated: Quobyte is deprecated and the in-tree quobyte type is no longer supported.
rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported.
rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported.
scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. Deprecated: ScaleIO is deprecated and the in-tree scaleIO type is no longer supported.
scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. Deprecated: ScaleIO is deprecated and the in-tree scaleIO type is no longer supported.
secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret
secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret
storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. Deprecated: StorageOS is deprecated and the in-tree storageos type is no longer supported.
storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. Deprecated: StorageOS is deprecated and the in-tree storageos type is no longer supported.
vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine. Deprecated: VsphereVolume is deprecated. All operations for the in-tree vsphereVolume type are redirected to the csi.vsphere.vmware.com CSI driver.
vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine. Deprecated: VsphereVolume is deprecated. All operations for the in-tree vsphereVolume type are redirected to the csi.vsphere.vmware.com CSI driver.