Skip to content

Opt-in for network-policies provided by hco-bundle for CNAO and its components pods #2341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ormergi
Copy link
Contributor

@ormergi ormergi commented Jun 10, 2025

What this PR does / why we need it:
Enable CNAO operator and its operands pors operate when network restrictions in form of defaultl deny-all network-policy is in place, when managed by HCO.

The hco-bundle should provide network-policies allowing its operands work when network restrictions are in place.
In order to opt-in pods for the provided network-policies pods should be labeled with the following labels:

  1. hco.kubevirt.io/allow-access-cluster-services
    Allow access the cluster API and DNS.
    This is a fundamental requirement for a k8s controller to oprate, it is requiremd for the following compoents:
    • kubemacpool
    • ipam-extentions
    • kube-secondary-dns
  2. hco.kubevirt.io/allow-prometheus-access
    Allow Prometheus pods ingress the metrics endpoint
    Required by CNAO opreator pods, allowing promethues scrape CNAO metrics.

With this change the project manifest-templator and csv-gen tool should produce the project Deployment and CSV with the above labels.
Allowing CNAO to operate under network restrictions when managed by HCO.

In addition CNAO should generate and install kubemacpool, kubevirt-ipam-contoller and kube-secondary-dns with the above labels.
Allowing them to operate under network restrictions when managed by CNAO and HCO.

Special notes for your reviewer:

Release note:

CNAO operator and its components opt-in for network-policies provided by hco-bundle

The hco-bundle should provide network-policies allow operators
work as expected under network restrictions (global deny-all
network-policy).
The provided NPs affects pods who has the appropriate labels.

Opt-in for hco-bundle NPs by adding the following labels:
1. hco.kubevirt.io/allow-access-cluster-services
   Allow CNAO pods egress access the cluster API and DNS.
2. hco.kubevirt.io/allow-prometheus-access
   Allow prometheus pods ingress the metrics endpoint

With this change the manifest-templator & csv-gen should produce
the project Deployment and CSV with the above labels.
Allowing CNAO to operate under network restrictions when installed
by HCO.

Signed-off-by: Or Mergi <ormergi@redhat.com>
@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Jun 10, 2025
@kubevirt-bot kubevirt-bot requested a review from phoracek June 10, 2025 12:51
@kubevirt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

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

ormergi added 3 commits June 11, 2025 14:25
The hco-bundle should provide network-policies allow operators
work as expected under network restrictions (global deny-all
network-policy).
The provided NPs affects pods who have the appropriate labels.

Opt-in for hco-bundle NPs by adding the following labels:
1. hco.kubevirt.io/allow-access-cluster-services
   Allow KMP pods egress access the cluster API and DNS.
2. hco.kubevirt.io/allow-prometheus-access
   Allow prometheus pods ingress the controller-manager metrics endpoint

With this change CNAO should generate and install kubemacpool
manifests with the above labels.
Allowing kubemacpool operate under network restrictions when
installed by CNAO and HCO.

Signed-off-by: Or Mergi <ormergi@redhat.com>
The hco-bundle should provide network-policies allow operators
work as expected under network restrictions (global deny-all
network-policy).
The provided NPs affects pods who have the appropriate labels.

Opt-in for hco-bundle NPs by adding the "hco.kubevirt.io/allow-access-cluster-services" label.
It allows kube-secondary-dns pods access the cluster API and DNS.

With this change CNAO should generate and install kube-secondary-
dns manifests with the above labels.
Allowing ube-secondary-dns operate under network restrictions
when installed by CNAO and HCO.

Signed-off-by: Or Mergi <ormergi@redhat.com>
The hco-bundle should provide network-policies allow operators
work as expected under network restrictions (global deny-all
network-policy).
The provided NPs affects pods who have the appropriate labels.

Opt-in for hco-bundle NPs by adding the "hco.kubevirt.io/allow-access-cluster-services" label.
It allows kubevirt-ipam-contoller pods access the cluster
API and DNS.

With this change CNAO should generate and install
kubevirt-ipam-contoller manifests with the above labels.
Allowing kubevirt-ipam-contoller operate under network
restrictions when installed by CNAO and HCO.

Signed-off-by: Or Mergi <ormergi@redhat.com>
Copy link

@ormergi ormergi changed the title manifests: Add opt-in labels for hco-bundle network-policies Add opt-in hco-bundle network-policies labels to CNAO pods Jun 11, 2025
@ormergi
Copy link
Contributor Author

ormergi commented Jun 11, 2025

@nunnatsa could you please confirm this PR adds the correct labels?

@ormergi ormergi changed the title Add opt-in hco-bundle network-policies labels to CNAO pods Opt-in for network-policies provided by hco-bundle for CNAO and its components pods Jun 12, 2025
@nunnatsa
Copy link
Contributor

The labels look good.

Still need detailed review if the right pods got the right labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants