fix: Receiving TargetDown after upgrading GitOps #1044
+4
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind bug
What does this PR do / why we need it:
Issue Description / Context:
During the upgrade from an older version (1.17.2) to a newer version (1.17.3) — noting that the specific versions mentioned are for testing and validation purposes — we observed that the TargetDown alert was being triggered. Investigation showed that the metrics endpoint was returning a 403 Forbidden response.
Root Cause Analysis:
The 403 error indicates an authorization failure. One identified scenario is that the required RBAC permissions were missing for accessing the /metrics endpoint. As a result, Prometheus was unable to scrape metrics successfully, leading to the TargetDown alert.
Resolution / Fix:
To address this issue, we updated the RBAC configuration by explicitly adding the /metrics non-resource URL to the relevant ClusterRole/ClusterRoleBinding. With this change in place, Prometheus is able to access the metrics endpoint successfully, and the TargetDown alert is resolved.
Outcome:
Post-change verification confirms that metrics scraping works as expected and no further 403 errors are observed.
Have you updated the necessary documentation?
Which issue(s) this PR fixes:
https://issues.redhat.com/browse/GITOPS-8591
Fixes #?
https://issues.redhat.com/browse/GITOPS-8591
Test acceptance criteria:
How to test changes / Special notes to the reviewer:
Install the GitOps Operator using a version that includes the relevant changes.
Navigate to the OLM UI and verify the metrics targets.
Confirm that all targets are in an UP state and correctly labeled with the gitops identifier.
Ensure that no alerts are triggered for TargetDown.