Class PersistentVolumeClaim

  • All Implemented Interfaces:
    IPersistentVolumeClaim, IResource, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

    @Generated(value="jsii-pacmak/1.57.0 (build f614666)",
               date="2022-04-26T09:02:10.517Z")
    @Stability(Stable)
    public class PersistentVolumeClaim
    extends Resource
    implements IPersistentVolumeClaim
    A PersistentVolumeClaim (PVC) is a request for storage by a user.

    It is similar to a Pod. Pods consume node resources and PVCs consume PV resources. Pods can request specific levels of resources (CPU and Memory). Claims can request specific size and access modes

    • Constructor Detail

      • PersistentVolumeClaim

        protected PersistentVolumeClaim​(software.amazon.jsii.JsiiObjectRef objRef)
      • PersistentVolumeClaim

        protected PersistentVolumeClaim​(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
      • PersistentVolumeClaim

        @Stability(Stable)
        public PersistentVolumeClaim​(@NotNull
                                     software.constructs.Construct scope,
                                     @NotNull
                                     String id,
                                     @Nullable
                                     PersistentVolumeClaimProps props)
        Parameters:
        scope - This parameter is required.
        id - This parameter is required.
        props -
      • PersistentVolumeClaim

        @Stability(Stable)
        public PersistentVolumeClaim​(@NotNull
                                     software.constructs.Construct scope,
                                     @NotNull
                                     String id)
        Parameters:
        scope - This parameter is required.
        id - This parameter is required.
    • Method Detail

      • fromClaimName

        @Stability(Stable)
        @NotNull
        public static IPersistentVolumeClaim fromClaimName​(@NotNull
                                                           String claimName)
        Imports a pvc from the cluster as a reference.

        Parameters:
        claimName - The name of the pvc to reference. This parameter is required.
      • bind

        @Stability(Stable)
        public void bind​(@NotNull
                         IPersistentVolume vol)
        Bind a claim to a specific volume.

        Note that you must also bind the volume to the claim.

        Parameters:
        vol - The PV to bind to. This parameter is required.
      • getApiObject

        @Stability(Stable)
        @NotNull
        protected org.cdk8s.ApiObject getApiObject()
        The underlying cdk8s API object.

        Specified by:
        getApiObject in class Resource
        See Also:
        base.Resource.apiObject
      • getVolumeMode

        @Stability(Stable)
        @NotNull
        public PersistentVolumeMode getVolumeMode()
        Volume mode requirement of this claim.
      • getStorage

        @Stability(Stable)
        @Nullable
        public org.cdk8s.Size getStorage()
        Storage requirement of this claim.
      • getStorageClassName

        @Stability(Stable)
        @Nullable
        public String getStorageClassName()
        Storage class requirment of this claim.
      • getVolume

        @Stability(Stable)
        @Nullable
        public IPersistentVolume getVolume()
        PV this claim is bound to.

        Undefined means the claim is not bound to any specific volume.