fix: add Redis egress NP and allow metrics from openshift-user-workload-monitoring [RHDHBUGS-3724] - #3481
Conversation
…ad-monitoring Add allow-redis-egress NetworkPolicy (port 6379, broad; no pod/namespace selector) for production Redis caching. Redis is part of the recommended checklist for production deployments but is not deployed OOTB; users bring their own in any namespace or as an external managed service. Also add openshift-user-workload-monitoring to the allow-metrics-ingress NP. User-deployed ServiceMonitors are scraped by the Prometheus in that namespace, not by the platform Prometheus in openshift-monitoring. Assisted-by: Claude <noreply@anthropic.com>
PR Summary by QodoAllow Redis egress and user-workload metrics scraping
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
1. Users cannot locate the Redis policy
|
|
/build-images |
|
✅ PR images built successfully! Images are available for testing:
Also available with PR number tag:
Triggered by @rm3l |
openshift-user-workload-monitoring [RHDHBUGS-3724]
…edis-and-user-workload-monitoring
|
/build-images |
|
✅ PR images built successfully! Images are available for testing:
Also available with PR number tag:
Triggered by @rm3l |
…edis-and-user-workload-monitoring
|
|
/build-images |
|
✅ PR images built successfully! Images are available for testing:
Also available with PR number tag:
Triggered by @rm3l |



Description
Two fixes to the base NetworkPolicies introduced in #3394:
Add
allow-redis-egressNetworkPolicy (port 6379 TCP, broad; no pod/namespace selector).Redis is part of the recommended checklist for production deployments but is not deployed OOTB; users bring their own in any namespace or as an external managed service. The rule therefore has no pod or namespace selector. If we don't have that NP, it will break customers running in prod with Redis.
Add
openshift-user-workload-monitoringtoallow-metrics-ingress.User-deployed ServiceMonitors are scraped by the Prometheus in
openshift-user-workload-monitoring, not by the platform Prometheus inopenshift-monitoring. Without this namespace in the allow list, enabling metrics would deploy the ServiceMonitor but its scraper would be blocked by the default-deny NP.Which issue(s) does this PR fix or relate to
PR acceptance criteria
How to test changes / Special notes to the reviewer
Unit tests updated (NP counts bumped from 6 to 7 backend NPs in all test assertions).
To verify manually:
allow-redis-egressNP is created with port 6379 TCP and notoselectorallow-metrics-ingressNP includesopenshift-user-workload-monitoringin thefromnamespace selectors