kubernetes-models
Version:
32 lines (31 loc) • 2.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.IoK8sApiStorageV1CSIStorageCapacity = exports.CSIStorageCapacity = void 0;
const base_1 = require("@kubernetes-models/base");
const IoK8sApiStorageV1CSIStorageCapacity_1 = require("../../_schemas/IoK8sApiStorageV1CSIStorageCapacity.js");
/**
* 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.
*/
class CSIStorageCapacity extends base_1.Model {
constructor(data) {
super({
apiVersion: CSIStorageCapacity.apiVersion,
kind: CSIStorageCapacity.kind,
...data
});
}
}
exports.CSIStorageCapacity = CSIStorageCapacity;
exports.IoK8sApiStorageV1CSIStorageCapacity = CSIStorageCapacity;
CSIStorageCapacity.apiVersion = "storage.k8s.io/v1";
CSIStorageCapacity.kind = "CSIStorageCapacity";
CSIStorageCapacity.is = (0, base_1.createTypeMetaGuard)(CSIStorageCapacity);
(0, base_1.setSchema)(CSIStorageCapacity, "io.k8s.api.storage.v1.CSIStorageCapacity", IoK8sApiStorageV1CSIStorageCapacity_1.addSchema);