Kubernetes Horizontal Pod Autoscaler Manifest Version 2 beta 2: Difference between revisions
Jump to navigation
Jump to search
(→type) |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
v2 beta2 Horizontal Pod Autoscalers support autoscaling solution based on custom and external metrics. See: {{Internal|Kubernetes_Horizontal_Pod_Autoscaler#Custom_Metrics-based_Scaling|Custom Metrics-based Scaling}} | v2 beta2 Horizontal Pod Autoscalers support autoscaling solution based on custom and external metrics. See: {{Internal|Kubernetes_Horizontal_Pod_Autoscaler#Custom_Metrics-based_Scaling|Custom Metrics-based Scaling}} | ||
{{Internal|Kubernetes_Horizontal_Pod_Autoscaler#External_Metrics-based_Scaling|External Metrics-based Scaling}} | |||
=Example= | =Example= | ||
Line 45: | Line 46: | ||
type: Value | type: Value | ||
value: 2K | value: 2K | ||
- [[#type|type]]: External | |||
external: | |||
metric: | |||
name: queue_messages_ready | |||
selector: "queue=worker_tasks" | |||
target: | |||
type: AverageValue | |||
averageValue: 30 | |||
=.spec Elements= | =.spec Elements= | ||
Line 52: | Line 61: | ||
==metrics== | ==metrics== | ||
===type=== | ===type=== | ||
The type can be [[Metrics_in_Kubernetes#Resource_Metrics|Resource]] | The type can be: | ||
* [[Metrics_in_Kubernetes#Resource_Metrics|Resource]] | |||
* [[Kubernetes_Horizontal_Pod_Autoscaler#Custom_Pod_Metrics|Pods]] | |||
* [[Kubernetes_Horizontal_Pod_Autoscaler#Custom_Object_Metrics|Object]] | |||
* [[Kubernetes_Horizontal_Pod_Autoscaler#External_Metrics-based_Scaling|External]] | |||
===resource=== | ===resource=== | ||
====target==== | ====target==== | ||
Line 60: | Line 74: | ||
Object metrics support target types of both Value and AverageValue. With Value, the target is compared directly to the returned metric from the API. With AverageValue, the value returned from the custom metrics API is divided by the number of Pods before being compared to the target. | Object metrics support target types of both Value and AverageValue. With Value, the target is compared directly to the returned metric from the API. With AverageValue, the value returned from the custom metrics API is divided by the number of Pods before being compared to the target. | ||
=Metrics specified by Labels= | |||
{{External|https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#autoscaling-on-more-specific-metrics}} |
Latest revision as of 07:07, 16 October 2020
External
Internal
Overview
v2 beta2 Horizontal Pod Autoscalers support autoscaling solution based on custom and external metrics. See:
Example
apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: example spec: minReplicas: 1 maxReplicas: 5 scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: httpd metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 50 - type: Pods pods: metric: name: packets-per-second target: type: AverageValue averageValue: 1K - type: Object object: metric: name: requests-per-second describedObject: apiVersion: networking.k8s.io/v1beta1 kind: Ingress name: myIngress target: type: Value value: 2K - type: External external: metric: name: queue_messages_ready selector: "queue=worker_tasks" target: type: AverageValue averageValue: 30
.spec Elements
minReplicas
maxReplicas
scaleTargetRef
metrics
type
The type can be:
resource
target
type
AverageValue/averageValue, Utilization/averageUtilization
Object metrics support target types of both Value and AverageValue. With Value, the target is compared directly to the returned metric from the API. With AverageValue, the value returned from the custom metrics API is divided by the number of Pods before being compared to the target.