Skip to content

Commit 817c0a8

Browse files
committed
docs: add alternative names discovery and usage guide
Document how to discover interface alternative names in node state and use them in SR-IOV network policies with examples. Signed-off-by: Carlos Goncalves <[email protected]>
1 parent 4d56507 commit 817c0a8

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,30 @@ status:
288288

289289
From this example, in status field, the user can find out there are 2 SRIOV capable NICs on node 'work-node-1'; in spec field, user can learn what the expected configure is generated from the combination of SriovNetworkNodePolicy CRs. In the virtual deployment case, a single VF will be associated with each device.
290290

291+
### Discovering Alternative Names
292+
293+
Alternative names are automatically discovered by the operator and stored in the `SriovNetworkNodeState` CR. You can view them using:
294+
295+
```bash
296+
$ kubectl get sriovnetworknodestate -n sriov-network-operator <node-name> -o yaml
297+
```
298+
299+
Look for the `altNames` field under each interface in the `status.interfaces` section:
300+
301+
```yaml
302+
status:
303+
interfaces:
304+
- name: ens803f1
305+
altNames:
306+
- eth0
307+
- net1
308+
- sriov1
309+
pciAddress: 0000:86:00.1
310+
vendor: "8086"
311+
deviceID: "1583"
312+
# ... other fields
313+
```
314+
291315
### SriovNetworkNodePolicy
292316

293317
This CRD is the key of SR-IOV network operator. This custom resource should be managed by cluster admin, to instruct the operator to:
@@ -391,6 +415,60 @@ spec:
391415

392416
> **NOTE**: Currently only `mellanox` plugin can be disabled.
393417

418+
### Alternative Interface Names Support
419+
420+
The SR-IOV Network Operator supports using network interface alternative names (altnames) when selecting interfaces in policies. This feature provides additional flexibility when configuring SR-IOV devices, especially in environments where interfaces may have multiple naming conventions.
421+
422+
When defining a `SriovNetworkNodePolicy`, you can use alternative names in the `nicSelector.pfNames` field. The operator will automatically match interfaces based on either their primary name or any of their alternative names.
423+
424+
**Example:**
425+
426+
Consider a network interface with the following properties:
427+
- Primary name: `ens803f1`
428+
- Alternative names: `eth0`, `net1`, `sriov1`
429+
430+
You can reference this interface using any of these names:
431+
432+
```yaml
433+
apiVersion: sriovnetwork.openshift.io/v1
434+
kind: SriovNetworkNodePolicy
435+
metadata:
436+
name: policy-using-altname
437+
namespace: sriov-network-operator
438+
spec:
439+
deviceType: netdevice
440+
nicSelector:
441+
pfNames: ["sriov1"] # Using alternative name instead of ens803f1
442+
vendor: "8086"
443+
nodeSelector:
444+
feature.node.kubernetes.io/network-sriov.capable: "true"
445+
numVfs: 4
446+
priority: 99
447+
resourceName: intelnics
448+
```
449+
450+
#### Alternative Names with VF Range Notation
451+
452+
Alternative names work seamlessly with the VF range notation (#-notation):
453+
454+
```yaml
455+
apiVersion: sriovnetwork.openshift.io/v1
456+
kind: SriovNetworkNodePolicy
457+
metadata:
458+
name: policy-with-vf-range
459+
namespace: sriov-network-operator
460+
spec:
461+
deviceType: netdevice
462+
nicSelector:
463+
pfNames: ["eth0#0-3"] # Using alternative name with VF range
464+
vendor: "8086"
465+
nodeSelector:
466+
feature.node.kubernetes.io/network-sriov.capable: "true"
467+
numVfs: 8
468+
priority: 99
469+
resourceName: intelnics
470+
```
471+
394472
## Feature Gates
395473

396474
Feature gates are used to enable or disable specific features in the operator.

0 commit comments

Comments
 (0)