mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-06 17:57:51 +00:00
24 lines
722 B
YAML
24 lines
722 B
YAML
kind: HorizontalPodAutoscaler
|
|
apiVersion: autoscaling/v2beta1
|
|
metadata:
|
|
name: sample-app
|
|
spec:
|
|
scaleTargetRef:
|
|
# point the HPA at the sample application
|
|
# you created above
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: sample-app
|
|
# autoscale between 1 and 10 replicas
|
|
minReplicas: 1
|
|
maxReplicas: 10
|
|
metrics:
|
|
# use a "Pods" metric, which takes the average of the
|
|
# given metric across all pods controlled by the autoscaling target
|
|
- type: Pods
|
|
pods:
|
|
# use the metric that you used above: pods/http_requests
|
|
metricName: http_requests
|
|
# target 500 milli-requests per second,
|
|
# which is 1 request every two seconds
|
|
targetAverageValue: 20m
|