-
Notifications
You must be signed in to change notification settings - Fork 0
/
hpa.yaml
32 lines (32 loc) · 958 Bytes
/
hpa.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
kind: HorizontalPodAutoscaler
apiVersion: autoscaling/v2beta1
metadata:
name: demo-service-primary-autoscaler
namespace: demo
annotations:
metric-config.external.prometheus-query.prometheus/prometheus-server: "http://prometheus.istio-system.svc.cluster.local:9090"
metric-config.external.prometheus-query.prometheus/demo-service-requests-total: |
sum(
rate(
istio_requests_total{
destination_workload="demo-service-primary",
destination_workload_namespace="demo",
pod_name=~"demo-service-primary.*"
}[1m]
)
)
spec:
scaleTargetRef:
kind: Deployment
name: demo-service-primary
apiVersion: apps/v1
minReplicas: 4
maxReplicas: 10
metrics:
- type: External
external:
metricName: prometheus-query
metricSelector:
matchLabels:
query-name: demo-service-requests-total
targetAverageValue: "40"