Skip to content

PSAP-1178: Add NetworkPolicy k8s resources - #1323

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
jmencak:4.20-network_policy
May 14, 2025
Merged

PSAP-1178: Add NetworkPolicy k8s resources#1323
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
jmencak:4.20-network_policy

Conversation

@jmencak

@jmencak jmencak commented Apr 16, 2025

Copy link
Copy Markdown
Contributor

This change adds a default deny NetworkPolicy for ingress and egress in the openshift-cluster-node-tuning-operator namespace. The following flows are allowed by NetworkPolicies:

  • access to the API server
  • access to NTO Metrics server
  • access to NTO Webhook server

Resolves: PSAP-1178

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 16, 2025
@openshift-ci-robot

openshift-ci-robot commented Apr 16, 2025

Copy link
Copy Markdown
Contributor

@jmencak: This pull request references PSAP-1178 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set.

Details

In response to this:

This change adds a default deny NetworkPolicy for ingress and egress in the openshift-cluster-node-tuning-operator namespace. The following flows are allowed by NetworkPolicies:

  • access to the API server
  • access to NTO Metrics server
  • access to NTO Webhook server

Resolves: PSAP-1178

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 added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 16, 2025
@openshift-ci
openshift-ci Bot requested review from swatisehgal and yanirq April 16, 2025 16:24
@openshift-ci

openshift-ci Bot commented Apr 16, 2025

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jmencak

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

The pull request process is described 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 openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 16, 2025
Comment thread test/e2e/basic/modules.go Outdated
@rbaturov

Copy link
Copy Markdown
Contributor

@jmencak Thanks for your work Jiri.
The network policies look on point to me.
/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 17, 2025
This change adds a default deny NetworkPolicy for ingress and egress
in the openshift-cluster-node-tuning-operator namespace.  The following
flows are allowed by NetworkPolicies:
  - access to the API server
  - access to NTO Metrics server
  - access to NTO Webhook server

Resolves: PSAP-1178
@jmencak
jmencak force-pushed the 4.20-network_policy branch from 343a3f0 to 1b61c36 Compare April 17, 2025 09:16
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 17, 2025
@jmencak

jmencak commented May 12, 2025

Copy link
Copy Markdown
Contributor Author

/retest

2 similar comments
@jmencak

jmencak commented May 12, 2025

Copy link
Copy Markdown
Contributor Author

/retest

@jmencak

jmencak commented May 13, 2025

Copy link
Copy Markdown
Contributor Author

/retest

@jmencak jmencak changed the title WiP: PSAP-1178: Add NetworkPolicy k8s resources PSAP-1178: Add NetworkPolicy k8s resources May 13, 2025
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 13, 2025
@jmencak

jmencak commented May 13, 2025

Copy link
Copy Markdown
Contributor Author

@rbaturov any chance for LGTM again? No changes apart from dropping the code change already adjusted elsewhere as you suggested. Thank you!

@rbaturov

rbaturov commented May 14, 2025

Copy link
Copy Markdown
Contributor

/lgtm
We should consider adding E2E coverage later.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 14, 2025
@jmencak

jmencak commented May 14, 2025

Copy link
Copy Markdown
Contributor Author

/lgtm We should consider adding E2E coverage later.

Thank you. Agreed. However, this might be tricky for TuneD pods. These are hostNetwork pods and the NetworkPolicy behaviour is undefined for that.

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 488ca89 and 2 for PR HEAD 1b61c36 in total

@openshift-ci

openshift-ci Bot commented May 14, 2025

Copy link
Copy Markdown
Contributor

@jmencak: 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-merge-bot
openshift-merge-bot Bot merged commit c631b5d into openshift:main May 14, 2025
@jmencak
jmencak deleted the 4.20-network_policy branch May 15, 2025 03:49
@openshift-bot

Copy link
Copy Markdown
Contributor

[ART PR BUILD NOTIFIER]

Distgit: cluster-node-tuning-operator
This PR has been included in build cluster-node-tuning-operator-container-v4.20.0-202505151012.p0.gc631b5d.assembly.stream.el9.
All builds following this will include this PR.

jmencak added a commit to jmencak/cluster-node-tuning-operator that referenced this pull request Jul 23, 2026
NTO NetworkPolicy manifests that were added as part of openshift#1323 were missing
Cluster Profile (https://github.com/openshift/enhancements/blob/master/enhancements/update/cluster-profiles.md)
annotations.

Add the missing Cluster Profile annotations, so that CVO does not ignore the
NetworkPolicy manifests.

  include.release.openshift.io/self-managed-high-availability: "true"
  include.release.openshift.io/single-node-developer: "true"

Also add NTO namespace to the "default-deny-all" policy.

Resolves: OCPBUGS-99461
jmencak added a commit to jmencak/cluster-node-tuning-operator that referenced this pull request Aug 4, 2026
NTO NetworkPolicy manifests that were added as part of openshift#1323 were missing
Cluster Profile (https://github.com/openshift/enhancements/blob/master/enhancements/update/cluster-profiles.md)
annotations.

Add the missing Cluster Profile annotations, so that CVO does not ignore the
NetworkPolicy manifests.

  include.release.openshift.io/hypershift: "true"
  include.release.openshift.io/ibm-cloud-managed: "true"
  include.release.openshift.io/self-managed-high-availability: "true"
  include.release.openshift.io/single-node-developer: "true"

Also add NTO namespace to the "default-deny-all" policy.

Resolves: OCPBUGS-99461
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants