red-hat-storage / ocs-operator

Operator for RHOCS
Apache License 2.0
85 stars 184 forks source link

Update the Prometheus rule alerts acc to specified value & correct the default values in API desc #2816

Closed malayparida2000 closed 1 month ago

malayparida2000 commented 2 months ago

Update prometheusRule to use the fullRatio values from storageCluster CR

Earlier the cluster utilization alert rules (CephClusterNearFull, CephClusterCriticallyFull, CephClusterReadOnly) and the osd alert rules (CephOSDNearFull, CephOSDCriticallyFull) were hardcoded to use the nearFullRatio 0.75, criticallyFullRatio 0.80, and fullRatio 0.85 values.

But these values are now configurable on the storageCluster CR. So the prometheus rules for these alerts will now be updated to use the specified values if provided in the storageCluster CR.

This also includes the refactor of the changing the prometheus rule process. The function is now easier to read, maintain & expand. Also add tests for prometheus rule changing process.

Correct the API desc about the defaults for Full Ratios in OCS-Operator

While adding the fields the description of the fields were directly lifted off from rook-operator. The values of NearFull, BackfillFull & Full in rook are 0.85, 0.90 & 0.95 respectively. But in OCS Operator we set these values to 0.75, 0.80 & 0.85 respectively with the help of the rook-config-override ConfigMap. So the description of the fields in the API should reflect the actual values that are set in OCS.

Story-https://issues.redhat.com/browse/RHSTOR-6497 BZ-https://bugzilla.redhat.com/show_bug.cgi?id=2303342

malayparida2000 commented 2 months ago

/hold will change more things

malayparida2000 commented 2 months ago

/cherry-pick release-4.17

openshift-cherrypick-robot commented 2 months ago

@malayparida2000: once the present PR merges, I will cherry-pick it on top of release-4.17 in a new PR and assign it to you.

In response to [this](https://github.com/red-hat-storage/ocs-operator/pull/2816#issuecomment-2370639255): >/cherry-pick release-4.17 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
malayparida2000 commented 2 months ago

PR is ready for review, removing hold /unhold

malayparida2000 commented 2 months ago

/cc @travisn /cc @aruniiird

openshift-ci[bot] commented 2 months ago

@malayparida2000: GitHub didn't allow me to request PR reviews from the following users: aruniiird.

Note that only red-hat-storage members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to [this](https://github.com/red-hat-storage/ocs-operator/pull/2816#issuecomment-2370665947): >/cc @travisn >/cc @aruniiird Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
malayparida2000 commented 2 months ago

Full testing of the feature on this PR is documented here https://hackmd.io/@Yh4a4hAATcW2BNYBJVSx4w/SJaY57gCR

openshift-ci[bot] commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: iamniting, malayparida2000, travisn

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/red-hat-storage/ocs-operator/blob/main/OWNERS)~~ [iamniting,travisn] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
malayparida2000 commented 1 month ago

/unhold

openshift-cherrypick-robot commented 1 month ago

@malayparida2000: new pull request created: #2820

In response to [this](https://github.com/red-hat-storage/ocs-operator/pull/2816#issuecomment-2370639255): >/cherry-pick release-4.17 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
openshift-ci[bot] commented 1 month ago

@aruniiird: changing LGTM is restricted to collaborators

In response to [this](https://github.com/red-hat-storage/ocs-operator/pull/2816#pullrequestreview-2330051494): >Adding an extensive redesign of `replaceTokens`, please take a look. Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
malayparida2000 commented 1 month ago

Acc to discussion, @aruniiird would raise a follow-up to refactor PR to clean up the flow a bit more, but that would be only on the main & will not be backported.