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

pod resource request for openshift.io/mlnxnics: '2' doesn't work #767

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

pod resource request for openshift.io/mlnxnics: '2' doesn't work #767

jeffreyyjp opened this issue Aug 28, 2024 · 4 comments

Comments

@jeffreyyjp
Copy link

Hi, team:

I have a question about pod request about sriov device.

When I config the pod with

resources:
      requests:
        openshift.io/mlnxnics: '2'
      limits:
        openshift.io/mlnxnics: '2'

I can only get one VF mlx5_5 in my pod, and there are only one newly attached network inferface net1

And below is my pod annotation:

Annotations:      k8s.v1.cni.cncf.io/network-status:
                    [{
                        "name": "cilium_etcd_ipam_online_10.32.240.0_21",
                        "interface": "eth0",
                        "ips": [
                            "10.32.245.19"
                        ],
                        "mac": "9a:a8:6f:2a:8d:4b",
                        "default": true,
                        "dns": {},
                        "gateway": [
                            "169.254.100.100"
                        ]
                    },{
                        "name": "sriov-network-operator/sriov-network1",
                        "interface": "net1",
                        "ips": [
                            "192.168.1.200"
                        ],
                        "mac": "5e:c8:70:96:f0:d5",
                        "mtu": 1500,
                        "dns": {},
                        "device-info": {
                            "type": "pci",
                            "version": "1.1.0",
                            "pci": {
                                "pci-address": "0000:47:00.1",
                                "rdma-device": "mlx5_5"
                            }
                        }
                    }]
                  k8s.v1.cni.cncf.io/networks: sriov-network-operator/sriov-network1
@jeffreyyjp
Copy link
Author

@SchSeba Could you help me to check this? Thanks

@SchSeba
Copy link
Collaborator

SchSeba commented Sep 2, 2024

That is because you only request one network

k8s.v1.cni.cncf.io/networks: sriov-network-operator/sriov-network1

to have two you can do

k8s.v1.cni.cncf.io/networks: sriov-network-operator/sriov-network1,sriov-network-operator/sriov-network1

Adding the resource in the pod spec is not mandatory if you let the sriov operator deploy the resource injector webhook pod

@jeffreyyjp
Copy link
Author

@SchSeba So for usual use cases, i only need to config k8s.v1.cni.cncf.io/networks in my pod, and doesn't need to care about device plugin resource?

@SchSeba
Copy link
Collaborator

SchSeba commented Sep 3, 2024

if you have the resource injector deployed on the cluster that is right
also if you are using a newer k8s version its good to enable this feature gate resourceInjectorMatchCondition

https://github.com/k8snetworkplumbingwg/sriov-network-operator?tab=readme-ov-file#available-feature-gates

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

2 participants