Skip to content
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

Automatically create NetworkPolicies if NetworkPolicy usage is detected #3497

Open
jrcichra opened this issue Oct 31, 2024 · 1 comment
Open
Assignees

Comments

@jrcichra
Copy link

Is your feature request related to a problem? Please describe:
When specifying a URL to import either via virtctl image-upload or on a dataVolumeTemplate and the cluster makes use of NetworkPolicies, users are required to apply a NetworkPolicy in their namespace to make the import work.

For dataVolumeTemplate of an Ubuntu ISO:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-ubuntu-iso-download
spec:
  egress:
    - ports:
        - port: 443
          protocol: TCP
  podSelector:
    matchLabels:
      app: containerized-data-importer
  policyTypes:
    - Egress

For virtctl image-upload:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-image-upload
spec:
  ingress:
    - from:
        - namespaceSelector:
            matchLabels:
              kubernetes.io/metadata.name: cdi
    - ports:
        - port: 443
          protocol: TCP
  podSelector:
    matchLabels:
      app: containerized-data-importer
  policyTypes:
    - Ingress

Describe the solution you'd like:
An option for KubeVirt CDI to detect if NetworkPolicies are being used in a namespace. If they are, add one to allow containerized-data-importer to download the image. If not, don't apply a NetworkPolicy.

Describe alternatives you've considered:
For now users are able to specify the above NetworkPolicies to import their VM.

Additional context:
Add any other context or screenshots about the feature request here.

@aglitke
Copy link
Member

aglitke commented Nov 18, 2024

/assign @akalenyu

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

No branches or pull requests

3 participants