Class PersistentVolumeClaim.Builder

    • Method Detail

      • 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
      • 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