首次提交:初始化项目
This commit is contained in:
23
009-基础设施/007-keda/scalers/navigation-scaler.yaml
Normal file
23
009-基础设施/007-keda/scalers/navigation-scaler.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
apiVersion: keda.sh/v1alpha1
|
||||
kind: ScaledObject
|
||||
metadata:
|
||||
name: navigation-scaler
|
||||
namespace: navigation
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
name: navigation
|
||||
minReplicaCount: 1 # 至少保持 1 个副本(HPA 限制)
|
||||
maxReplicaCount: 10 # 最多 10 个副本
|
||||
pollingInterval: 15 # 每 15 秒检查一次
|
||||
cooldownPeriod: 180 # 缩容冷却期 3 分钟
|
||||
triggers:
|
||||
- type: prometheus
|
||||
metadata:
|
||||
serverAddress: http://kube-prometheus-stack-prometheus.monitoring.svc.cluster.local:9090
|
||||
metricName: nginx_http_requests_total
|
||||
query: sum(rate(nginx_http_requests_total{namespace="navigation"}[1m]))
|
||||
threshold: "10" # 每分钟超过 10 个请求时启动
|
||||
- type: cpu
|
||||
metricType: Utilization
|
||||
metadata:
|
||||
value: "60" # CPU 使用率超过 60% 时扩容
|
||||
Reference in New Issue
Block a user