@soft-stech/karpenter
Version:
281 lines (280 loc) • 14.3 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.INodeClaimSchema = void 0;
// Generated by ts-to-zod
const zod_1 = require("zod");
const ObjectMeta_schema_1 = require("@soft-stech/apimachinery/apis/meta/v1/ObjectMeta.schema");
/**
* NodeClaim is the Schema for the NodeClaims API
*/
exports.INodeClaimSchema = zod_1.z.object({
/**
* 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
*/
"apiVersion": zod_1.z.literal("karpenter.sh/v1beta1"),
/**
* 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
*/
"kind": zod_1.z.literal("NodeClaim"),
"metadata": ObjectMeta_schema_1.iObjectMetaSchema.optional(),
/**
* NodeClaimSpec describes the desired state of the NodeClaim
*/
"spec": zod_1.z.object({
/**
* Kubelet defines args to be used when configuring kubelet on provisioned nodes.
* They are a subset of the upstream types, recognizing not all options may be supported.
* Wherever possible, the types and names should reflect the upstream kubelet types.
*/
"kubelet": zod_1.z.object({
/**
* clusterDNS is a list of IP addresses for the cluster DNS server.
* Note that not all providers may use all addresses.
*/
"clusterDNS": zod_1.z.array(zod_1.z.string()).optional(),
/**
* CPUCFSQuota enables CPU CFS quota enforcement for containers that specify CPU limits.
*/
"cpuCFSQuota": zod_1.z.boolean().optional(),
/**
* EvictionHard is the map of signal names to quantities that define hard eviction thresholds
*/
"evictionHard": zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
/**
* EvictionMaxPodGracePeriod is the maximum allowed grace period (in seconds) to use when terminating pods in
* response to soft eviction thresholds being met.
* @format int32
*/
"evictionMaxPodGracePeriod": zod_1.z.int32().optional(),
/**
* EvictionSoft is the map of signal names to quantities that define soft eviction thresholds
*/
"evictionSoft": zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
/**
* EvictionSoftGracePeriod is the map of signal names to quantities that define grace periods for each eviction signal
*/
"evictionSoftGracePeriod": zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
/**
* ImageGCHighThresholdPercent is the percent of disk usage after which image
* garbage collection is always run. The percent is calculated by dividing this
* field value by 100, so this field must be between 0 and 100, inclusive.
* When specified, the value must be greater than ImageGCLowThresholdPercent.
* @maximum 100
* @format int32
*/
"imageGCHighThresholdPercent": zod_1.z.int32().max(100).optional(),
/**
* ImageGCLowThresholdPercent is the percent of disk usage before which image
* garbage collection is never run. Lowest disk usage to garbage collect to.
* The percent is calculated by dividing this field value by 100,
* so the field value must be between 0 and 100, inclusive.
* When specified, the value must be less than imageGCHighThresholdPercent
* @maximum 100
* @format int32
*/
"imageGCLowThresholdPercent": zod_1.z.int32().max(100).optional(),
/**
* KubeReserved contains resources reserved for Kubernetes system components.
*/
"kubeReserved": zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.number(), zod_1.z.string()])).optional(),
/**
* MaxPods is an override for the maximum number of pods that can run on
* a worker node instance.
* @format int32
*/
"maxPods": zod_1.z.int32().optional(),
/**
* PodsPerCore is an override for the number of pods that can run on a worker node
* instance based on the number of cpu cores. This value cannot exceed MaxPods, so, if
* MaxPods is a lower value, that value will be used.
* @format int32
*/
"podsPerCore": zod_1.z.int32().optional(),
/**
* SystemReserved contains resources reserved for OS system daemons and kernel memory.
*/
"systemReserved": zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.number(), zod_1.z.string()])).optional()
}).optional(),
/**
* NodeClassRef is a reference to an object that defines provider specific configuration
*/
"nodeClassRef": zod_1.z.object({
/**
* API version of the referent
*/
"apiVersion": zod_1.z.string().optional(),
/**
* Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"
*/
"kind": zod_1.z.string().optional(),
/**
* Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
*/
"name": zod_1.z.string()
}),
/**
* Requirements are layered with GetLabels and applied to every node.
*/
"requirements": zod_1.z.array(zod_1.z.object({
/**
* The label key that the selector applies to.
* @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]$
*/
"key": zod_1.z.string().max(316).regex(/^([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]$/),
/**
* This field is ALPHA and can be dropped or replaced at any time
* MinValues is the minimum number of unique values required to define the flexibility of the specific requirement.
* @minimum 1
* @maximum 50
*/
"minValues": zod_1.z.number().min(1).max(50).optional(),
/**
* Represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
*/
"operator": zod_1.z.union([zod_1.z.literal("In"), zod_1.z.literal("NotIn"), zod_1.z.literal("Exists"), zod_1.z.literal("DoesNotExist"), zod_1.z.literal("Gt"), zod_1.z.literal("Lt")]),
/**
* An array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. If the operator is Gt or Lt, the values
* array must have a single element, which will be interpreted as an integer.
* This array is replaced during a strategic merge patch.
* @maxLength 63
*/
"values": zod_1.z.array(zod_1.z.string()).max(63).optional()
})),
/**
* Resources models the resource requirements for the NodeClaim to launch
*/
"resources": zod_1.z.object({
/**
* Requests describes the minimum required resources for the NodeClaim to launch
*/
"requests": zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.number(), zod_1.z.string()])).optional()
}).optional(),
/**
* StartupTaints are taints that are applied to nodes upon startup which are expected to be removed automatically
* within a short period of time, typically by a DaemonSet that tolerates the taint. These are commonly used by
* daemonsets to allow initialization and enforce startup ordering. StartupTaints are ignored for provisioning
* purposes in that pods are not required to tolerate a StartupTaint in order to have nodes provisioned for them.
*/
"startupTaints": zod_1.z.array(zod_1.z.object({
/**
* Required. The effect of the taint on pods
* that do not tolerate the taint.
* Valid effects are NoSchedule, PreferNoSchedule and NoExecute.
*/
"effect": zod_1.z.union([zod_1.z.literal("NoSchedule"), zod_1.z.literal("PreferNoSchedule"), zod_1.z.literal("NoExecute")]),
/**
* Required. The taint key to be applied to a node.
* @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]$
*/
"key": zod_1.z.string().min(1).regex(/^([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 represents the time at which the taint was added.
* It is only written for NoExecute taints.
* @format date-time
*/
"timeAdded": zod_1.z.iso.datetime().optional().nullable(),
/**
* The taint value corresponding to the taint key.
* @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]$
*/
"value": zod_1.z.string().regex(/^([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]$/).optional()
})).optional(),
/**
* Taints will be applied to the NodeClaim's node.
*/
"taints": zod_1.z.array(zod_1.z.object({
/**
* Required. The effect of the taint on pods
* that do not tolerate the taint.
* Valid effects are NoSchedule, PreferNoSchedule and NoExecute.
*/
"effect": zod_1.z.union([zod_1.z.literal("NoSchedule"), zod_1.z.literal("PreferNoSchedule"), zod_1.z.literal("NoExecute")]),
/**
* Required. The taint key to be applied to a node.
* @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]$
*/
"key": zod_1.z.string().min(1).regex(/^([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 represents the time at which the taint was added.
* It is only written for NoExecute taints.
* @format date-time
*/
"timeAdded": zod_1.z.iso.datetime().optional().nullable(),
/**
* The taint value corresponding to the taint key.
* @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]$
*/
"value": zod_1.z.string().regex(/^([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]$/).optional()
})).optional()
}),
/**
* NodeClaimStatus defines the observed state of NodeClaim
*/
"status": zod_1.z.object({
/**
* Allocatable is the estimated allocatable capacity of the node
*/
"allocatable": zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.number(), zod_1.z.string()])).optional(),
/**
* Capacity is the estimated full capacity of the node
*/
"capacity": zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.number(), zod_1.z.string()])).optional(),
/**
* Conditions contains signals for health and readiness
*/
"conditions": zod_1.z.array(zod_1.z.object({
/**
* LastTransitionTime is the last time the condition transitioned from one status to another.
* We use VolatileTime in place of metav1.Time to exclude this from creating equality.Semantic
* differences (all other things held constant).
*/
"lastTransitionTime": zod_1.z.string().optional(),
/**
* A human readable message indicating details about the transition.
*/
"message": zod_1.z.string().optional(),
/**
* The reason for the condition's last transition.
*/
"reason": zod_1.z.string().optional(),
/**
* Severity with which to treat failures of this type of condition.
* When this is not specified, it defaults to Error.
*/
"severity": zod_1.z.string().optional(),
/**
* Status of the condition, one of True, False, Unknown.
*/
"status": zod_1.z.string(),
/**
* Type of condition.
*/
"type": zod_1.z.string()
})).optional(),
/**
* ImageID is an identifier for the image that runs on the node
*/
"imageID": zod_1.z.string().optional(),
/**
* NodeName is the name of the corresponding node object
*/
"nodeName": zod_1.z.string().optional(),
/**
* ProviderID of the corresponding node object
*/
"providerID": zod_1.z.string().optional()
}).optional()
});