Class Volume.Builder
- java.lang.Object
-
- org.cdk8s.plus24.k8s.Volume.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
name
@Stability(Stable) public Volume.Builder name(String name)
Sets the value ofVolume.getName()
- Parameters:
name
- name of the volume. This parameter is required. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names- Returns:
this
-
awsElasticBlockStore
@Stability(Stable) public Volume.Builder awsElasticBlockStore(AwsElasticBlockStoreVolumeSource awsElasticBlockStore)
Sets the value ofVolume.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 Volume.Builder azureDisk(AzureDiskVolumeSource azureDisk)
Sets the value ofVolume.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 Volume.Builder azureFile(AzureFileVolumeSource azureFile)
Sets the value ofVolume.getAzureFile()
- Parameters:
azureFile
- azureFile represents an Azure File Service mount on the host and bind mount to the pod.- Returns:
this
-
cephfs
@Stability(Stable) public Volume.Builder cephfs(CephFsVolumeSource cephfs)
Sets the value ofVolume.getCephfs()
- Parameters:
cephfs
- cephFS represents a Ceph FS mount on the host that shares a pod's lifetime.- Returns:
this
-
cinder
@Stability(Stable) public Volume.Builder cinder(CinderVolumeSource cinder)
Sets the value ofVolume.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
-
configMap
@Stability(Stable) public Volume.Builder configMap(ConfigMapVolumeSource configMap)
Sets the value ofVolume.getConfigMap()
- Parameters:
configMap
- configMap represents a configMap that should populate this volume.- Returns:
this
-
csi
@Stability(Stable) public Volume.Builder csi(CsiVolumeSource csi)
Sets the value ofVolume.getCsi()
- Parameters:
csi
- csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).- Returns:
this
-
downwardApi
@Stability(Stable) public Volume.Builder downwardApi(DownwardApiVolumeSource downwardApi)
Sets the value ofVolume.getDownwardApi()
- Parameters:
downwardApi
- downwardAPI represents downward API about the pod that should populate this volume.- Returns:
this
-
emptyDir
@Stability(Stable) public Volume.Builder emptyDir(EmptyDirVolumeSource emptyDir)
Sets the value ofVolume.getEmptyDir()
- Parameters:
emptyDir
- emptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir- Returns:
this
-
ephemeral
@Stability(Stable) public Volume.Builder ephemeral(EphemeralVolumeSource ephemeral)
Sets the value ofVolume.getEphemeral()
- Parameters:
ephemeral
- ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.Use this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity tracking are needed, c) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through a PersistentVolumeClaim (see EphemeralVolumeSource for more information on the connection between this volume type and PersistentVolumeClaim).
Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.
Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.
A pod can use both types of ephemeral volumes and persistent volumes at the same time.
- Returns:
this
-
fc
@Stability(Stable) public Volume.Builder fc(FcVolumeSource fc)
Sets the value ofVolume.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 Volume.Builder flexVolume(FlexVolumeSource flexVolume)
Sets the value ofVolume.getFlexVolume()
- Parameters:
flexVolume
- flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.- Returns:
this
-
flocker
@Stability(Stable) public Volume.Builder flocker(FlockerVolumeSource flocker)
Sets the value ofVolume.getFlocker()
- Parameters:
flocker
- flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running- Returns:
this
-
gcePersistentDisk
@Stability(Stable) public Volume.Builder gcePersistentDisk(GcePersistentDiskVolumeSource gcePersistentDisk)
Sets the value ofVolume.getGcePersistentDisk()
- Parameters:
gcePersistentDisk
- gcePersistentDisk represents a GCE 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#gcepersistentdisk- Returns:
this
-
gitRepo
@Stability(Stable) public Volume.Builder gitRepo(GitRepoVolumeSource gitRepo)
Sets the value ofVolume.getGitRepo()
- Parameters:
gitRepo
- gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.- Returns:
this
-
glusterfs
@Stability(Stable) public Volume.Builder glusterfs(GlusterfsVolumeSource glusterfs)
Sets the value ofVolume.getGlusterfs()
- Parameters:
glusterfs
- glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md- Returns:
this
-
hostPath
@Stability(Stable) public Volume.Builder hostPath(HostPathVolumeSource hostPath)
Sets the value ofVolume.getHostPath()
- Parameters:
hostPath
- hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath- Returns:
this
-
iscsi
@Stability(Stable) public Volume.Builder iscsi(IscsiVolumeSource iscsi)
Sets the value ofVolume.getIscsi()
- Parameters:
iscsi
- iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md- Returns:
this
-
nfs
@Stability(Stable) public Volume.Builder nfs(NfsVolumeSource nfs)
Sets the value ofVolume.getNfs()
- Parameters:
nfs
- nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs.- Returns:
this
-
persistentVolumeClaim
@Stability(Stable) public Volume.Builder persistentVolumeClaim(PersistentVolumeClaimVolumeSource persistentVolumeClaim)
Sets the value ofVolume.getPersistentVolumeClaim()
- Parameters:
persistentVolumeClaim
- persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims- Returns:
this
-
photonPersistentDisk
@Stability(Stable) public Volume.Builder photonPersistentDisk(PhotonPersistentDiskVolumeSource photonPersistentDisk)
Sets the value ofVolume.getPhotonPersistentDisk()
- Parameters:
photonPersistentDisk
- photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine.- Returns:
this
-
portworxVolume
@Stability(Stable) public Volume.Builder portworxVolume(PortworxVolumeSource portworxVolume)
Sets the value ofVolume.getPortworxVolume()
- Parameters:
portworxVolume
- portworxVolume represents a portworx volume attached and mounted on kubelets host machine.- Returns:
this
-
projected
@Stability(Stable) public Volume.Builder projected(ProjectedVolumeSource projected)
Sets the value ofVolume.getProjected()
- Parameters:
projected
- projected items for all in one resources secrets, configmaps, and downward API.- Returns:
this
-
quobyte
@Stability(Stable) public Volume.Builder quobyte(QuobyteVolumeSource quobyte)
Sets the value ofVolume.getQuobyte()
- Parameters:
quobyte
- quobyte represents a Quobyte mount on the host that shares a pod's lifetime.- Returns:
this
-
rbd
@Stability(Stable) public Volume.Builder rbd(RbdVolumeSource rbd)
Sets the value ofVolume.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 Volume.Builder scaleIo(ScaleIoVolumeSource scaleIo)
Sets the value ofVolume.getScaleIo()
- Parameters:
scaleIo
- scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.- Returns:
this
-
secret
@Stability(Stable) public Volume.Builder secret(SecretVolumeSource secret)
Sets the value ofVolume.getSecret()
- Parameters:
secret
- secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret- Returns:
this
-
storageos
@Stability(Stable) public Volume.Builder storageos(StorageOsVolumeSource storageos)
Sets the value ofVolume.getStorageos()
- Parameters:
storageos
- storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.- Returns:
this
-
vsphereVolume
@Stability(Stable) public Volume.Builder vsphereVolume(VsphereVirtualDiskVolumeSource vsphereVolume)
Sets the value ofVolume.getVsphereVolume()
- Parameters:
vsphereVolume
- vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine.- Returns:
this
-
build
@Stability(Stable) public Volume build()
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<Volume>
- Returns:
- a new instance of
Volume
- Throws:
NullPointerException
- if any required attribute was not provided
-
-