Package org.cdk8s.plus24
Class PersistentVolumeClaim.Builder
- java.lang.Object
-
- org.cdk8s.plus24.PersistentVolumeClaim.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<PersistentVolumeClaim>
- Enclosing class:
- PersistentVolumeClaim
@Stability(Stable) public static final class PersistentVolumeClaim.Builder extends Object implements software.amazon.jsii.Builder<PersistentVolumeClaim>
A fluent builder forPersistentVolumeClaim
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PersistentVolumeClaim.Builder
accessModes(List<? extends PersistentVolumeAccessMode> accessModes)
Contains the access modes the volume should support.PersistentVolumeClaim
build()
static PersistentVolumeClaim.Builder
create(software.constructs.Construct scope, String id)
PersistentVolumeClaim.Builder
metadata(org.cdk8s.ApiObjectMetadata metadata)
Metadata that all persisted resources must have, which includes all objects users must create.PersistentVolumeClaim.Builder
storage(org.cdk8s.Size storage)
Minimum storage size the volume should have.PersistentVolumeClaim.Builder
storageClassName(String storageClassName)
Name of the StorageClass required by the claim.PersistentVolumeClaim.Builder
volume(IPersistentVolume volume)
The PersistentVolume backing this claim.PersistentVolumeClaim.Builder
volumeMode(PersistentVolumeMode volumeMode)
Defines what type of volume is required by the claim.
-
-
-
Method Detail
-
create
@Stability(Stable) public static PersistentVolumeClaim.Builder create(software.constructs.Construct scope, String id)
- Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
PersistentVolumeClaim.Builder
.
-
metadata
@Stability(Stable) public PersistentVolumeClaim.Builder metadata(org.cdk8s.ApiObjectMetadata metadata)
Metadata that all persisted resources must have, which includes all objects users must create.- Parameters:
metadata
- Metadata that all persisted resources must have, which includes all objects users must create. This parameter is required.- Returns:
this
-
accessModes
@Stability(Stable) public PersistentVolumeClaim.Builder accessModes(List<? extends PersistentVolumeAccessMode> accessModes)
Contains the access modes the volume should support.Default: - No access modes requirement.
- Parameters:
accessModes
- Contains the access modes the volume should support. This parameter is required.- Returns:
this
- See Also:
- https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
-
storage
@Stability(Stable) public PersistentVolumeClaim.Builder storage(org.cdk8s.Size storage)
Minimum storage size the volume should have.Default: - No storage requirement.
- Parameters:
storage
- Minimum storage size the volume should have. This parameter is required.- Returns:
this
- See Also:
- https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
-
storageClassName
@Stability(Stable) public PersistentVolumeClaim.Builder storageClassName(String storageClassName)
Name of the StorageClass required by the claim. When this property is not set, the behavior is as follows:.- If the admission plugin is turned on, the storage class marked as default will be used.
- If the admission plugin is turned off, the pvc can only be bound to volumes without a storage class.
Default: - Not set.
- Parameters:
storageClassName
- Name of the StorageClass required by the claim. When this property is not set, the behavior is as follows:. This parameter is required.- Returns:
this
- See Also:
- https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
-
volume
@Stability(Stable) public PersistentVolumeClaim.Builder volume(IPersistentVolume volume)
The PersistentVolume backing this claim.The control plane still checks that storage class, access modes, and requested storage size on the volume are valid.
Note that in order to guarantee a proper binding, the volume should also define a
claimRef
referring to this claim. Otherwise, the volume may be claimed be other pvc's before it gets a chance to bind to this one.If the volume is managed (i.e not imported), you can use
pv.claim()
to easily create a bi-directional bounded claim.Default: - No specific volume binding.
- Parameters:
volume
- The PersistentVolume backing this claim. This parameter is required.- Returns:
this
- See Also:
- https://kubernetes.io/docs/concepts/storage/persistent-volumes/#binding.
-
volumeMode
@Stability(Stable) public PersistentVolumeClaim.Builder volumeMode(PersistentVolumeMode volumeMode)
Defines what type of volume is required by the claim.Default: VolumeMode.FILE_SYSTEM
- Parameters:
volumeMode
- Defines what type of volume is required by the claim. This parameter is required.- Returns:
this
-
build
@Stability(Stable) public PersistentVolumeClaim build()
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<PersistentVolumeClaim>
-
-