UNPKG

@soft-stech/karpenter

Version:
482 lines (481 loc) 24.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NodePool = void 0; const IoK8sApimachineryPkgApisMetaV1ObjectMeta_1 = require("@soft-stech/apimachinery/_schemas/IoK8sApimachineryPkgApisMetaV1ObjectMeta"); const base_1 = require("@soft-stech/base"); const validate_1 = require("@soft-stech/validate"); const schemaId = "karpenter.sh.v1beta1.NodePool"; const schema = { "type": "object", "properties": { "apiVersion": { "type": "string", "enum": [ "karpenter.sh/v1beta1" ] }, "kind": { "type": "string", "enum": [ "NodePool" ] }, "metadata": { "oneOf": [ { "$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#" }, { "type": "null" } ] }, "spec": { "properties": { "disruption": { "default": { "consolidationPolicy": "WhenUnderutilized", "expireAfter": "720h" }, "properties": { "budgets": { "default": [ { "nodes": "10%" } ], "items": { "properties": { "duration": { "type": "string", "pattern": "^((([0-9]+(h|m))|([0-9]+h[0-9]+m))(0s)?)$", "nullable": true }, "nodes": { "default": "10%", "type": "string", "pattern": "^((100|[0-9]{1,2})%|[0-9]+)$" }, "schedule": { "type": "string", "pattern": "^(@(annually|yearly|monthly|weekly|daily|midnight|hourly))|((.+)\\s(.+)\\s(.+)\\s(.+)\\s(.+))$", "nullable": true } }, "required": [ "nodes" ], "type": "object" }, "maxItems": 50, "type": "array", "nullable": true }, "consolidateAfter": { "type": "string", "pattern": "^(([0-9]+(s|m|h))+)|(Never)$", "nullable": true }, "consolidationPolicy": { "default": "WhenUnderutilized", "enum": [ "WhenEmpty", "WhenUnderutilized" ], "type": "string", "nullable": true }, "expireAfter": { "default": "720h", "type": "string", "pattern": "^(([0-9]+(s|m|h))+)|(Never)$", "nullable": true } }, "type": "object", "nullable": true }, "limits": { "additionalProperties": { "anyOf": [ { "type": "integer" }, { "type": "string" } ], "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$" }, "type": "object", "properties": {}, "nullable": true }, "template": { "properties": { "metadata": { "properties": { "annotations": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true }, "labels": { "additionalProperties": { "type": "string", "maxLength": 63, "pattern": "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" }, "type": "object", "maxProperties": 100, "properties": {}, "nullable": true } }, "type": "object", "nullable": true }, "spec": { "properties": { "kubelet": { "properties": { "clusterDNS": { "items": { "type": "string" }, "type": "array", "nullable": true }, "cpuCFSQuota": { "type": "boolean", "nullable": true }, "evictionHard": { "additionalProperties": { "type": "string", "pattern": "^((\\d{1,2}(\\.\\d{1,2})?|100(\\.0{1,2})?)%||(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?)$" }, "type": "object", "properties": {}, "nullable": true }, "evictionMaxPodGracePeriod": { "format": "int32", "type": "integer", "nullable": true }, "evictionSoft": { "additionalProperties": { "type": "string", "pattern": "^((\\d{1,2}(\\.\\d{1,2})?|100(\\.0{1,2})?)%||(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?)$" }, "type": "object", "properties": {}, "nullable": true }, "evictionSoftGracePeriod": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true }, "imageGCHighThresholdPercent": { "format": "int32", "type": "integer", "minimum": 0, "maximum": 100, "nullable": true }, "imageGCLowThresholdPercent": { "format": "int32", "type": "integer", "minimum": 0, "maximum": 100, "nullable": true }, "kubeReserved": { "additionalProperties": { "anyOf": [ { "type": "integer" }, { "type": "string" } ], "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$" }, "type": "object", "properties": {}, "nullable": true }, "maxPods": { "format": "int32", "type": "integer", "minimum": 0, "nullable": true }, "podsPerCore": { "format": "int32", "type": "integer", "minimum": 0, "nullable": true }, "systemReserved": { "additionalProperties": { "anyOf": [ { "type": "integer" }, { "type": "string" } ], "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$" }, "type": "object", "properties": {}, "nullable": true } }, "type": "object", "nullable": true }, "nodeClassRef": { "properties": { "apiVersion": { "type": "string", "nullable": true }, "kind": { "type": "string", "nullable": true }, "name": { "type": "string" } }, "required": [ "name" ], "type": "object" }, "requirements": { "items": { "properties": { "key": { "type": "string", "maxLength": 316, "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$" }, "minValues": { "type": "integer", "minimum": 1, "maximum": 50, "nullable": true }, "operator": { "type": "string", "enum": [ "In", "NotIn", "Exists", "DoesNotExist", "Gt", "Lt" ] }, "values": { "items": { "type": "string" }, "type": "array", "maxLength": 63, "pattern": "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$", "nullable": true } }, "required": [ "key", "operator" ], "type": "object" }, "maxItems": 30, "type": "array" }, "resources": { "properties": { "requests": { "additionalProperties": { "anyOf": [ { "type": "integer" }, { "type": "string" } ], "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$" }, "type": "object", "properties": {}, "nullable": true } }, "type": "object", "maxProperties": 0, "nullable": true }, "startupTaints": { "items": { "properties": { "effect": { "type": "string", "enum": [ "NoSchedule", "PreferNoSchedule", "NoExecute" ] }, "key": { "type": "string", "minLength": 1, "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$" }, "timeAdded": { "format": "date-time", "type": "string", "nullable": true }, "value": { "type": "string", "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$", "nullable": true } }, "required": [ "effect", "key" ], "type": "object" }, "type": "array", "nullable": true }, "taints": { "items": { "properties": { "effect": { "type": "string", "enum": [ "NoSchedule", "PreferNoSchedule", "NoExecute" ] }, "key": { "type": "string", "minLength": 1, "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$" }, "timeAdded": { "format": "date-time", "type": "string", "nullable": true }, "value": { "type": "string", "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$", "nullable": true } }, "required": [ "effect", "key" ], "type": "object" }, "type": "array", "nullable": true } }, "required": [ "nodeClassRef", "requirements" ], "type": "object" } }, "required": [ "spec" ], "type": "object" }, "weight": { "format": "int32", "type": "integer", "minimum": 1, "maximum": 100, "nullable": true } }, "required": [ "template" ], "type": "object" }, "status": { "properties": { "resources": { "additionalProperties": { "anyOf": [ { "type": "integer" }, { "type": "string" } ], "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$" }, "type": "object", "properties": {}, "nullable": true } }, "type": "object", "nullable": true } }, "required": [ "spec", "apiVersion", "kind" ] }; /** * NodePool is the Schema for the NodePools API */ class NodePool extends base_1.Model { constructor(data) { super({ apiVersion: NodePool.apiVersion, kind: NodePool.kind, ...data }); } } exports.NodePool = NodePool; NodePool.apiVersion = "karpenter.sh/v1beta1"; NodePool.kind = "NodePool"; NodePool.is = (0, base_1.createTypeMetaGuard)(NodePool); (0, base_1.setSchema)(NodePool, schemaId, () => { (0, IoK8sApimachineryPkgApisMetaV1ObjectMeta_1.addSchema)(); (0, validate_1.register)(schemaId, schema); });