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

SriovNetwork can't be create in kube-system namespace #763

Open
jeffreyyjp opened this issue Aug 27, 2024 · 4 comments
Open

SriovNetwork can't be create in kube-system namespace #763

jeffreyyjp opened this issue Aug 27, 2024 · 4 comments

Comments

@jeffreyyjp
Copy link

Hi guys.
I use below to configue SriovNetwork

apiVersion: sriovnetwork.openshift.io/v1
kind: SriovNetwork
metadata:
  name: sriov-network
  namespace: kube-system
spec:
  ipam: |
    {
      "type": "whereabouts",
      "subnet": "192.168.1.0/24",
      "rangeStart": "192.168.1.200",
      "rangeEnd": "192.168.1.207",
      "gateway": "192.168.1.1",
      "routes": [{
        "dst": "0.0.0.0/0","gw":"192.168.1.1"
      }]
    }
  vlan: 0
  resourceName: mlnxnics

But I can't get a network-attachment-definitions in kube-sytem.

But if I modify the ns in my yaml, I can get

apiVersion: sriovnetwork.openshift.io/v1
kind: SriovNetwork
metadata:
  name: sriov-network
  namespace: sriov-network-operator
spec:
  ipam: |
    {
      "type": "whereabouts",
      "subnet": "192.168.1.0/24",
      "rangeStart": "192.168.1.200",
      "rangeEnd": "192.168.1.207",
      "gateway": "192.168.1.1",
      "routes": [{
        "dst": "0.0.0.0/0","gw":"192.168.1.1"
      }]
    }
  vlan: 0
  resourceName: mlnxnics
@adrianchiris
Copy link
Collaborator

you can set spec.networkNamespace to create the network attachment definition in a different namespace.

@SchSeba
Copy link
Collaborator

SchSeba commented Aug 27, 2024

Hi @jeffreyyjp,

The sriovNetwork MUST be created in the namespace where the operator is running.
and as commented by @adrianchiris you can use spec.networkNamespace to tell the operator on which namespace he should create the respected net-attach-def

If that is not clear from the readme please let us know and we can improve them.

Let me know if we can close this issue

@jeffreyyjp
Copy link
Author

@SchSeba Sure, But from the readme, where we can find the config in these API: https://github.com/k8snetworkplumbingwg/sriov-network-operator?tab=readme-ov-file#api
I think the docs should point it out.

@SchSeba
Copy link
Collaborator

SchSeba commented Sep 2, 2024

Hi @jeffreyyjp you are right we should change the readme

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

No branches or pull requests

3 participants