We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bfc6c2 commit 0f7a6b9Copy full SHA for 0f7a6b9
1 file changed
example/ScaledObject.yaml
@@ -0,0 +1,19 @@
1
+apiVersion: keda.sh/v1alpha1
2
+kind: ScaledObject
3
+metadata:
4
+ name: myapp-scaledobject
5
+ namespace: default
6
+spec:
7
+ scaleTargetRef:
8
+ name: myapp # 要缩容的 Deployment/StatefulSet
9
+ minReplicaCount: 0 # 支持缩到 0
10
+ maxReplicaCount: 10
11
+ triggers:
12
+ - type: prometheus
13
+ metadata:
14
+ serverAddress: http://prometheus-server.monitoring.svc:9090
15
+ metricName: http_requests_per_second
16
+ query: |
17
+ sum(rate(http_requests_total{namespace="default",pod=~"^myapp-.*"}[2m]))
18
+ threshold: "100" # 总请求速率 >100 就扩容
19
+ activationThreshold: "5" # <5 才缩容(防抖动)
0 commit comments