Skip to content

Commit

Permalink
docs: add details about HPA via KEDA
Browse files Browse the repository at this point in the history
By default HPA can use details about memory or CPU consumption for
autoscaling, but also it can use custom metrics as well. There are alot
provides supports HPA via customer and one of them is KEDA project. Here
it is done with help of Prometheus Scaler

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
  • Loading branch information
thotz committed Nov 18, 2021
1 parent 2d03a8e commit a524dce
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Documentation/ceph-monitoring.md
Expand Up @@ -210,3 +210,30 @@ labels:
prometheus: k8s
[...]
```

### Horizontal Pod Scaling using Kubernetes Event-driven Autoscaling aka KEDA

Using metrics exported from the Prometheus service, the horizontal pod scaling can use the custom metrics other than CPU and memory consumption. It can be done with help of Promethues Scaler provided by the [KEDA](https://keda.sh/docs/1.4/scalers/prometheus/). The KEDA deployed via helm chart, refer [here](https://keda.sh/docs/2.4/deploy/) for details.

Following is sample for `ScaledObject`for autoscaling RGW:
```YAML
apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
metadata:
name: rgw-scale
namespace: rook-ceph
spec:
scaleTargetRef:
kind: Deployment
deploymentName: rook-ceph-rgw-my-store-a # deployment for the autoscaling
minReplicaCount: 1
maxReplicaCount: 5
triggers:
- type: prometheus
metadata:
serverAddress: http://rook-prometheus.rook-ceph.svc:9090
metricName: collecting_ceph_rgw_put
query: |
sum(rate(ceph_rgw_put[2m])) # promethues query used for autoscaling
threshold: "90"
```

0 comments on commit a524dce

Please sign in to comment.