Class CSIStorageCapacity

  • All Implemented Interfaces:
    com.marcnuri.yakc.model.Model

    public class CSIStorageCapacity
    extends java.lang.Object
    implements com.marcnuri.yakc.model.Model
    CSIStorageCapacity stores the result of one CSI GetCapacity call. For a given StorageClass, this describes the available capacity in a particular topology segment. This can be used when considering where to instantiate new PersistentVolumes.


    For example this can express things like: - StorageClass "standard" has "1234 GiB" available in "topology.kubernetes.io/zone=us-east1" - StorageClass "localssd" has "10 GiB" available in "kubernetes.io/hostname=knode-abc123"


    The following three cases all imply that no capacity is available for a certain combination: - no object exists with suitable topology and storage class name - such an object exists, but the capacity is unset - such an object exists, but the capacity is zero


    The producer of these objects can decide which approach is more suitable.


    They are consumed by the kube-scheduler when a CSI driver opts into capacity-aware scheduling with CSIDriverSpec.StorageCapacity. The scheduler compares the MaximumVolumeSize against the requested size of pending volumes to filter out unsuitable nodes. If MaximumVolumeSize is unset, it falls back to a comparison against the less precise Capacity. If that is also unset, the scheduler assumes that capacity is insufficient and tries some other node.

    • Constructor Detail

      • CSIStorageCapacity

        public CSIStorageCapacity​(java.lang.String apiVersion,
                                  java.lang.String capacity,
                                  java.lang.String kind,
                                  java.lang.String maximumVolumeSize,
                                  ObjectMeta metadata,
                                  LabelSelector nodeTopology,
                                  @NonNull
                                  @NonNull java.lang.String storageClassName)
      • CSIStorageCapacity

        public CSIStorageCapacity()
    • Method Detail

      • getApiVersion

        public java.lang.String getApiVersion()
        APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
      • getCapacity

        public java.lang.String getCapacity()
      • getKind

        public java.lang.String getKind()
        Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
      • getMaximumVolumeSize

        public java.lang.String getMaximumVolumeSize()
      • getStorageClassName

        @NonNull
        public @NonNull java.lang.String getStorageClassName()
        storageClassName represents the name of the StorageClass that the reported capacity applies to. It must meet the same requirements as the name of a StorageClass object (non-empty, DNS subdomain). If that object no longer exists, the CSIStorageCapacity object is obsolete and should be removed by its creator. This field is immutable.
      • setApiVersion

        public void setApiVersion​(java.lang.String apiVersion)
        APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
      • setCapacity

        public void setCapacity​(java.lang.String capacity)
      • setKind

        public void setKind​(java.lang.String kind)
        Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
      • setMaximumVolumeSize

        public void setMaximumVolumeSize​(java.lang.String maximumVolumeSize)
      • setMetadata

        public void setMetadata​(ObjectMeta metadata)
      • setNodeTopology

        public void setNodeTopology​(LabelSelector nodeTopology)
      • setStorageClassName

        public void setStorageClassName​(@NonNull
                                        @NonNull java.lang.String storageClassName)
        storageClassName represents the name of the StorageClass that the reported capacity applies to. It must meet the same requirements as the name of a StorageClass object (non-empty, DNS subdomain). If that object no longer exists, the CSIStorageCapacity object is obsolete and should be removed by its creator. This field is immutable.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object