Commit a87de172 authored by Mohamad Bashar Desoki's avatar Mohamad Bashar Desoki

Add KEDA Scaler Configurations

parent 61708eac
......@@ -15,3 +15,4 @@ helm upgrade --install keda kedacore/keda -n keda
![https://blog.cloudacode.com/how-to-autoscale-kubernetes-pods-based-on-ingress-request-prometheus-keda-and-k6-84ae4250a9f3](img.png)
The configuration of proposed scaler name is *open-prediction-scaler.yaml*, while the configuration of default KEDA prometheus Scaler name is *prometheus-scaler.yaml*
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: open-prediction-scaledobject
spec:
minReplicaCount: 1
maxReplicaCount: 10
pollingInterval: 300
cooldownPeriod: 5
#idleReplicaCount: 0
scaleTargetRef:
kind: Deployment
name: ms-demo
advanced:
horizontalPodAutoscalerConfig: # Optional. Section to specify HPA related options
#name: {name-of-hpa-resource} # Optional. Default: keda-hpa-{scaled-object-name}
behavior: # Optional. Use to modify HPA's scaling behavior
scaleDown:
stabilizationWindowSeconds: 30
policies:
- type: Percent
value: 100
periodSeconds: 30
triggers:
- type: open-prediction
metadata:
history: "1d"
stepDuration: "1m"
verticalWindow: "1"
horizontalWindow: "4"
predictionServiceAddress: "10.10.10.80:50051"
prometheusAddress: http://prometheus-service.monitoring.svc:9090
query: sum(rate(nginx_ingress_controller_requests{path='/demo/(.*)'}[1m]))
threshold: '9'
#activationThreshold: "0.025"
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: v1-ingress-throughput
spec:
scaleTargetRef:
kind: Deployment # Optional. Default: Deployment
name: hello-world-two # Mandatory. Must be in the same namespace as the ScaledObject
pollingInterval: 300 # Optional. Default: 30 seconds
cooldownPeriod: 5 # Optional. Default: 300 seconds
minReplicaCount: 1 # Optional. Default: 0
#idleReplicaCount: 0
maxReplicaCount: 10 # Optional. Default: 100
advanced:
horizontalPodAutoscalerConfig: # Optional. Secti on to specify HPA related options
#name: {name-of-hpa-resource} # Optional. Defaul t: keda-hpa-{scaled-object-name}
behavior: # Optional. Use t o modify HPA's scaling behavior
scaleDown:
stabilizationWindowSeconds: 30
policies:
- type: Percent
value: 100
periodSeconds: 30
triggers:
- type: prometheus
metadata:
serverAddress: http://prometheus-service.monitoring.svc:9090
metricName: nginx_ingress_controller_requests
threshold: '9'
query: sum(rate(nginx_ingress_controller_requests{path="/hello/(.*)"}[1m]))
# activationThreshold: "0.025"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment