Package org.cdk8s.plus24
Class PersistentVolume
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- software.constructs.Construct
-
- org.cdk8s.plus24.Resource
-
- org.cdk8s.plus24.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.82.0 (build 2d2ddd7)", date="2023-05-25T02:26:40.625Z") @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.plus24.IApiEndpoint
IApiEndpoint.Jsii$Default
-
Nested classes/interfaces inherited from interface org.cdk8s.plus24.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.plus24.IPersistentVolume
IPersistentVolume.Jsii$Default, IPersistentVolume.Jsii$Proxy
-
Nested classes/interfaces inherited from interface org.cdk8s.plus24.IResource
IResource.Jsii$Default
-
Nested classes/interfaces inherited from interface org.cdk8s.plus24.IStorage
IStorage.Jsii$Default, IStorage.Jsii$Proxy
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PersistentVolume(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
protected
PersistentVolume(software.amazon.jsii.JsiiObjectRef objRef)
protected
PersistentVolume(software.constructs.Construct scope, String id)
protected
PersistentVolume(software.constructs.Construct scope, String id, PersistentVolumeProps props)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Volume
asVolume()
Convert the piece of storage into a concrete volume.void
bind(IPersistentVolumeClaim claim)
Bind a volume to a specific claim.static IPersistentVolume
fromPersistentVolumeName(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.ApiObject
getApiObject()
The underlying cdk8s API object.IPersistentVolumeClaim
getClaim()
PVC this volume is bound to.PersistentVolumeMode
getMode()
Volume mode of this volume.List<String>
getMountOptions()
Mount options of this volume.PersistentVolumeReclaimPolicy
getReclaimPolicy()
Reclaim policy of this volume.String
getResourceType()
The name of a resource type as it appears in the relevant API endpoint.org.cdk8s.Size
getStorage()
Storage size of this volume.String
getStorageClassName()
Storage class this volume belongs to.PersistentVolumeClaim
reserve()
Reserve aPersistentVolume
by creating aPersistentVolumeClaim
that is wired to claim this volume.-
Methods inherited from class org.cdk8s.plus24.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.plus24.IApiResource
getApiGroup, getResourceName
-
Methods inherited from interface org.cdk8s.plus24.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 aPersistentVolume
by creating aPersistentVolumeClaim
that 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:
getApiObject
in 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:
getResourceType
in interfaceIApiResource
- Specified by:
getResourceType
in 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.
-
-