Added functionality and API for pod autoscaling based on container resources

Signed-off-by: Arjun Naik <anaik@redhat.com>
This commit is contained in:
Arjun Naik
2020-10-21 11:29:17 +02:00
parent 7509c4eb47
commit 0fec7b0f7e
54 changed files with 5526 additions and 806 deletions

View File

@@ -3024,6 +3024,61 @@
],
"type": "object"
},
"io.k8s.api.autoscaling.v2beta1.ContainerResourceMetricSource": {
"description": "ContainerResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. Only one \"target\" type should be set.",
"properties": {
"container": {
"description": "container is the name of the container in the pods of the scaling target",
"type": "string"
},
"name": {
"description": "name is the name of the resource in question.",
"type": "string"
},
"targetAverageUtilization": {
"description": "targetAverageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods.",
"format": "int32",
"type": "integer"
},
"targetAverageValue": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity",
"description": "targetAverageValue is the target value of the average of the resource metric across all relevant pods, as a raw value (instead of as a percentage of the request), similar to the \"pods\" metric source type."
}
},
"required": [
"name",
"container"
],
"type": "object"
},
"io.k8s.api.autoscaling.v2beta1.ContainerResourceMetricStatus": {
"description": "ContainerResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing a single container in each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.",
"properties": {
"container": {
"description": "container is the name of the container in the pods of the scaling target",
"type": "string"
},
"currentAverageUtilization": {
"description": "currentAverageUtilization is the current value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. It will only be present if `targetAverageValue` was set in the corresponding metric specification.",
"format": "int32",
"type": "integer"
},
"currentAverageValue": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity",
"description": "currentAverageValue is the current value of the average of the resource metric across all relevant pods, as a raw value (instead of as a percentage of the request), similar to the \"pods\" metric source type. It will always be set, regardless of the corresponding metric specification."
},
"name": {
"description": "name is the name of the resource in question.",
"type": "string"
}
},
"required": [
"name",
"currentAverageValue",
"container"
],
"type": "object"
},
"io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference": {
"description": "CrossVersionObjectReference contains enough information to let you identify the referred resource.",
"properties": {
@@ -3273,6 +3328,10 @@
"io.k8s.api.autoscaling.v2beta1.MetricSpec": {
"description": "MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).",
"properties": {
"containerResource": {
"$ref": "#/definitions/io.k8s.api.autoscaling.v2beta1.ContainerResourceMetricSource",
"description": "container resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing a single container in each pod of the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. This is an alpha feature and can be enabled by the HPAContainerMetrics feature flag."
},
"external": {
"$ref": "#/definitions/io.k8s.api.autoscaling.v2beta1.ExternalMetricSource",
"description": "external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster)."
@@ -3290,7 +3349,7 @@
"description": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source."
},
"type": {
"description": "type is the type of metric source. It should be one of \"Object\", \"Pods\", \"Resource\" or \"External\", each mapping to a matching field in the object.",
"description": "type is the type of metric source. It should be one of \"ContainerResource\", \"External\", \"Object\", \"Pods\" or \"Resource\", each mapping to a matching field in the object. Note: \"ContainerResource\" type is available on when the feature-gate HPAContainerMetrics is enabled",
"type": "string"
}
},
@@ -3302,6 +3361,10 @@
"io.k8s.api.autoscaling.v2beta1.MetricStatus": {
"description": "MetricStatus describes the last-read state of a single metric.",
"properties": {
"containerResource": {
"$ref": "#/definitions/io.k8s.api.autoscaling.v2beta1.ContainerResourceMetricStatus",
"description": "container resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing a single container in each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source."
},
"external": {
"$ref": "#/definitions/io.k8s.api.autoscaling.v2beta1.ExternalMetricStatus",
"description": "external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster)."
@@ -3319,7 +3382,7 @@
"description": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source."
},
"type": {
"description": "type is the type of metric source. It will be one of \"Object\", \"Pods\" or \"Resource\", each corresponds to a matching field in the object.",
"description": "type is the type of metric source. It will be one of \"ContainerResource\", \"External\", \"Object\", \"Pods\" or \"Resource\", each corresponds to a matching field in the object. Note: \"ContainerResource\" type is available on when the feature-gate HPAContainerMetrics is enabled",
"type": "string"
}
},
@@ -3479,6 +3542,52 @@
],
"type": "object"
},
"io.k8s.api.autoscaling.v2beta2.ContainerResourceMetricSource": {
"description": "ContainerResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. Only one \"target\" type should be set.",
"properties": {
"container": {
"description": "container is the name of the container in the pods of the scaling target",
"type": "string"
},
"name": {
"description": "name is the name of the resource in question.",
"type": "string"
},
"target": {
"$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricTarget",
"description": "target specifies the target value for the given metric"
}
},
"required": [
"name",
"target",
"container"
],
"type": "object"
},
"io.k8s.api.autoscaling.v2beta2.ContainerResourceMetricStatus": {
"description": "ContainerResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing a single container in each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.",
"properties": {
"container": {
"description": "Container is the name of the container in the pods of the scaling target",
"type": "string"
},
"current": {
"$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.MetricValueStatus",
"description": "current contains the current value for the given metric"
},
"name": {
"description": "Name is the name of the resource in question.",
"type": "string"
}
},
"required": [
"name",
"current",
"container"
],
"type": "object"
},
"io.k8s.api.autoscaling.v2beta2.CrossVersionObjectReference": {
"description": "CrossVersionObjectReference contains enough information to let you identify the referred resource.",
"properties": {
@@ -3795,6 +3904,10 @@
"io.k8s.api.autoscaling.v2beta2.MetricSpec": {
"description": "MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).",
"properties": {
"containerResource": {
"$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.ContainerResourceMetricSource",
"description": "container resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing a single container in each pod of the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. This is an alpha feature and can be enabled by the HPAContainerMetrics feature flag."
},
"external": {
"$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.ExternalMetricSource",
"description": "external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster)."
@@ -3812,7 +3925,7 @@
"description": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source."
},
"type": {
"description": "type is the type of metric source. It should be one of \"Object\", \"Pods\", \"Resource\" or \"External\", each mapping to a matching field in the object.",
"description": "type is the type of metric source. It should be one of \"ContainerResource\", \"External\", \"Object\", \"Pods\" or \"Resource\", each mapping to a matching field in the object. Note: \"ContainerResource\" type is available on when the feature-gate HPAContainerMetrics is enabled",
"type": "string"
}
},
@@ -3824,6 +3937,10 @@
"io.k8s.api.autoscaling.v2beta2.MetricStatus": {
"description": "MetricStatus describes the last-read state of a single metric.",
"properties": {
"containerResource": {
"$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.ContainerResourceMetricStatus",
"description": "container resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing a single container in each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source."
},
"external": {
"$ref": "#/definitions/io.k8s.api.autoscaling.v2beta2.ExternalMetricStatus",
"description": "external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster)."
@@ -3841,7 +3958,7 @@
"description": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source."
},
"type": {
"description": "type is the type of metric source. It will be one of \"Object\", \"Pods\" or \"Resource\", each corresponds to a matching field in the object.",
"description": "type is the type of metric source. It will be one of \"ContainerResource\", \"External\", \"Object\", \"Pods\" or \"Resource\", each corresponds to a matching field in the object. Note: \"ContainerResource\" type is available on when the feature-gate HPAContainerMetrics is enabled",
"type": "string"
}
},