HorizontalPodAutoscaler [autoscaling/v2]
- 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.
- Type
object
Specification
.spec
- Description
- HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
- Type
object- Required
scaleTargetRefmaxReplicas
.spec.behavior
- Description
- HorizontalPodAutoscalerBehavior configures the scaling behavior of the target in both Up and Down directions (scaleUp and scaleDown fields respectively).
- Type
object
.spec.behavior.scaleDown
- Description
- HPAScalingRules configures the scaling behavior for one direction. These Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen.
- Type
object
.spec.behavior.scaleDown.policies
- Description
- policies is a list of potential scaling polices which can be used during scaling. At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid
- Type
array
.spec.behavior.scaleDown.policies[]
- Description
- HPAScalingPolicy is a single policy which must hold true for a specified past interval.
- Type
object- Required
typevalueperiodSeconds
.spec.behavior.scaleUp
- Description
- HPAScalingRules configures the scaling behavior for one direction. These Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen.
- Type
object
.spec.behavior.scaleUp.policies
- Description
- policies is a list of potential scaling polices which can be used during scaling. At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid
- Type
array
.spec.behavior.scaleUp.policies[]
- Description
- HPAScalingPolicy is a single policy which must hold true for a specified past interval.
- Type
object- Required
typevalueperiodSeconds
.spec.metrics
- Description
- metrics contains the specifications for which to use to calculate the desired replica count (the maximum replica count across all metrics will be used). The desired replica count is calculated multiplying the ratio between the target value and the current value by the current number of pods. Ergo, metrics used must decrease as the pod count is increased, and vice-versa. See the individual metric source types for more information about how each type of metric must respond. If not set, the default metric will be set to 80% average CPU utilization.
- Type
array
.spec.metrics[]
- Description
- MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).
- Type
object- Required
type
.spec.metrics[].containerResource
- 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.
- Type
object- Required
nametargetcontainer
.spec.metrics[].containerResource.target
- Description
- MetricTarget defines the target value, average value, or average utilization of a specific metric
- Type
object- Required
type
.spec.metrics[].external
- 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).
- Type
object- Required
metrictarget
.spec.metrics[].external.metric
- Description
- MetricIdentifier defines the name and optionally selector for a metric
- Type
object- Required
name
.spec.metrics[].external.metric.selector
- 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.
- Type
object
.spec.metrics[].external.metric.selector.matchExpressions
- Description
- matchExpressions is a list of label selector requirements. The requirements are ANDed.
- Type
array
.spec.metrics[].external.metric.selector.matchExpressions[]
- Description
- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- Type
object- Required
keyoperator
.spec.metrics[].external.metric.selector.matchExpressions[].values
- 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.
- Type
array
.spec.metrics[].external.metric.selector.matchExpressions[].values[]
- Type
string
.spec.metrics[].external.metric.selector.matchLabels
- 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.
- Type
object
.spec.metrics[].external.target
- Description
- MetricTarget defines the target value, average value, or average utilization of a specific metric
- Type
object- Required
type
.spec.metrics[].object
- Description
- ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).
- Type
object- Required
describedObjecttargetmetric
.spec.metrics[].object.describedObject
- Description
- CrossVersionObjectReference contains enough information to let you identify the referred resource.
- Type
object- Required
kindname
.spec.metrics[].object.metric
- Description
- MetricIdentifier defines the name and optionally selector for a metric
- Type
object- Required
name
.spec.metrics[].object.metric.selector
- 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.
- Type
object
.spec.metrics[].object.metric.selector.matchExpressions
- Description
- matchExpressions is a list of label selector requirements. The requirements are ANDed.
- Type
array
.spec.metrics[].object.metric.selector.matchExpressions[]
- Description
- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- Type
object- Required
keyoperator
.spec.metrics[].object.metric.selector.matchExpressions[].values
- 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.
- Type
array
.spec.metrics[].object.metric.selector.matchExpressions[].values[]
- Type
string
.spec.metrics[].object.metric.selector.matchLabels
- 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.
- Type
object
.spec.metrics[].object.target
- Description
- MetricTarget defines the target value, average value, or average utilization of a specific metric
- Type
object- Required
type
.spec.metrics[].pods
- Description
- PodsMetricSource indicates how to scale on a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.
- Type
object- Required
metrictarget
.spec.metrics[].pods.metric
- Description
- MetricIdentifier defines the name and optionally selector for a metric
- Type
object- Required
name
.spec.metrics[].pods.metric.selector
- 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.
- Type
object
.spec.metrics[].pods.metric.selector.matchExpressions
- Description
- matchExpressions is a list of label selector requirements. The requirements are ANDed.
- Type
array
.spec.metrics[].pods.metric.selector.matchExpressions[]
- Description
- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- Type
object- Required
keyoperator
.spec.metrics[].pods.metric.selector.matchExpressions[].values
- 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.
- Type
array
.spec.metrics[].pods.metric.selector.matchExpressions[].values[]
- Type
string
.spec.metrics[].pods.metric.selector.matchLabels
- 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.
- Type
object
.spec.metrics[].pods.target
- Description
- MetricTarget defines the target value, average value, or average utilization of a specific metric
- Type
object- Required
type
.spec.metrics[].resource
- Description
- ResourceMetricSource 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.
- Type
object- Required
nametarget
.spec.metrics[].resource.target
- Description
- MetricTarget defines the target value, average value, or average utilization of a specific metric
- Type
object- Required
type
.spec.scaleTargetRef
- Description
- CrossVersionObjectReference contains enough information to let you identify the referred resource.
- Type
object- Required
kindname
.status
- Description
- HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
- Type
object- Required
desiredReplicas
.status.conditions
- Description
- conditions is the set of conditions required for this autoscaler to scale its target, and indicates whether or not those conditions are met.
- Type
array
.status.conditions[]
- Description
- HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a certain point.
- Type
object- Required
typestatus
.status.currentMetrics
- Description
- currentMetrics is the last read state of the metrics used by this autoscaler.
- Type
array
.status.currentMetrics[]
- Description
- MetricStatus describes the last-read state of a single metric.
- Type
object- Required
type
.status.currentMetrics[].containerResource
- 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.
- Type
object- Required
namecurrentcontainer
.status.currentMetrics[].containerResource.current
- Description
- MetricValueStatus holds the current value for a metric
- Type
object
.status.currentMetrics[].external
- Description
- ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object.
- Type
object- Required
metriccurrent
.status.currentMetrics[].external.current
- Description
- MetricValueStatus holds the current value for a metric
- Type
object
.status.currentMetrics[].external.metric
- Description
- MetricIdentifier defines the name and optionally selector for a metric
- Type
object- Required
name
.status.currentMetrics[].external.metric.selector
- 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.
- Type
object
.status.currentMetrics[].external.metric.selector.matchExpressions
- Description
- matchExpressions is a list of label selector requirements. The requirements are ANDed.
- Type
array
.status.currentMetrics[].external.metric.selector.matchExpressions[]
- Description
- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- Type
object- Required
keyoperator
.status.currentMetrics[].external.metric.selector.matchExpressions[].values
- 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.
- Type
array
.status.currentMetrics[].external.metric.selector.matchExpressions[].values[]
- Type
string
.status.currentMetrics[].external.metric.selector.matchLabels
- 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.
- Type
object
.status.currentMetrics[].object
- Description
- ObjectMetricStatus indicates the current value of a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).
- Type
object- Required
metriccurrentdescribedObject
.status.currentMetrics[].object.current
- Description
- MetricValueStatus holds the current value for a metric
- Type
object
.status.currentMetrics[].object.describedObject
- Description
- CrossVersionObjectReference contains enough information to let you identify the referred resource.
- Type
object- Required
kindname
.status.currentMetrics[].object.metric
- Description
- MetricIdentifier defines the name and optionally selector for a metric
- Type
object- Required
name
.status.currentMetrics[].object.metric.selector
- 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.
- Type
object
.status.currentMetrics[].object.metric.selector.matchExpressions
- Description
- matchExpressions is a list of label selector requirements. The requirements are ANDed.
- Type
array
.status.currentMetrics[].object.metric.selector.matchExpressions[]
- Description
- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- Type
object- Required
keyoperator
.status.currentMetrics[].object.metric.selector.matchExpressions[].values
- 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.
- Type
array
.status.currentMetrics[].object.metric.selector.matchExpressions[].values[]
- Type
string
.status.currentMetrics[].object.metric.selector.matchLabels
- 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.
- Type
object
.status.currentMetrics[].pods
- Description
- PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second).
- Type
object- Required
metriccurrent
.status.currentMetrics[].pods.current
- Description
- MetricValueStatus holds the current value for a metric
- Type
object
.status.currentMetrics[].pods.metric
- Description
- MetricIdentifier defines the name and optionally selector for a metric
- Type
object- Required
name
.status.currentMetrics[].pods.metric.selector
- 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.
- Type
object
.status.currentMetrics[].pods.metric.selector.matchExpressions
- Description
- matchExpressions is a list of label selector requirements. The requirements are ANDed.
- Type
array
.status.currentMetrics[].pods.metric.selector.matchExpressions[]
- Description
- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- Type
object- Required
keyoperator
.status.currentMetrics[].pods.metric.selector.matchExpressions[].values
- 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.
- Type
array
.status.currentMetrics[].pods.metric.selector.matchExpressions[].values[]
- Type
string
.status.currentMetrics[].pods.metric.selector.matchLabels
- 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.
- Type
object
.status.currentMetrics[].resource
- Description
- ResourceMetricStatus indicates the current value of 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). 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
object- Required
namecurrent
.status.currentMetrics[].resource.current
- Description
- MetricValueStatus holds the current value for a metric
- Type
object
API Endpoints
The following API endpoints are available:
/kubernetes/{cluster}/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalersDELETE: delete collection of HorizontalPodAutoscalerGET: list objects of kind HorizontalPodAutoscalerPOST: create a new HorizontalPodAutoscaler
/kubernetes/{cluster}/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}DELETE: delete the specified HorizontalPodAutoscalerGET: read the specified HorizontalPodAutoscalerPATCH: partially update the specified HorizontalPodAutoscalerPUT: replace the specified HorizontalPodAutoscaler
/kubernetes/{cluster}/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/statusGET: read status of the specified HorizontalPodAutoscalerPATCH: partially update status of the specified HorizontalPodAutoscalerPUT: replace status of the specified HorizontalPodAutoscaler
/kubernetes/{cluster}/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers
- HTTP method
DELETE- Description
- delete collection of HorizontalPodAutoscaler
- HTTP responses
- HTTP method
GET- Description
- list objects of kind HorizontalPodAutoscaler
- HTTP responses
- HTTP method
POST- Description
- create a new HorizontalPodAutoscaler
- Query parameters
- Body parameters
- HTTP responses
/kubernetes/{cluster}/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}
- HTTP method
DELETE- Description
- delete the specified HorizontalPodAutoscaler
- Query parameters
- HTTP responses
- HTTP method
GET- Description
- read the specified HorizontalPodAutoscaler
- HTTP responses
- HTTP method
PATCH- Description
- partially update the specified HorizontalPodAutoscaler
- Query parameters
- HTTP responses
- HTTP method
PUT- Description
- replace the specified HorizontalPodAutoscaler
- Query parameters
- Body parameters
- HTTP responses
/kubernetes/{cluster}/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status
- HTTP method
GET- Description
- read status of the specified HorizontalPodAutoscaler
- HTTP responses
- HTTP method
PATCH- Description
- partially update status of the specified HorizontalPodAutoscaler
- Query parameters
- HTTP responses
- HTTP method
PUT- Description
- replace status of the specified HorizontalPodAutoscaler
- Query parameters
- Body parameters
- HTTP responses