| subcategory | page_title | description |
|---|---|---|
core/v1 |
Kubernetes: kubernetes_persistent_volume_v1 |
A Persistent Volume (PV) is a piece of networked storage in the cluster that has been provisioned by an administrator. |
A PersistentVolume (PV) is a piece of networked storage in the cluster provisioned by an administrator. It is a resource in the cluster just like a node is a cluster resource. Persistent Volumes have a lifecycle independent of any individual pod that uses the PV. This data source retrieves information about the specified PV.
metadata(Block List, Min: 1, Max: 1) Standard persistent volume's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see below for nested schema)
spec(Block List) Spec of the persistent volume owned by the cluster (see below for nested schema)
id(String) The ID of this resource.
Optional:
annotations(Map of String) An unstructured key value map stored with the persistent volume that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/labels(Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/name(String) Name of the persistent volume, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Read-Only:
generation(Number) A sequence number representing a specific generation of the desired state.resource_version(String) An opaque value that represents the internal version of this persistent volume that can be used by clients to determine when persistent volume has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistencyuid(String) The unique in time and space value for this persistent volume. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
Required:
access_modes(Set of String) Contains all ways the volume can be mounted. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modescapacity(Map of String) A description of the persistent volume's resources and capacity. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacitypersistent_volume_source(Block List, Min: 1, Max: 1) The specification of a persistent volume. (see below for nested schema)
Optional:
claim_ref(Block List, Max: 1) A reference to the persistent volume claim details for statically managed PVs. More Info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#binding (see below for nested schema)mount_options(Set of String) A list of mount options, e.g. ["ro", "soft"]. Not validated - mount will simply fail if one is invalid.node_affinity(Block List, Max: 1) A description of the persistent volume's node affinity. More info: https://kubernetes.io/docs/concepts/storage/volumes/#local (see below for nested schema)persistent_volume_reclaim_policy(String) What happens to a persistent volume when released from its claim. Valid options are Retain (default) and Recycle. Recycling must be supported by the volume plugin underlying this persistent volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaimingstorage_class_name(String) A description of the persistent volume's class. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#classvolume_mode(String) Defines if a volume is intended to be used with a formatted filesystem. or to remain in raw block state.
Optional:
aws_elastic_block_store(Block List, Max: 1) Represents an AWS 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#awselasticblockstore (see below for nested schema)azure_disk(Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see below for nested schema)azure_file(Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see below for nested schema)ceph_fs(Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see below for nested schema)cinder(Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see below for nested schema)csi(Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see below for nested schema)fc(Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see below for nested schema)flex_volume(Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see below for nested schema)flocker(Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see below for nested schema)gce_persistent_disk(Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see below for nested schema)glusterfs(Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see below for nested schema)host_path(Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see below for nested schema)iscsi(Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see below for nested schema)local(Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see below for nested schema)nfs(Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see below for nested schema)photon_persistent_disk(Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see below for nested schema)quobyte(Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see below for nested schema)rbd(Block List, Max: 1) Represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md (see below for nested schema)vsphere_volume(Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see below for nested schema)
Required:
volume_id(String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
Optional:
fs_type(String) Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstorepartition(Number) The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).read_only(Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
Required:
caching_mode(String) Host Caching mode: None, Read Only, Read Write.data_disk_uri(String) The URI the data disk in the blob storagedisk_name(String) The Name of the data disk in the blob storage
Optional:
fs_type(String) Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.kind(String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Sharedread_only(Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write).
Required:
secret_name(String) The name of secret that contains Azure Storage Account Name and Keyshare_name(String) Share Name
Optional:
read_only(Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write).secret_namespace(String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace.
Required:
monitors(Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
Optional:
path(String) Used as the mounted root, rather than the full Ceph tree, default is /read_only(Boolean) Whether to force the read-only setting in VolumeMounts. Defaults tofalse(read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-itsecret_file(String) The path to key ring for User, default is/etc/ceph/user.secret. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-itsecret_ref(Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see below for nested schema)user(String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
Optional:
name(String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesnamespace(String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Required:
volume_id(String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md
Optional:
fs_type(String) Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.mdread_only(Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md
Required:
driver(String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csivolume_handle(String) A string value that uniquely identifies the volume. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi
Optional:
controller_expand_secret_ref(Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerExpandVolume call. (see below for nested schema)controller_publish_secret_ref(Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerPublishVolume and ControllerUnpublishVolume calls. (see below for nested schema)fs_type(String) Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.node_publish_secret_ref(Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see below for nested schema)node_stage_secret_ref(Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeStageVolume and NodeStageVolume and NodeUnstageVolume calls. (see below for nested schema)read_only(Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csivolume_attributes(Map of String) Attributes of the volume to publish.
Optional:
name(String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesnamespace(String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Optional:
name(String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesnamespace(String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Optional:
name(String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesnamespace(String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Optional:
name(String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesnamespace(String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Required:
lun(Number) FC target lun numbertarget_ww_ns(Set of String) FC target worldwide names (WWNs)
Optional:
fs_type(String) Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.read_only(Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write).
Required:
driver(String) Driver is the name of the driver to use for this volume.
Optional:
fs_type(String) Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script.options(Map of String) Extra command options if any.read_only(Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write).secret_ref(Block List, Max: 1) Reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts. (see below for nested schema)
Optional:
name(String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesnamespace(String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Optional:
dataset_name(String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecateddataset_uuid(String) UUID of the dataset. This is unique identifier of a Flocker dataset
Required:
pd_name(String) Unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
Optional:
fs_type(String) Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdiskpartition(Number) The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdiskread_only(Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
Required:
endpoints_name(String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-podpath(String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
Optional:
read_only(Boolean) Whether to force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
Optional:
path(String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpathtype(String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice
Required:
iqn(String) Target iSCSI Qualified Name.target_portal(String) iSCSI target portal. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).
Optional:
chap_auth_discovery(Boolean) Whether target supports iSCSI Discovery CHAP authentication.chap_auth_session(Boolean) Whether target supports iSCSI Session CHAP authentication.fs_type(String) Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsiinitiator_name(String) The custom iSCSI Initiator Name. If initiator_name is specified with iscsi_interface simultaneously, new iSCSI interfacetarget portal:volume namewill be created for the connection.iscsi_interface(String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp).lun(Number) iSCSI target lun number.portals(List of String) The iSCSI Target Portal List. The Portal is either an IP orip_addr:portif the port is other than default (typically TCP ports 860 and 3260).read_only(Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false.secret_ref(Block List, Max: 1) The CHAP Secret for iSCSI target and initiator authentication. Default is nil. More info: https://github.com/kubernetes/examples/tree/master/_archived/volumes/iscsi (see below for nested schema)
Optional:
name(String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesnamespace(String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Optional:
path(String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local
Required:
path(String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfsserver(String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs
Optional:
read_only(Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs
Required:
pd_id(String) ID that identifies Photon Controller persistent disk
Optional:
fs_type(String) Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
Required:
registry(String) Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumesvolume(String) Volume is a string that references an already created Quobyte volume by name.
Optional:
group(String) Group to map volume access to Default is no groupread_only(Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false.user(String) User to map volume access to Defaults to serivceaccount user
Required:
ceph_monitors(Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-itrbd_image(String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
Optional:
fs_type(String) Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbdkeyring(String) Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-itrados_user(String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-itrbd_pool(String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it.read_only(Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-itsecret_ref(Block List, Max: 1) Name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it (see below for nested schema)
Optional:
name(String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesnamespace(String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Required:
volume_path(String) Path that identifies vSphere volume vmdk
Optional:
fs_type(String) Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
Required:
name(String) The name of the PersistentVolumeClaim
Optional:
namespace(String) The namespace of the PersistentVolumeClaim. Uses 'default' namespace if none is specified.
Optional:
required(Block List, Max: 1) (see below for nested schema)
Required:
node_selector_term(Block List, Min: 1) (see below for nested schema)
Optional:
match_expressions(Block List) A list of node selector requirements by node's labels. The requirements are ANDed. (see below for nested schema)match_fields(Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see below for nested schema)
Required:
key(String) The label key that the selector applies to.operator(String) A key's relationship to a set of values. Valid operators ardIn,NotIn,Exists,DoesNotExist,Gt, andLt.
Optional:
values(Set of String) An array of string values. If the operator isInorNotIn, the values array must be non-empty. If the operator isExistsorDoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
Required:
key(String) The label key that the selector applies to.operator(String) A key's relationship to a set of values. Valid operators ardIn,NotIn,Exists,DoesNotExist,Gt, andLt.
Optional:
values(Set of String) An array of string values. If the operator isInorNotIn, the values array must be non-empty. If the operator isExistsorDoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
data "kubernetes_persistent_volume_v1" "example" {
metadata {
name = "terraform-example"
}
}
data "kubernetes_secret" "example" {
metadata {
name = data.kubernetes_persistent_volume_v1.example.spec[0].persistent_volume_source[0].azure_file[0].secret_name
}
}
output "azure_storageaccount_name" {
value = data.kubernetes_secret.example.data.azurestorageaccountname
}
output "azure_storageaccount_key" {
value = data.kubernetes_secret.example.data.azurestorageaccountkey
}