HorizontalPodAutoscaler [autoscaling/v2]
- 描述
- 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.
- 类型
object
规格
.spec
- 描述
- HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
- 类型
object- 必填
scaleTargetRefmaxReplicas
.spec.behavior
- 描述
- HorizontalPodAutoscalerBehavior configures the scaling behavior of the target in both Up and Down directions (scaleUp and scaleDown fields respectively).
- 类型
object
.spec.behavior.scaleDown
- 描述
- 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.
- 类型
object
.spec.behavior.scaleDown.policies
- 描述
- 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
- 类型
array
.spec.behavior.scaleDown.policies[]
- 描述
- HPAScalingPolicy is a single policy which must hold true for a specified past interval.
- 类型
object- 必填
typevalueperiodSeconds
.spec.behavior.scaleUp
- 描述
- 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.
- 类型
object
.spec.behavior.scaleUp.policies
- 描述
- 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
- 类型
array
.spec.behavior.scaleUp.policies[]
- 描述
- HPAScalingPolicy is a single policy which must hold true for a specified past interval.
- 类型
object- 必填
typevalueperiodSeconds
.spec.metrics
- 描述
- 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.
- 类型
array
.spec.metrics[]
- 描述
- MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).
- 类型
object- 必填
type
.spec.metrics[].containerResource
- 描述
- 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.
- 类型
object- 必填
nametargetcontainer
.spec.metrics[].containerResource.target
- 描述
- MetricTarget defines the target value, average value, or average utilization of a specific metric
- 类型
object- 必填
type
.spec.metrics[].external
- 描述
- 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).
- 类型
object- 必填
metrictarget
.spec.metrics[].external.metric
- 描述
- MetricIdentifier defines the name and optionally selector for a metric
- 类型
object- 必填
name
.spec.metrics[].external.metric.selector
- 描述
- 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.
- 类型
object
.spec.metrics[].external.metric.selector.matchExpressions
- 描述
- matchExpressions is a list of label selector requirements. The requirements are ANDed.
- 类型
array
.spec.metrics[].external.metric.selector.matchExpressions[]
- 描述
- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- 类型
object- 必填
keyoperator
.spec.metrics[].external.metric.selector.matchExpressions[].values
- 描述
- 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.
- 类型
array
.spec.metrics[].external.metric.selector.matchExpressions[].values[]
- 类型
string
.spec.metrics[].external.metric.selector.matchLabels
- 描述
- 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.
- 类型
object
.spec.metrics[].external.target
- 描述
- MetricTarget defines the target value, average value, or average utilization of a specific metric
- 类型
object- 必填
type
.spec.metrics[].object
- 描述
- ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).
- 类型
object- 必填
describedObjecttargetmetric
.spec.metrics[].object.describedObject
- 描述
- CrossVersionObjectReference contains enough information to let you identify the referred resource.
- 类型
object- 必填
kindname
.spec.metrics[].object.metric
- 描述
- MetricIdentifier defines the name and optionally selector for a metric
- 类型
object- 必填
name
.spec.metrics[].object.metric.selector
- 描述
- 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.
- 类型
object
.spec.metrics[].object.metric.selector.matchExpressions
- 描述
- matchExpressions is a list of label selector requirements. The requirements are ANDed.
- 类型
array
.spec.metrics[].object.metric.selector.matchExpressions[]
- 描述
- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- 类型
object- 必填
keyoperator
.spec.metrics[].object.metric.selector.matchExpressions[].values
- 描述
- 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.
- 类型
array
.spec.metrics[].object.metric.selector.matchExpressions[].values[]
- 类型
string
.spec.metrics[].object.metric.selector.matchLabels
- 描述
- 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.
- 类型
object
.spec.metrics[].object.target
- 描述
- MetricTarget defines the target value, average value, or average utilization of a specific metric
- 类型
object- 必填
type
.spec.metrics[].pods
- 描述
- 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.
- 类型
object- 必填
metrictarget
.spec.metrics[].pods.metric
- 描述
- MetricIdentifier defines the name and optionally selector for a metric
- 类型
object- 必填
name
.spec.metrics[].pods.metric.selector
- 描述
- 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.
- 类型
object
.spec.metrics[].pods.metric.selector.matchExpressions
- 描述
- matchExpressions is a list of label selector requirements. The requirements are ANDed.
- 类型
array
.spec.metrics[].pods.metric.selector.matchExpressions[]
- 描述
- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- 类型
object- 必填
keyoperator
.spec.metrics[].pods.metric.selector.matchExpressions[].values
- 描述
- 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.
- 类型
array
.spec.metrics[].pods.metric.selector.matchExpressions[].values[]
- 类型
string
.spec.metrics[].pods.metric.selector.matchLabels
- 描述
- 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.
- 类型
object
.spec.metrics[].pods.target
- 描述
- MetricTarget defines the target value, average value, or average utilization of a specific metric
- 类型
object- 必填
type
.spec.metrics[].resource
- 描述
- 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.
- 类型
object- 必填
nametarget
.spec.metrics[].resource.target
- 描述
- MetricTarget defines the target value, average value, or average utilization of a specific metric
- 类型
object- 必填
type
.spec.scaleTargetRef
- 描述
- CrossVersionObjectReference contains enough information to let you identify the referred resource.
- 类型
object- 必填
kindname
.status
- 描述
- HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
- 类型
object- 必填
desiredReplicas
.status.conditions
- 描述
- conditions is the set of conditions required for this autoscaler to scale its target, and indicates whether or not those conditions are met.
- 类型
array
.status.conditions[]
- 描述
- HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a certain point.
- 类型
object- 必填
typestatus
.status.currentMetrics
- 描述
- currentMetrics is the last read state of the metrics used by this autoscaler.
- 类型
array
.status.currentMetrics[]
- 描述
- MetricStatus describes the last-read state of a single metric.
- 类型
object- 必填
type
.status.currentMetrics[].containerResource
- 描述
- 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.
- 类型
object- 必填
namecurrentcontainer
.status.currentMetrics[].containerResource.current
- 描述
- MetricValueStatus holds the current value for a metric
- 类型
object
.status.currentMetrics[].external
- 描述
- ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object.
- 类型
object- 必填
metriccurrent
.status.currentMetrics[].external.current
- 描述
- MetricValueStatus holds the current value for a metric
- 类型
object
.status.currentMetrics[].external.metric
- 描述
- MetricIdentifier defines the name and optionally selector for a metric
- 类型
object- 必填
name
.status.currentMetrics[].external.metric.selector
- 描述
- 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.
- 类型
object
.status.currentMetrics[].external.metric.selector.matchExpressions
- 描述
- matchExpressions is a list of label selector requirements. The requirements are ANDed.
- 类型
array
.status.currentMetrics[].external.metric.selector.matchExpressions[]
- 描述
- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- 类型
object- 必填
keyoperator
.status.currentMetrics[].external.metric.selector.matchExpressions[].values
- 描述
- 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.
- 类型
array
.status.currentMetrics[].external.metric.selector.matchExpressions[].values[]
- 类型
string
.status.currentMetrics[].external.metric.selector.matchLabels
- 描述
- 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.
- 类型
object
.status.currentMetrics[].object
- 描述
- ObjectMetricStatus indicates the current value of a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).
- 类型
object- 必填
metriccurrentdescribedObject
.status.currentMetrics[].object.current
- 描述
- MetricValueStatus holds the current value for a metric
- 类型
object
.status.currentMetrics[].object.describedObject
- 描述
- CrossVersionObjectReference contains enough information to let you identify the referred resource.
- 类型
object- 必填
kindname
.status.currentMetrics[].object.metric
- 描述
- MetricIdentifier defines the name and optionally selector for a metric
- 类型
object- 必填
name
.status.currentMetrics[].object.metric.selector
- 描述
- 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.
- 类型
object
.status.currentMetrics[].object.metric.selector.matchExpressions
- 描述
- matchExpressions is a list of label selector requirements. The requirements are ANDed.
- 类型
array
.status.currentMetrics[].object.metric.selector.matchExpressions[]
- 描述
- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- 类型
object- 必填
keyoperator
.status.currentMetrics[].object.metric.selector.matchExpressions[].values
- 描述
- 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.
- 类型
array
.status.currentMetrics[].object.metric.selector.matchExpressions[].values[]
- 类型
string
.status.currentMetrics[].object.metric.selector.matchLabels
- 描述
- 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.
- 类型
object
.status.currentMetrics[].pods
- 描述
- PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second).
- 类型
object- 必填
metriccurrent
.status.currentMetrics[].pods.current
- 描述
- MetricValueStatus holds the current value for a metric
- 类型
object
.status.currentMetrics[].pods.metric
- 描述
- MetricIdentifier defines the name and optionally selector for a metric
- 类型
object- 必填
name
.status.currentMetrics[].pods.metric.selector
- 描述
- 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.
- 类型
object
.status.currentMetrics[].pods.metric.selector.matchExpressions
- 描述
- matchExpressions is a list of label selector requirements. The requirements are ANDed.
- 类型
array
.status.currentMetrics[].pods.metric.selector.matchExpressions[]
- 描述
- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- 类型
object- 必填
keyoperator
.status.currentMetrics[].pods.metric.selector.matchExpressions[].values
- 描述
- 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.
- 类型
array
.status.currentMetrics[].pods.metric.selector.matchExpressions[].values[]
- 类型
string
.status.currentMetrics[].pods.metric.selector.matchLabels
- 描述
- 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.
- 类型
object
.status.currentMetrics[].resource
- 描述
- 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.
- 类型
object- 必填
namecurrent
.status.currentMetrics[].resource.current
- 描述
- MetricValueStatus holds the current value for a metric
- 类型
object
API 端点
可用的 API 端点如下:
/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 方法
DELETE- 描述
- delete collection of HorizontalPodAutoscaler
- HTTP 响应
- HTTP 方法
GET- 描述
- list objects of kind HorizontalPodAutoscaler
- HTTP 响应
- HTTP 方法
POST- 描述
- create a new HorizontalPodAutoscaler
- 查询参数
- 请求体参数
- HTTP 响应
/kubernetes/{cluster}/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}
- HTTP 方法
DELETE- 描述
- delete the specified HorizontalPodAutoscaler
- 查询参数
- HTTP 响应
- HTTP 方法
GET- 描述
- read the specified HorizontalPodAutoscaler
- HTTP 响应
- HTTP 方法
PATCH- 描述
- partially update the specified HorizontalPodAutoscaler
- 查询参数
- HTTP 响应
- HTTP 方法
PUT- 描述
- replace the specified HorizontalPodAutoscaler
- 查询参数
- 请求体参数
- HTTP 响应
/kubernetes/{cluster}/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status
- HTTP 方法
GET- 描述
- read status of the specified HorizontalPodAutoscaler
- HTTP 响应
- HTTP 方法
PATCH- 描述
- partially update status of the specified HorizontalPodAutoscaler
- 查询参数
- HTTP 响应
- HTTP 方法
PUT- 描述
- replace status of the specified HorizontalPodAutoscaler
- 查询参数
- 请求体参数
- HTTP 响应