scaledobject.yaml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. ---
  2. apiVersion: keda.sh/v1alpha1
  3. kind: ScaledObject
  4. metadata:
  5. name: kubernetes-dashboard-web-scaledobject
  6. spec:
  7. maxReplicaCount: 1
  8. minReplicaCount: 0
  9. pollingInterval: 3 # Optional. Default: 30 seconds
  10. cooldownPeriod: 300 # Optional. Default: 300 seconds
  11. scaleTargetRef:
  12. name: kubernetes-dashboard-web
  13. triggers:
  14. - type: prometheus
  15. metadata:
  16. serverAddress: http://kube-prometheus-stack-prometheus.monitoring:9090
  17. metricName: nginx_ingress_controller_request_duration_seconds_count
  18. threshold: "0.5"
  19. query: max(irate(nginx_ingress_controller_request_duration_seconds_count{host="kubernetes-dashboard.home.wugi.info"}[5m]))
  20. ---
  21. apiVersion: keda.sh/v1alpha1
  22. kind: ScaledObject
  23. metadata:
  24. name: kubernetes-dashboard-api-scaledobject
  25. spec:
  26. maxReplicaCount: 1
  27. minReplicaCount: 0
  28. pollingInterval: 3 # Optional. Default: 30 seconds
  29. cooldownPeriod: 300 # Optional. Default: 300 seconds
  30. scaleTargetRef:
  31. name: kubernetes-dashboard-api
  32. triggers:
  33. - type: prometheus
  34. metadata:
  35. serverAddress: http://kube-prometheus-stack-prometheus.monitoring:9090
  36. metricName: nginx_ingress_controller_request_duration_seconds_count
  37. threshold: "0.5"
  38. query: max(irate(nginx_ingress_controller_request_duration_seconds_count{host="kubernetes-dashboard.home.wugi.info"}[5m]))