@soft-stech/autoscaler
Version:
Kubernetes Autoscaler models
285 lines (284 loc) • 12.7 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VerticalPodAutoscaler = 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 = "autoscaling.k8s.io.v1beta2.VerticalPodAutoscaler";
const schema = {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"enum": [
"autoscaling.k8s.io/v1beta2"
]
},
"kind": {
"type": "string",
"enum": [
"VerticalPodAutoscaler"
]
},
"metadata": {
"oneOf": [
{
"$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#"
},
{
"type": "null"
}
]
},
"spec": {
"properties": {
"resourcePolicy": {
"properties": {
"containerPolicies": {
"items": {
"properties": {
"containerName": {
"type": "string",
"nullable": true
},
"maxAllowed": {
"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
},
"minAllowed": {
"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
},
"mode": {
"enum": [
"Auto",
"Off"
],
"type": "string",
"nullable": true
}
},
"type": "object"
},
"type": "array",
"nullable": true
}
},
"type": "object",
"nullable": true
},
"targetRef": {
"properties": {
"apiVersion": {
"type": "string",
"nullable": true
},
"kind": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"kind",
"name"
],
"type": "object"
},
"updatePolicy": {
"properties": {
"updateMode": {
"enum": [
"Off",
"Initial",
"Recreate",
"Auto"
],
"type": "string",
"nullable": true
}
},
"type": "object",
"nullable": true
}
},
"required": [
"targetRef"
],
"type": "object"
},
"status": {
"properties": {
"conditions": {
"items": {
"properties": {
"lastTransitionTime": {
"format": "date-time",
"type": "string",
"nullable": true
},
"message": {
"type": "string",
"nullable": true
},
"reason": {
"type": "string",
"nullable": true
},
"status": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"status",
"type"
],
"type": "object"
},
"type": "array",
"nullable": true
},
"recommendation": {
"properties": {
"containerRecommendations": {
"items": {
"properties": {
"containerName": {
"type": "string",
"nullable": true
},
"lowerBound": {
"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
},
"target": {
"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": {}
},
"uncappedTarget": {
"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
},
"upperBound": {
"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
}
},
"required": [
"target"
],
"type": "object"
},
"type": "array",
"nullable": true
}
},
"type": "object",
"nullable": true
}
},
"type": "object",
"nullable": true
}
},
"required": [
"spec",
"apiVersion",
"kind"
]
};
/**
* VerticalPodAutoscaler is the configuration for a vertical pod autoscaler, which automatically manages pod resources based on historical and real time resource utilization.
*/
class VerticalPodAutoscaler extends base_1.Model {
constructor(data) {
super({
apiVersion: VerticalPodAutoscaler.apiVersion,
kind: VerticalPodAutoscaler.kind,
...data
});
}
}
exports.VerticalPodAutoscaler = VerticalPodAutoscaler;
VerticalPodAutoscaler.apiVersion = "autoscaling.k8s.io/v1beta2";
VerticalPodAutoscaler.kind = "VerticalPodAutoscaler";
VerticalPodAutoscaler.is = (0, base_1.createTypeMetaGuard)(VerticalPodAutoscaler);
(0, base_1.setSchema)(VerticalPodAutoscaler, schemaId, () => {
(0, IoK8sApimachineryPkgApisMetaV1ObjectMeta_1.addSchema)();
(0, validate_1.register)(schemaId, schema);
});