Skip to content

NE-1476: Allow test pods to access DNS metrics ports#30753

Open
rfredette wants to merge 1 commit intoopenshift:mainfrom
rfredette:NE-1476-dns-networkpolicies
Open

NE-1476: Allow test pods to access DNS metrics ports#30753
rfredette wants to merge 1 commit intoopenshift:mainfrom
rfredette:NE-1476-dns-networkpolicies

Conversation

@rfredette
Copy link
Contributor

@rfredette rfredette commented Feb 3, 2026

New default network policies added in openshift/cluster-dns-operator#458 will limit access to DNS and DNS operator metrics ports to only pods in the openshift-monitoring namespace, which is causing the test [sig-instrumentation][Late] Platform Prometheus targets should not be accessible without auth [Serial] [Suite:openshift/conformance/serial] to fail.

The test fails because the test pods it creates are in a test namespace, and pods in that namespace do not have permission to access the DNS/DNS operator's monitoring ports to test if they require auth. This PR adds a network policy in both the openshift-dns and openshift-dns-operator namespaces that grants the test namespace access to each of the monitoring ports so that the test can continue to function as expected.

@openshift-ci-robot
Copy link

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 3, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 3, 2026

@rfredette: This pull request references NE-1476 which is a valid jira issue.

Details

In response to this:

New default network policies will limit access to DNS and DNS operator metrics ports to only pods in the openshift-monitoring namespace. Rather than creating test pods in the openshift-monitoring namespace, add network policies that allow access to these metrics ports from the test namespace.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from jan--f and slashpai February 3, 2026 22:16
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 3, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rfredette
Once this PR has been reviewed and has the lgtm label, please assign simonpasquier for approval. For more information see the Code Review Process.

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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@melvinjoseph86
Copy link
Contributor

/retest

@rfredette rfredette force-pushed the NE-1476-dns-networkpolicies branch from d023e22 to a8e8ab9 Compare February 11, 2026 17:12
@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

New default network policies will limit access to DNS and DNS operator
metrics ports to only pods in the openshift-monitoring namespace. Rather
than creating test pods in the openshift-monitoring namespace, add a
network policy that allows access to these metrics ports from the test
namespace.
@rfredette rfredette force-pushed the NE-1476-dns-networkpolicies branch from a8e8ab9 to 545fbde Compare February 11, 2026 19:32
@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@openshift-trt
Copy link

openshift-trt bot commented Feb 12, 2026

Job Failure Risk Analysis for sha: 545fbde

Job Name Failure Risk
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 Low
[Monitor:legacy-test-framework-invariants-pathological][sig-arch] events should not repeat pathologically
This test has passed 50.00% of 2 runs on release 4.22 [Architecture:amd64 FeatureSet:default Installer:ipi JobTier:standard Network:ovn NetworkStack:ipv6 Owner:eng Platform:metal Procedure:none SecurityMode:default Topology:ha Upgrade:none] in the last week.

Open Bugs
Metal ipv6 payload failures
MAPO creates events when reconciling machines

@rfredette
Copy link
Contributor Author

Test failures are unrelated

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 12, 2026

@rfredette: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 16, 2026

@rfredette: This pull request references NE-1476 which is a valid jira issue.

Details

In response to this:

New default network policies added in openshift/cluster-dns-operator#458 will limit access to DNS and DNS operator metrics ports to only pods in the openshift-monitoring namespace, which is causing the test [sig-instrumentation][Late] Platform Prometheus targets should not be accessible without auth [Serial] [Suite:openshift/conformance/serial] to fail.

The test fails because the test pods it creates are in a test namespace, and pods in that namespace do not have permission to access the DNS/DNS operator's monitoring ports to test if they require auth. This PR adds a network policy in both the openshift-dns and openshift-dns-operator namespaces that grants the test namespace access to each of the monitoring ports so that the test can continue to function as expected.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@rfredette
Copy link
Contributor Author

Hey @simonpasquier, can you review this PR, or let me know what the process is for requesting a PR review from the monitoring team? Thanks in advance!

// do not provide network policies, creating these policies can
// restrict traffic to/from other pods in the relevant namespace,
// causing unexpected behavior.
if len(policies.Items) != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

(nit) easier to read

Suggested change
if len(policies.Items) != 0 {
if len(policies.Items) == 0 {
continue
}


g.By("checking that targets reject the requests with 401 or 403")
TCP := v1.ProtocolTCP
networkPolicies := []networkingv1.NetworkPolicy{
Copy link
Contributor

Choose a reason for hiding this comment

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

can we refactor this so it's easy to add more network policies for other components if needed? IIUC we need only the target's namespace + port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants