PersistentVolumeClaim

    apiVersion: v1

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

    PersistentVolumeClaim is a user’s request for and claim to a persistent volume


    PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes


    • accessModes ([]string)

      accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1

    • resources (ResourceRequirements)

      resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info:

      ResourceRequirements describes the compute resource requirements.

      • resources.claims ([]ResourceClaim)

        Set: unique values will be kept during a merge

        Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.

        This is an alpha field and requires enabling the DynamicResourceAllocation feature gate.

        This field is immutable.

        ResourceClaim references one entry in PodSpec.ResourceClaims.

        • resources.claims.name (string), required

          Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.

      • resources.limits (map[string]Quantity)

        Limits describes the maximum amount of compute resources allowed. More info:

      • resources.requests (map[string]Quantity)

        Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info:

    • volumeName (string)

      volumeName is the binding reference to the PersistentVolume backing this claim.

    • storageClassName (string)

      storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1

    • volumeMode (string)

      volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.

    • dataSource (TypedLocalObjectReference)

      dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.

    • dataSourceRef (TypedObjectReference)

      dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn’t specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn’t set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects.

      • While dataSource ignores disallowed values (dropping them), dataSourceRef preserves all values, and generates an error if a disallowed value is specified.
      • While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.

      **

      • dataSourceRef.kind (string), required

        Kind is the type of resource being referenced

      • dataSourceRef.name (string), required

        Name is the name of resource being referenced

      • dataSourceRef.apiGroup (string)

        APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.

      • dataSourceRef.namespace (string)

        Namespace is the namespace of resource being referenced Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace’s owner to accept the reference. See the ReferenceGrant documentation for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.

    PersistentVolumeClaimStatus is the current status of a persistent volume claim.


    • accessModes ([]string)

      accessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1

    • allocatedResources (map[string])

      allocatedResources is the storage resource within AllocatedResources tracks the capacity allocated to a PVC. It may be larger than the actual capacity when a volume expansion operation is requested. For storage quota, the larger value from allocatedResources and PVC.spec.resources is used. If allocatedResources is not set, PVC.spec.resources alone is used for quota calculation. If a volume expansion capacity request is lowered, allocatedResources is only lowered if there are no expansion operations in progress and if the actual volume capacity is equal or lower than the requested capacity. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.

    • capacity (map[string]Quantity)

      capacity represents the actual resources of the underlying volume.

    • conditions ([]PersistentVolumeClaimCondition)

      Patch strategy: merge on key type

      conditions is the current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to ‘ResizeStarted’.

      PersistentVolumeClaimCondition contails details about state of pvc

      • conditions.status (string), required

      • conditions.type (string), required

      • conditions.lastProbeTime (Time)

        lastProbeTime is the time we probed the condition.

        Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.

      • conditions.lastTransitionTime (Time)

        lastTransitionTime is the time the condition transitioned from one status to another.

        Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.

      • conditions.message (string)

        message is the human-readable message indicating details about last transition.

      • conditions.reason (string)

        reason is a unique, this should be a short, machine understandable string that gives the reason for condition’s last transition. If it reports “ResizeStarted” that means the underlying persistent volume is being resized.

    • phase (string)

      phase represents the current phase of PersistentVolumeClaim.

    • resizeStatus (string)

      resizeStatus stores status of resize operation. ResizeStatus is not set by default but when expansion is complete resizeStatus is set to empty string by resize controller or kubelet. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.

    PersistentVolumeClaimList is a list of PersistentVolumeClaim items.


    • apiVersion: v1

    • kind: PersistentVolumeClaimList

    • metadata (ListMeta)

      Standard list metadata. More info:

    • items ([]PersistentVolumeClaim), required

      items is a list of persistent volume claims. More info:


    get read the specified PersistentVolumeClaim

    HTTP Request

    GET /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}

    Parameters

    • name (in path): string, required

      name of the PersistentVolumeClaim

    • namespace (in path): string, required

      namespace

    • pretty (in query): string

    Response

    200 (): OK

    401: Unauthorized

    get read status of the specified PersistentVolumeClaim

    HTTP Request

    Parameters

    • name (in path): string, required

      name of the PersistentVolumeClaim

    • namespace (in path): string, required

    • pretty (in query): string

      pretty

    Response

    200 (PersistentVolumeClaim): OK

    401: Unauthorized

    list or watch objects of kind PersistentVolumeClaim

    HTTP Request

    GET /api/v1/namespaces/{namespace}/persistentvolumeclaims

    Parameters

    • namespace (in path): string, required

      namespace

    • allowWatchBookmarks (in query): boolean

    • continue (in query): string

      continue

    • fieldSelector (in query): string

    • labelSelector (in query): string

      labelSelector

    • limit (in query): integer

    • pretty (in query): string

      pretty

    • resourceVersion (in query): string

    • resourceVersionMatch (in query): string

      resourceVersionMatch

    • timeoutSeconds (in query): integer

    • watch (in query): boolean

      watch

    Response

    200 (PersistentVolumeClaimList): OK

    401: Unauthorized

    HTTP Request

    GET /api/v1/persistentvolumeclaims

    Parameters

    • allowWatchBookmarks (in query): boolean

      allowWatchBookmarks

    • continue (in query): string

    • fieldSelector (in query): string

      fieldSelector

    • labelSelector (in query): string

    • limit (in query): integer

      limit

    • pretty (in query): string

    • resourceVersion (in query): string

      resourceVersion

    • timeoutSeconds (in query): integer

    • watch (in query): boolean

      watch

    Response

    200 (PersistentVolumeClaimList): OK

    401: Unauthorized

    create create a PersistentVolumeClaim

    HTTP Request

    POST /api/v1/namespaces/{namespace}/persistentvolumeclaims

    Parameters

    • namespace (in path): string, required

      namespace

    • body: , required

    • dryRun (in query): string

      dryRun

    • fieldManager (in query): string

    • fieldValidation (in query): string

      fieldValidation

    • pretty (in query): string

    Response

    200 (): OK

    201 (PersistentVolumeClaim): Created

    202 (): Accepted

    401: Unauthorized

    update replace the specified PersistentVolumeClaim

    HTTP Request

    PUT /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}

    Parameters

    • name (in path): string, required

      name of the PersistentVolumeClaim

    • namespace (in path): string, required

    • body: PersistentVolumeClaim, required

    • dryRun (in query): string

    • fieldManager (in query): string

      fieldManager

    • fieldValidation (in query): string

    • pretty (in query): string

      pretty

    Response

    200 (PersistentVolumeClaim): OK

    201 (): Created

    401: Unauthorized

    update replace status of the specified PersistentVolumeClaim

    HTTP Request

    PUT /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status

    Parameters

    • name (in path): string, required

      name of the PersistentVolumeClaim

    • namespace (in path): string, required

    • body: , required

    • dryRun (in query): string

      dryRun

    • fieldManager (in query): string

    • fieldValidation (in query): string

      fieldValidation

    • pretty (in query): string

    Response

    200 (): OK

    201 (PersistentVolumeClaim): Created

    401: Unauthorized

    HTTP Request

    PATCH /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}

    Parameters

    • name (in path): string, required

      name of the PersistentVolumeClaim

    • namespace (in path): string, required

      namespace

    • body: , required

    • dryRun (in query): string

      dryRun

    • fieldManager (in query): string

    • fieldValidation (in query): string

      fieldValidation

    • force (in query): boolean

    • pretty (in query): string

      pretty

    Response

    200 (PersistentVolumeClaim): OK

    201 (): Created

    401: Unauthorized

    patch partially update status of the specified PersistentVolumeClaim

    HTTP Request

    PATCH /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status

    Parameters

    • name (in path): string, required

      name of the PersistentVolumeClaim

    • namespace (in path): string, required

    • body: Patch, required

    • dryRun (in query): string

    • fieldManager (in query): string

      fieldManager

    • fieldValidation (in query): string

    • force (in query): boolean

      force

    • pretty (in query): string

    Response

    200 (): OK

    201 (PersistentVolumeClaim): Created

    401: Unauthorized

    delete delete a PersistentVolumeClaim

    HTTP Request

    DELETE /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}

    Parameters

    • name (in path): string, required

      name of the PersistentVolumeClaim

    • namespace (in path): string, required

      namespace

    • body:

    • dryRun (in query): string

      dryRun

    • gracePeriodSeconds (in query): integer

    • pretty (in query): string

      pretty

    • propagationPolicy (in query): string

    Response

    200 (): OK

    202 (PersistentVolumeClaim): Accepted

    401: Unauthorized

    delete collection of PersistentVolumeClaim

    HTTP Request

    DELETE /api/v1/namespaces/{namespace}/persistentvolumeclaims

    Parameters

    • namespace (in path): string, required

      namespace

    • body:

    • continue (in query): string

      continue

    • dryRun (in query): string

    • fieldSelector (in query): string

      fieldSelector

    • gracePeriodSeconds (in query): integer

    • labelSelector (in query): string

      labelSelector

    • limit (in query): integer

    • pretty (in query): string

      pretty

    • propagationPolicy (in query): string

    • resourceVersion (in query): string

      resourceVersion

    • timeoutSeconds (in query): integer

    Response

    401: Unauthorized