@soft-stech/keda
Version:
KEDA(Kubernetes Event-driven Autoscaling) models
404 lines (403 loc) • 16.6 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ScaledObject = 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 = "keda.sh.v1alpha1.ScaledObject";
const schema = {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"enum": [
"keda.sh/v1alpha1"
]
},
"kind": {
"type": "string",
"enum": [
"ScaledObject"
]
},
"metadata": {
"oneOf": [
{
"$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#"
},
{
"type": "null"
}
]
},
"spec": {
"properties": {
"advanced": {
"properties": {
"horizontalPodAutoscalerConfig": {
"properties": {
"behavior": {
"properties": {
"scaleDown": {
"properties": {
"policies": {
"items": {
"properties": {
"periodSeconds": {
"format": "int32",
"type": "integer"
},
"type": {
"type": "string"
},
"value": {
"format": "int32",
"type": "integer"
}
},
"required": [
"periodSeconds",
"type",
"value"
],
"type": "object"
},
"type": "array",
"nullable": true
},
"selectPolicy": {
"type": "string",
"nullable": true
},
"stabilizationWindowSeconds": {
"format": "int32",
"type": "integer",
"nullable": true
}
},
"type": "object",
"nullable": true
},
"scaleUp": {
"properties": {
"policies": {
"items": {
"properties": {
"periodSeconds": {
"format": "int32",
"type": "integer"
},
"type": {
"type": "string"
},
"value": {
"format": "int32",
"type": "integer"
}
},
"required": [
"periodSeconds",
"type",
"value"
],
"type": "object"
},
"type": "array",
"nullable": true
},
"selectPolicy": {
"type": "string",
"nullable": true
},
"stabilizationWindowSeconds": {
"format": "int32",
"type": "integer",
"nullable": true
}
},
"type": "object",
"nullable": true
}
},
"type": "object",
"nullable": true
},
"name": {
"type": "string",
"nullable": true
}
},
"type": "object",
"nullable": true
},
"restoreToOriginalReplicaCount": {
"type": "boolean",
"nullable": true
}
},
"type": "object",
"nullable": true
},
"cooldownPeriod": {
"format": "int32",
"type": "integer",
"nullable": true
},
"fallback": {
"properties": {
"failureThreshold": {
"format": "int32",
"type": "integer"
},
"replicas": {
"format": "int32",
"type": "integer"
}
},
"required": [
"failureThreshold",
"replicas"
],
"type": "object",
"nullable": true
},
"idleReplicaCount": {
"format": "int32",
"type": "integer",
"nullable": true
},
"maxReplicaCount": {
"format": "int32",
"type": "integer",
"nullable": true
},
"minReplicaCount": {
"format": "int32",
"type": "integer",
"nullable": true
},
"pollingInterval": {
"format": "int32",
"type": "integer",
"nullable": true
},
"scaleTargetRef": {
"properties": {
"apiVersion": {
"type": "string",
"nullable": true
},
"envSourceContainerName": {
"type": "string",
"nullable": true
},
"kind": {
"type": "string",
"nullable": true
},
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"triggers": {
"items": {
"properties": {
"authenticationRef": {
"properties": {
"kind": {
"type": "string",
"nullable": true
},
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object",
"nullable": true
},
"metadata": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"properties": {}
},
"metricType": {
"type": "string",
"nullable": true
},
"name": {
"type": "string",
"nullable": true
},
"type": {
"type": "string"
},
"useCachedMetrics": {
"type": "boolean",
"nullable": true
}
},
"required": [
"metadata",
"type"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"scaleTargetRef",
"triggers"
],
"type": "object"
},
"status": {
"properties": {
"conditions": {
"items": {
"properties": {
"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
},
"externalMetricNames": {
"items": {
"type": "string"
},
"type": "array",
"nullable": true
},
"health": {
"additionalProperties": {
"properties": {
"numberOfFailures": {
"format": "int32",
"type": "integer",
"nullable": true
},
"status": {
"type": "string",
"nullable": true
}
},
"type": "object"
},
"type": "object",
"properties": {},
"nullable": true
},
"hpaName": {
"type": "string",
"nullable": true
},
"lastActiveTime": {
"format": "date-time",
"type": "string",
"nullable": true
},
"originalReplicaCount": {
"format": "int32",
"type": "integer",
"nullable": true
},
"pausedReplicaCount": {
"format": "int32",
"type": "integer",
"nullable": true
},
"resourceMetricNames": {
"items": {
"type": "string"
},
"type": "array",
"nullable": true
},
"scaleTargetGVKR": {
"properties": {
"group": {
"type": "string"
},
"kind": {
"type": "string"
},
"resource": {
"type": "string"
},
"version": {
"type": "string"
}
},
"required": [
"group",
"kind",
"resource",
"version"
],
"type": "object",
"nullable": true
},
"scaleTargetKind": {
"type": "string",
"nullable": true
}
},
"type": "object",
"nullable": true
}
},
"required": [
"spec",
"apiVersion",
"kind"
]
};
/**
* ScaledObject is a specification for a ScaledObject resource
*/
class ScaledObject extends base_1.Model {
constructor(data) {
super({
apiVersion: ScaledObject.apiVersion,
kind: ScaledObject.kind,
...data
});
}
}
exports.ScaledObject = ScaledObject;
ScaledObject.apiVersion = "keda.sh/v1alpha1";
ScaledObject.kind = "ScaledObject";
ScaledObject.is = (0, base_1.createTypeMetaGuard)(ScaledObject);
(0, base_1.setSchema)(ScaledObject, schemaId, () => {
(0, IoK8sApimachineryPkgApisMetaV1ObjectMeta_1.addSchema)();
(0, validate_1.register)(schemaId, schema);
});