Class CSIStorageCapacity
- java.lang.Object
-
- com.marcnuri.yakc.model.io.k8s.api.storage.v1.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CSIStorageCapacity.Builder
-
Constructor Summary
Constructors Constructor Description CSIStorageCapacity()
CSIStorageCapacity(java.lang.String apiVersion, java.lang.String capacity, java.lang.String kind, java.lang.String maximumVolumeSize, ObjectMeta metadata, LabelSelector nodeTopology, @NonNull java.lang.String storageClassName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CSIStorageCapacity.Builder
builder()
protected boolean
canEqual(java.lang.Object other)
boolean
equals(java.lang.Object o)
java.lang.String
getApiVersion()
APIVersion defines the versioned schema of this representation of an object.java.lang.String
getCapacity()
java.lang.String
getKind()
Kind is a string value representing the REST resource this object represents.java.lang.String
getMaximumVolumeSize()
ObjectMeta
getMetadata()
LabelSelector
getNodeTopology()
@NonNull java.lang.String
getStorageClassName()
storageClassName represents the name of the StorageClass that the reported capacity applies to.int
hashCode()
void
setApiVersion(java.lang.String apiVersion)
APIVersion defines the versioned schema of this representation of an object.void
setCapacity(java.lang.String capacity)
void
setKind(java.lang.String kind)
Kind is a string value representing the REST resource this object represents.void
setMaximumVolumeSize(java.lang.String maximumVolumeSize)
void
setMetadata(ObjectMeta metadata)
void
setNodeTopology(LabelSelector nodeTopology)
void
setStorageClassName(@NonNull java.lang.String storageClassName)
storageClassName represents the name of the StorageClass that the reported capacity applies to.CSIStorageCapacity.Builder
toBuilder()
java.lang.String
toString()
-
-
-
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
-
builder
public static CSIStorageCapacity.Builder builder()
-
toBuilder
public CSIStorageCapacity.Builder toBuilder()
-
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()
-
getMetadata
public ObjectMeta getMetadata()
-
getNodeTopology
public LabelSelector getNodeTopology()
-
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 classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-