mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 15:13:08 +00:00
Merge pull request #60096 from MaciekPytel/hpa_api_ext
Automatic merge from submit-queue (batch tested with PRs 60208, 60084, 60183, 59713, 60096). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Add external metric type to HPA API **What this PR does / why we need it**: Add external metric type to HPA API proposed in xref https://github.com/kubernetes/community/pull/1801 **Release note**: ```release-note Allows HorizontalPodAutoscaler to use global metrics not associated with any Kubernetes object (for example metrics from a hoster service running outside of Kubernetes cluster). ```
This commit is contained in:
57
api/openapi-spec/swagger.json
generated
57
api/openapi-spec/swagger.json
generated
@@ -74123,6 +74123,55 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"io.k8s.api.autoscaling.v2beta1.ExternalMetricSource": {
|
||||
"description": "ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster). Exactly one \"target\" type should be set.",
|
||||
"required": [
|
||||
"metricName"
|
||||
],
|
||||
"properties": {
|
||||
"metricName": {
|
||||
"description": "metricName is the name of the metric in question.",
|
||||
"type": "string"
|
||||
},
|
||||
"metricSelector": {
|
||||
"description": "metricSelector is used to identify a specific time series within a given metric.",
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"
|
||||
},
|
||||
"targetAverageValue": {
|
||||
"description": "targetAverageValue is the target per-pod value of global metric (as a quantity). Mutually exclusive with TargetValue.",
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"
|
||||
},
|
||||
"targetValue": {
|
||||
"description": "targetValue is the target value of the metric (as a quantity). Mutually exclusive with TargetAverageValue.",
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"
|
||||
}
|
||||
}
|
||||
},
|
||||
"io.k8s.api.autoscaling.v2beta1.ExternalMetricStatus": {
|
||||
"description": "ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object.",
|
||||
"required": [
|
||||
"metricName",
|
||||
"currentValue"
|
||||
],
|
||||
"properties": {
|
||||
"currentAverageValue": {
|
||||
"description": "currentAverageValue is the current value of metric averaged over autoscaled pods.",
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"
|
||||
},
|
||||
"currentValue": {
|
||||
"description": "currentValue is the current value of the metric (as a quantity)",
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"
|
||||
},
|
||||
"metricName": {
|
||||
"description": "metricName is the name of a metric used for autoscaling in metric system.",
|
||||
"type": "string"
|
||||
},
|
||||
"metricSelector": {
|
||||
"description": "metricSelector is used to identify a specific time series within a given metric.",
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"
|
||||
}
|
||||
}
|
||||
},
|
||||
"io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscaler": {
|
||||
"description": "HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified.",
|
||||
"properties": {
|
||||
@@ -74298,6 +74347,10 @@
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"external": {
|
||||
"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).",
|
||||
"$ref": "#/definitions/io.k8s.api.autoscaling.v2beta1.ExternalMetricSource"
|
||||
},
|
||||
"object": {
|
||||
"description": "object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object).",
|
||||
"$ref": "#/definitions/io.k8s.api.autoscaling.v2beta1.ObjectMetricSource"
|
||||
@@ -74322,6 +74375,10 @@
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"external": {
|
||||
"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).",
|
||||
"$ref": "#/definitions/io.k8s.api.autoscaling.v2beta1.ExternalMetricStatus"
|
||||
},
|
||||
"object": {
|
||||
"description": "object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object).",
|
||||
"$ref": "#/definitions/io.k8s.api.autoscaling.v2beta1.ObjectMetricStatus"
|
||||
|
101
api/swagger-spec/autoscaling_v2beta1.json
generated
101
api/swagger-spec/autoscaling_v2beta1.json
generated
@@ -1560,6 +1560,10 @@
|
||||
"resource": {
|
||||
"$ref": "v2beta1.ResourceMetricSource",
|
||||
"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."
|
||||
},
|
||||
"external": {
|
||||
"$ref": "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)."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1626,6 +1630,73 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"v2beta1.ExternalMetricSource": {
|
||||
"id": "v2beta1.ExternalMetricSource",
|
||||
"description": "ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster). Exactly one \"target\" type should be set.",
|
||||
"required": [
|
||||
"metricName"
|
||||
],
|
||||
"properties": {
|
||||
"metricName": {
|
||||
"type": "string",
|
||||
"description": "metricName is the name of the metric in question."
|
||||
},
|
||||
"metricSelector": {
|
||||
"$ref": "v1.LabelSelector",
|
||||
"description": "metricSelector is used to identify a specific time series within a given metric."
|
||||
},
|
||||
"targetValue": {
|
||||
"type": "string",
|
||||
"description": "targetValue is the target value of the metric (as a quantity). Mutually exclusive with TargetAverageValue."
|
||||
},
|
||||
"targetAverageValue": {
|
||||
"type": "string",
|
||||
"description": "targetAverageValue is the target per-pod value of global metric (as a quantity). Mutually exclusive with TargetValue."
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.LabelSelector": {
|
||||
"id": "v1.LabelSelector",
|
||||
"description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.",
|
||||
"properties": {
|
||||
"matchLabels": {
|
||||
"type": "object",
|
||||
"description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed."
|
||||
},
|
||||
"matchExpressions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "v1.LabelSelectorRequirement"
|
||||
},
|
||||
"description": "matchExpressions is a list of label selector requirements. The requirements are ANDed."
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.LabelSelectorRequirement": {
|
||||
"id": "v1.LabelSelectorRequirement",
|
||||
"description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
|
||||
"required": [
|
||||
"key",
|
||||
"operator"
|
||||
],
|
||||
"properties": {
|
||||
"key": {
|
||||
"type": "string",
|
||||
"description": "key is the label key that the selector applies to."
|
||||
},
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"description": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist."
|
||||
},
|
||||
"values": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "values is 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. This array is replaced during a strategic merge patch."
|
||||
}
|
||||
}
|
||||
},
|
||||
"v2beta1.HorizontalPodAutoscalerStatus": {
|
||||
"id": "v2beta1.HorizontalPodAutoscalerStatus",
|
||||
"description": "HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.",
|
||||
@@ -1693,6 +1764,10 @@
|
||||
"resource": {
|
||||
"$ref": "v2beta1.ResourceMetricStatus",
|
||||
"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."
|
||||
},
|
||||
"external": {
|
||||
"$ref": "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)."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1760,6 +1835,32 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"v2beta1.ExternalMetricStatus": {
|
||||
"id": "v2beta1.ExternalMetricStatus",
|
||||
"description": "ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object.",
|
||||
"required": [
|
||||
"metricName",
|
||||
"currentValue"
|
||||
],
|
||||
"properties": {
|
||||
"metricName": {
|
||||
"type": "string",
|
||||
"description": "metricName is the name of a metric used for autoscaling in metric system."
|
||||
},
|
||||
"metricSelector": {
|
||||
"$ref": "v1.LabelSelector",
|
||||
"description": "metricSelector is used to identify a specific time series within a given metric."
|
||||
},
|
||||
"currentValue": {
|
||||
"type": "string",
|
||||
"description": "currentValue is the current value of the metric (as a quantity)"
|
||||
},
|
||||
"currentAverageValue": {
|
||||
"type": "string",
|
||||
"description": "currentAverageValue is the current value of metric averaged over autoscaled pods."
|
||||
}
|
||||
}
|
||||
},
|
||||
"v2beta1.HorizontalPodAutoscalerCondition": {
|
||||
"id": "v2beta1.HorizontalPodAutoscalerCondition",
|
||||
"description": "HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a certain point.",
|
||||
|
Reference in New Issue
Block a user