Package org.cdk8s.plus25
Class PersistentVolume
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- software.constructs.Construct
-
- org.cdk8s.plus25.Resource
-
- org.cdk8s.plus25.PersistentVolume
-
- All Implemented Interfaces:
IApiEndpoint,IApiResource,IPersistentVolume,IResource,IStorage,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
- Direct Known Subclasses:
AwsElasticBlockStorePersistentVolume,AzureDiskPersistentVolume,GCEPersistentDiskPersistentVolume
@Generated(value="jsii-pacmak/1.88.0 (build eaabd08)", date="2023-09-11T06:17:58.374Z") @Stability(Stable) public class PersistentVolume extends Resource implements IPersistentVolume, IStorage
A PersistentVolume (PV) is a piece of storage in the cluster that has been provisioned by an administrator or dynamically provisioned using Storage Classes.It is a resource in the cluster just like a node is a cluster resource. PVs are volume plugins like Volumes, but have a lifecycle independent of any individual Pod that uses the PV. This API object captures the details of the implementation of the storage, be that NFS, iSCSI, or a cloud-provider-specific storage system.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Nested classes/interfaces inherited from interface org.cdk8s.plus25.IApiEndpoint
IApiEndpoint.Jsii$Default
-
Nested classes/interfaces inherited from interface org.cdk8s.plus25.IApiResource
IApiResource.Jsii$Default
-
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
-
Nested classes/interfaces inherited from interface org.cdk8s.plus25.IPersistentVolume
IPersistentVolume.Jsii$Default, IPersistentVolume.Jsii$Proxy
-
Nested classes/interfaces inherited from interface org.cdk8s.plus25.IResource
IResource.Jsii$Default
-
Nested classes/interfaces inherited from interface org.cdk8s.plus25.IStorage
IStorage.Jsii$Default, IStorage.Jsii$Proxy
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPersistentVolume(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)protectedPersistentVolume(software.amazon.jsii.JsiiObjectRef objRef)protectedPersistentVolume(software.constructs.Construct scope, String id)protectedPersistentVolume(software.constructs.Construct scope, String id, PersistentVolumeProps props)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description VolumeasVolume()Convert the piece of storage into a concrete volume.voidbind(IPersistentVolumeClaim claim)Bind a volume to a specific claim.static IPersistentVolumefromPersistentVolumeName(software.constructs.Construct scope, String id, String volumeName)Imports a pv from the cluster as a reference.List<PersistentVolumeAccessMode>getAccessModes()Access modes requirement of this claim.protected org.cdk8s.ApiObjectgetApiObject()The underlying cdk8s API object.IPersistentVolumeClaimgetClaim()PVC this volume is bound to.PersistentVolumeModegetMode()Volume mode of this volume.List<String>getMountOptions()Mount options of this volume.PersistentVolumeReclaimPolicygetReclaimPolicy()Reclaim policy of this volume.StringgetResourceType()The name of a resource type as it appears in the relevant API endpoint.org.cdk8s.SizegetStorage()Storage size of this volume.StringgetStorageClassName()Storage class this volume belongs to.PersistentVolumeClaimreserve()Reserve aPersistentVolumeby creating aPersistentVolumeClaimthat is wired to claim this volume.-
Methods inherited from class org.cdk8s.plus25.Resource
asApiResource, asNonApiResource, getApiGroup, getApiVersion, getKind, getMetadata, getName, getPermissions, getResourceName
-
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.cdk8s.plus25.IApiResource
getApiGroup, getResourceName
-
Methods inherited from interface org.cdk8s.plus25.IResource
getApiVersion, getKind, getName
-
-
-
-
Constructor Detail
-
PersistentVolume
protected PersistentVolume(software.amazon.jsii.JsiiObjectRef objRef)
-
PersistentVolume
protected PersistentVolume(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
PersistentVolume
@Stability(Stable) protected PersistentVolume(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable PersistentVolumeProps props)- Parameters:
scope- This parameter is required.id- This parameter is required.props-
-
PersistentVolume
@Stability(Stable) protected PersistentVolume(@NotNull software.constructs.Construct scope, @NotNull String id)- Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Detail
-
fromPersistentVolumeName
@Stability(Stable) @NotNull public static IPersistentVolume fromPersistentVolumeName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String volumeName)
Imports a pv from the cluster as a reference.- Parameters:
scope- This parameter is required.id- This parameter is required.volumeName- This parameter is required.
-
asVolume
@Stability(Stable) @NotNull public Volume asVolume()
Convert the piece of storage into a concrete volume.
-
bind
@Stability(Stable) public void bind(@NotNull IPersistentVolumeClaim claim)Bind a volume to a specific claim.Note that you must also bind the claim to the volume.
- Parameters:
claim- The PVC to bind to. This parameter is required.- See Also:
- https://kubernetes.io/docs/concepts/storage/persistent-volumes/#binding
-
reserve
@Stability(Stable) @NotNull public PersistentVolumeClaim reserve()
Reserve aPersistentVolumeby creating aPersistentVolumeClaimthat is wired to claim this volume.Note that this method will throw in case the volume is already claimed.
-
getApiObject
@Stability(Stable) @NotNull protected org.cdk8s.ApiObject getApiObject()
The underlying cdk8s API object.- Specified by:
getApiObjectin classResource- See Also:
- base.Resource.apiObject
-
getMode
@Stability(Stable) @NotNull public PersistentVolumeMode getMode()
Volume mode of this volume.
-
getReclaimPolicy
@Stability(Stable) @NotNull public PersistentVolumeReclaimPolicy getReclaimPolicy()
Reclaim policy of this volume.
-
getResourceType
@Stability(Stable) @NotNull public String getResourceType()
The name of a resource type as it appears in the relevant API endpoint.- Specified by:
getResourceTypein interfaceIApiResource- Specified by:
getResourceTypein classResource- See Also:
- https://kubernetes.io/docs/reference/access-authn-authz/rbac/#referring-to-resources
-
getAccessModes
@Stability(Stable) @Nullable public List<PersistentVolumeAccessMode> getAccessModes()
Access modes requirement of this claim.
-
getClaim
@Stability(Stable) @Nullable public IPersistentVolumeClaim getClaim()
PVC this volume is bound to.Undefined means this volume is not yet claimed by any PVC.
-
getMountOptions
@Stability(Stable) @Nullable public List<String> getMountOptions()
Mount options of this volume.
-
getStorage
@Stability(Stable) @Nullable public org.cdk8s.Size getStorage()
Storage size of this volume.
-
getStorageClassName
@Stability(Stable) @Nullable public String getStorageClassName()
Storage class this volume belongs to.
-
-