Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add details about HPA via KEDA #9202

Merged
merged 1 commit into from Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions Documentation/ceph-monitoring.md
Expand Up @@ -210,3 +210,30 @@ labels:
prometheus: k8s
[...]
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have a table of contents at the top so new topics like this can be more easily discovered, but that is really a separate question from this PR.


### Horizontal Pod Scaling using Kubernetes Event-driven Autoscaling (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 Prometheus Scaler provided by the [KEDA](https://keda.sh/docs/2.4/scalers/prometheus/). See the [KEDA deployment guide](https://keda.sh/docs/2.4/deploy/) for details.

Following is an example to autoscale RGW:
```YAML
thotz marked this conversation as resolved.
Show resolved Hide resolved
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"
```
19 changes: 19 additions & 0 deletions cluster/examples/kubernetes/ceph/monitoring/keda-rgw.yaml
@@ -0,0 +1,19 @@
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
minReplicaCount: 1
maxReplicaCount: 5
triggers:
- type: prometheus
metadata:
serverAddress: http://rook-prometheus.rook-ceph.svc:9090
metricName: ceph_rgw_put_collector
query: |
sum(rate(ceph_rgw_put[2m]))
threshold: "90"
5 changes: 5 additions & 0 deletions tests/scripts/github-action-helper.sh
Expand Up @@ -173,6 +173,11 @@ function validate_yaml() {
kubectl create -f "${replication_url}/replication.storage.openshift.io_volumereplications.yaml"
kubectl create -f "${replication_url}/replication.storage.openshift.io_volumereplicationclasses.yaml"

#create the KEDA CRDS
keda_version=2.4.0
keda_url="https://github.com/kedacore/keda/releases/download/v${keda_version}/keda-${keda_version}.yaml"
kubectl apply -f "${keda_url}"

Comment on lines +176 to +180
Copy link
Member

@BlaineEXE BlaineEXE Apr 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thotz Why was this included (to install KEDA) but no integration test written to test KEDA integration with Rook RGWs?

# skipping folders and some yamls that are only for openshift.
manifests="$(find . -maxdepth 1 -type f -name '*.yaml' -and -not -name '*openshift*' -and -not -name 'scc*')"
with_f_arg="$(echo "$manifests" | awk '{printf " -f %s",$1}')" # don't add newline
Expand Down