@soft-stech/autoscaler
Version:
Kubernetes Autoscaler models
94 lines (93 loc) • 3.85 kB
JavaScript
import { z } from "zod";
import { iObjectMetaSchema } from "@soft-stech/apimachinery/apis/meta/v1/ObjectMeta.schema";
/**
* VerticalPodAutoscalerCheckpoint is the checkpoint of the internal state of VPA that is used for recovery after recommender's restart.
*/
export const IVerticalPodAutoscalerCheckpointSchema = 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": z.literal("autoscaling.k8s.io/v1"),
/**
* 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": z.literal("VerticalPodAutoscalerCheckpoint"),
"metadata": iObjectMetaSchema.optional(),
/**
* Specification of the checkpoint. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
*/
"spec": z.object({
/**
* Name of the checkpointed container.
*/
"containerName": z.string().optional(),
/**
* Name of the VPA object that stored VerticalPodAutoscalerCheckpoint object.
*/
"vpaObjectName": z.string().optional()
}).optional(),
/**
* Data of the checkpoint.
*/
"status": z.object({
/**
* Checkpoint of histogram for consumption of CPU.
*/
"cpuHistogram": z.object({
/**
* Map from bucket index to bucket weight.
*/
"bucketWeights": z.object({}).optional(),
/**
* Reference timestamp for samples collected within this histogram.
* @format date-time
*/
"referenceTimestamp": z.string().datetime().optional().nullable(),
/**
* Sum of samples to be used as denominator for weights from BucketWeights.
*/
"totalWeight": z.number().optional()
}).optional(),
/**
* Timestamp of the fist sample from the histograms.
* @format date-time
*/
"firstSampleStart": z.string().datetime().optional().nullable(),
/**
* Timestamp of the last sample from the histograms.
* @format date-time
*/
"lastSampleStart": z.string().datetime().optional().nullable(),
/**
* The time when the status was last refreshed.
* @format date-time
*/
"lastUpdateTime": z.string().datetime().optional().nullable(),
/**
* Checkpoint of histogram for consumption of memory.
*/
"memoryHistogram": z.object({
/**
* Map from bucket index to bucket weight.
*/
"bucketWeights": z.object({}).optional(),
/**
* Reference timestamp for samples collected within this histogram.
* @format date-time
*/
"referenceTimestamp": z.string().datetime().optional().nullable(),
/**
* Sum of samples to be used as denominator for weights from BucketWeights.
*/
"totalWeight": z.number().optional()
}).optional(),
/**
* Total number of samples in the histograms.
*/
"totalSamplesCount": z.number().optional(),
/**
* Version of the format of the stored data.
*/
"version": z.string().optional()
}).optional()
});