Package org.cdk8s.plus24.k8s
Class PersistentVolumeSpec.Builder
- java.lang.Object
-
- org.cdk8s.plus24.k8s.PersistentVolumeSpec.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<PersistentVolumeSpec>
- Enclosing interface:
- PersistentVolumeSpec
@Stability(Stable) public static final class PersistentVolumeSpec.Builder extends Object implements software.amazon.jsii.Builder<PersistentVolumeSpec>
A builder forPersistentVolumeSpec
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
accessModes
@Stability(Stable) public PersistentVolumeSpec.Builder accessModes(List<String> accessModes)
Sets the value ofPersistentVolumeSpec.getAccessModes()
- Parameters:
accessModes
- accessModes contains all ways the volume can be mounted. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes- Returns:
this
-
awsElasticBlockStore
@Stability(Stable) public PersistentVolumeSpec.Builder awsElasticBlockStore(AwsElasticBlockStoreVolumeSource awsElasticBlockStore)
Sets the value ofPersistentVolumeSpec.getAwsElasticBlockStore()
- Parameters:
awsElasticBlockStore
- awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore- Returns:
this
-
azureDisk
@Stability(Stable) public PersistentVolumeSpec.Builder azureDisk(AzureDiskVolumeSource azureDisk)
Sets the value ofPersistentVolumeSpec.getAzureDisk()
- Parameters:
azureDisk
- azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.- Returns:
this
-
azureFile
@Stability(Stable) public PersistentVolumeSpec.Builder azureFile(AzureFilePersistentVolumeSource azureFile)
Sets the value ofPersistentVolumeSpec.getAzureFile()
- Parameters:
azureFile
- azureFile represents an Azure File Service mount on the host and bind mount to the pod.- Returns:
this
-
capacity
@Stability(Stable) public PersistentVolumeSpec.Builder capacity(Map<String,? extends Quantity> capacity)
Sets the value ofPersistentVolumeSpec.getCapacity()
- Parameters:
capacity
- capacity is the description of the persistent volume's resources and capacity. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity- Returns:
this
-
cephfs
@Stability(Stable) public PersistentVolumeSpec.Builder cephfs(CephFsPersistentVolumeSource cephfs)
Sets the value ofPersistentVolumeSpec.getCephfs()
- Parameters:
cephfs
- cephFS represents a Ceph FS mount on the host that shares a pod's lifetime.- Returns:
this
-
cinder
@Stability(Stable) public PersistentVolumeSpec.Builder cinder(CinderPersistentVolumeSource cinder)
Sets the value ofPersistentVolumeSpec.getCinder()
- Parameters:
cinder
- cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md- Returns:
this
-
claimRef
@Stability(Stable) public PersistentVolumeSpec.Builder claimRef(ObjectReference claimRef)
Sets the value ofPersistentVolumeSpec.getClaimRef()
- Parameters:
claimRef
- claimRef is part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim. Expected to be non-nil when bound. claim.VolumeName is the authoritative bind between PV and PVC. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#binding- Returns:
this
-
csi
@Stability(Stable) public PersistentVolumeSpec.Builder csi(CsiPersistentVolumeSource csi)
Sets the value ofPersistentVolumeSpec.getCsi()
- Parameters:
csi
- csi represents storage that is handled by an external CSI driver (Beta feature).- Returns:
this
-
fc
@Stability(Stable) public PersistentVolumeSpec.Builder fc(FcVolumeSource fc)
Sets the value ofPersistentVolumeSpec.getFc()
- Parameters:
fc
- fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.- Returns:
this
-
flexVolume
@Stability(Stable) public PersistentVolumeSpec.Builder flexVolume(FlexPersistentVolumeSource flexVolume)
Sets the value ofPersistentVolumeSpec.getFlexVolume()
- Parameters:
flexVolume
- flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.- Returns:
this
-
flocker
@Stability(Stable) public PersistentVolumeSpec.Builder flocker(FlockerVolumeSource flocker)
Sets the value ofPersistentVolumeSpec.getFlocker()
- Parameters:
flocker
- flocker represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running- Returns:
this
-
gcePersistentDisk
@Stability(Stable) public PersistentVolumeSpec.Builder gcePersistentDisk(GcePersistentDiskVolumeSource gcePersistentDisk)
Sets the value ofPersistentVolumeSpec.getGcePersistentDisk()
- Parameters:
gcePersistentDisk
- gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk- Returns:
this
-
glusterfs
@Stability(Stable) public PersistentVolumeSpec.Builder glusterfs(GlusterfsPersistentVolumeSource glusterfs)
Sets the value ofPersistentVolumeSpec.getGlusterfs()
- Parameters:
glusterfs
- glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md- Returns:
this
-
hostPath
@Stability(Stable) public PersistentVolumeSpec.Builder hostPath(HostPathVolumeSource hostPath)
Sets the value ofPersistentVolumeSpec.getHostPath()
- Parameters:
hostPath
- hostPath represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath- Returns:
this
-
iscsi
@Stability(Stable) public PersistentVolumeSpec.Builder iscsi(IscsiPersistentVolumeSource iscsi)
Sets the value ofPersistentVolumeSpec.getIscsi()
- Parameters:
iscsi
- iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin.- Returns:
this
-
local
@Stability(Stable) public PersistentVolumeSpec.Builder local(LocalVolumeSource local)
Sets the value ofPersistentVolumeSpec.getLocal()
- Parameters:
local
- local represents directly-attached storage with node affinity.- Returns:
this
-
mountOptions
@Stability(Stable) public PersistentVolumeSpec.Builder mountOptions(List<String> mountOptions)
Sets the value ofPersistentVolumeSpec.getMountOptions()
- Parameters:
mountOptions
- mountOptions is the list of mount options, e.g. ["ro", "soft"]. Not validated - mount will simply fail if one is invalid. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options.- Returns:
this
-
nfs
@Stability(Stable) public PersistentVolumeSpec.Builder nfs(NfsVolumeSource nfs)
Sets the value ofPersistentVolumeSpec.getNfs()
- Parameters:
nfs
- nfs represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs- Returns:
this
-
nodeAffinity
@Stability(Stable) public PersistentVolumeSpec.Builder nodeAffinity(VolumeNodeAffinity nodeAffinity)
Sets the value ofPersistentVolumeSpec.getNodeAffinity()
- Parameters:
nodeAffinity
- nodeAffinity defines constraints that limit what nodes this volume can be accessed from. This field influences the scheduling of pods that use this volume.- Returns:
this
-
persistentVolumeReclaimPolicy
@Stability(Stable) public PersistentVolumeSpec.Builder persistentVolumeReclaimPolicy(String persistentVolumeReclaimPolicy)
Sets the value ofPersistentVolumeSpec.getPersistentVolumeReclaimPolicy()
- Parameters:
persistentVolumeReclaimPolicy
- persistentVolumeReclaimPolicy defines what happens to a persistent volume when released from its claim. Valid options are Retain (default for manually created PersistentVolumes), Delete (default for dynamically provisioned PersistentVolumes), and Recycle (deprecated). Recycle must be supported by the volume plugin underlying this PersistentVolume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming- Returns:
this
-
photonPersistentDisk
@Stability(Stable) public PersistentVolumeSpec.Builder photonPersistentDisk(PhotonPersistentDiskVolumeSource photonPersistentDisk)
Sets the value ofPersistentVolumeSpec.getPhotonPersistentDisk()
- Parameters:
photonPersistentDisk
- photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine.- Returns:
this
-
portworxVolume
@Stability(Stable) public PersistentVolumeSpec.Builder portworxVolume(PortworxVolumeSource portworxVolume)
Sets the value ofPersistentVolumeSpec.getPortworxVolume()
- Parameters:
portworxVolume
- portworxVolume represents a portworx volume attached and mounted on kubelets host machine.- Returns:
this
-
quobyte
@Stability(Stable) public PersistentVolumeSpec.Builder quobyte(QuobyteVolumeSource quobyte)
Sets the value ofPersistentVolumeSpec.getQuobyte()
- Parameters:
quobyte
- quobyte represents a Quobyte mount on the host that shares a pod's lifetime.- Returns:
this
-
rbd
@Stability(Stable) public PersistentVolumeSpec.Builder rbd(RbdPersistentVolumeSource rbd)
Sets the value ofPersistentVolumeSpec.getRbd()
- Parameters:
rbd
- rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md- Returns:
this
-
scaleIo
@Stability(Stable) public PersistentVolumeSpec.Builder scaleIo(ScaleIoPersistentVolumeSource scaleIo)
Sets the value ofPersistentVolumeSpec.getScaleIo()
- Parameters:
scaleIo
- scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.- Returns:
this
-
storageClassName
@Stability(Stable) public PersistentVolumeSpec.Builder storageClassName(String storageClassName)
Sets the value ofPersistentVolumeSpec.getStorageClassName()
- Parameters:
storageClassName
- storageClassName is the name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass.- Returns:
this
-
storageos
@Stability(Stable) public PersistentVolumeSpec.Builder storageos(StorageOsPersistentVolumeSource storageos)
Sets the value ofPersistentVolumeSpec.getStorageos()
- Parameters:
storageos
- storageOS represents a StorageOS volume that is attached to the kubelet's host machine and mounted into the pod More info: https://examples.k8s.io/volumes/storageos/README.md.- Returns:
this
-
volumeMode
@Stability(Stable) public PersistentVolumeSpec.Builder volumeMode(String volumeMode)
Sets the value ofPersistentVolumeSpec.getVolumeMode()
- Parameters:
volumeMode
- volumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec.- Returns:
this
-
vsphereVolume
@Stability(Stable) public PersistentVolumeSpec.Builder vsphereVolume(VsphereVirtualDiskVolumeSource vsphereVolume)
Sets the value ofPersistentVolumeSpec.getVsphereVolume()
- Parameters:
vsphereVolume
- vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine.- Returns:
this
-
build
@Stability(Stable) public PersistentVolumeSpec build()
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<PersistentVolumeSpec>
- Returns:
- a new instance of
PersistentVolumeSpec
- Throws:
NullPointerException
- if any required attribute was not provided
-
-