Bug 2168840

Summary: [Fusion-aaS][ODF 4.13]Within 'prometheus-ceph-rules' the namespace for 'rook-ceph-mgr' jobs should be configurable.
Product: [Red Hat Storage] Red Hat OpenShift Data Foundation Reporter: Nitin Goyal <nigoyal>
Component: ceph-monitoringAssignee: arun kumar mohan <amohan>
Status: CLOSED ERRATA QA Contact: Jilju Joy <jijoy>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.12CC: amohan, nberry, nthomas, ocs-bugs, odf-bz-bot, rcyriac, uchapaga
Target Milestone: ---Keywords: FutureFeature
Target Release: ODF 4.13.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Namespace 'openshift-storage' was hardcoded in the source. Consequence: when deployed under a different namespace (other than 'openshift-storage') prometheus alert-queries still has the hardcoded 'openshift-storage' value in it, thus providing a wrong result. Fix: while deploying ocs-operator, we try to edit/change the hardcored 'openshift-storage' namespace value in the 'prometheus-ceph-rules' alert file with the current namespace. Result: when ODF cluster is deployed in a different namespace, we should not see any reference to 'openshift-storage' in any of the prometheus-ceph alert queries
Story Points: ---
Clone Of:
: 2179235 (view as bug list) Environment:
Last Closed: 2023-06-21 15:23:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2179235    

Description Nitin Goyal 2023-02-10 07:56:13 UTC
Description of problem (please be detailed as possible and provide log
snippets):

The namespace openshift-storage is hardcoded for rook-ceph-mgr jobs under the prometheus-ceph-rules. This will only search for jobs in the openshift-storage namespace. We wanted to make this name configurable for Rosa because MS will not be using openshift-storage namespace anymore. It should be the namespace of storagecluster.


Version of all relevant components (if applicable):


Does this issue impact your ability to continue to work with the product
(please explain in detail what is the user impact)?


Is there any workaround available to the best of your knowledge?


Rate from 1 - 5 the complexity of the scenario you performed that caused this
bug (1 - very simple, 5 - very complex)?


Can this issue reproducible?


Can this issue reproduce from the UI?


If this is a regression, please provide more details to justify this:


Steps to Reproduce:
1.
2.
3.


Actual results:


Expected results:


Additional info:

link to the rule: https://github.com/red-hat-storage/ocs-operator/blob/83103d3b3f0bfbdd7446db1f7230de0e15ebbe02/controllers/storagecluster/prometheus/localcephrules.yaml#L45

Comment 6 arun kumar mohan 2023-03-20 09:44:55 UTC
Thanks Sunil.
As a general comment, this feature is something where we need to change (almost) all the alert queries (to raise the alert for all the namespaces of 'rook-ceph-mgr' jobs are in) and require some testing as well.
Once the feature is in the master OCS-Operator branch then we can target which releases of 4.13 and 4.12 to be backported.

Comment 7 arun kumar mohan 2023-04-05 08:05:58 UTC
Devel ack-ing this, but I am unable to change devel_ack flag

Comment 8 arun kumar mohan 2023-04-12 08:18:23 UTC
Added a PR for the query changes: https://github.com/red-hat-storage/ocs-operator/pull/2004

Comment 9 arun kumar mohan 2023-04-13 09:07:58 UTC
One more PR added to remove any embedded 'namespace' in the YAML file: https://github.com/red-hat-storage/ocs-operator/pull/2008

Comment 18 arun kumar mohan 2023-05-03 10:29:18 UTC
About testing,

Check for resource named prometheus-ceph-rule under 'prometheusrules' kind
`oc get prometheusrules prometheus-ceph-rules -o yaml`
When/if storagesystem is deployed under a different namespace (other than 'openshift-storage'), we should not see any hardcoded name 'openshift-storage' in this yaml output/file.

If StorageSystem is deployed under namespace 'openshift-storage', we will still see the name 'openshift-storage' in the rules.

Comment 22 errata-xmlrpc 2023-06-21 15:23:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenShift Data Foundation 4.13.0 enhancement and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:3742