Skip to content

Commit 49b5a65

Browse files
authored
Update k8s-best-practices-sr-iov-interface-settings.adoc
1 parent f8dc225 commit 49b5a65

File tree

1 file changed

+0
-124
lines changed

1 file changed

+0
-124
lines changed

modules/k8s-best-practices-sr-iov-interface-settings.adoc

Lines changed: 0 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -16,128 +16,4 @@ The following settings must be negotiated with the cluster administrator, for ea
1616
SR-IOV settings are enabled by the cluster administrator.
1717
====
1818

19-
.Example SRIOVnetworknodepolicy
20-
[source,yaml]
21-
----
22-
apiVersion: SRIOVnetwork.openshift.io/v1
23-
kind: SRIOVNetworkNodePolicy
24-
metadata:
25-
name: nnp-w1ens3f0grp2
26-
namespace: openshift-SRIOV-network-operator
27-
spec:
28-
deviceType: vfio-pci
29-
isRdma: false
30-
linkType: eth
31-
mtu: 9000
32-
nicSelector:
33-
deviceID: 158b
34-
pfNames:
35-
- ens3f0#50-63
36-
vendor: "8086"
37-
nodeSelector:
38-
kubernetes.io/hostname: worker-3
39-
numVfs: 64
40-
priority: 99
41-
resourceName: w1ens3f0grp2
42-
----
43-
4419
The `SRIOVnetwork` CR creates the `network-attach-definition` within the target `networkNamespace`.
45-
46-
[id="example-1"]
47-
.Example 1: Empty IPAM
48-
[source,yaml]
49-
----
50-
apiVersion: SRIOVnetwork.openshift.io/v1
51-
kind: SRIOVNetwork
52-
metadata:
53-
name: SRIOVnet
54-
namespace: openshift-SRIOV-network-operator
55-
spec:
56-
capabilities: '{ "mac": true }'
57-
ipam: '{}'
58-
networkNamespace: <WORKLOAD-NAMESPACE>
59-
resourceName: w1ens3f0grp2
60-
spoofChk: "off"
61-
trust: "on"
62-
vlan: 282
63-
----
64-
65-
[id="example-2"]
66-
.Example 2: Whereabouts IPAM
67-
[source,yaml]
68-
----
69-
apiVersion: SRIOVnetwork.openshift.io/v1
70-
kind: SRIOVNetwork
71-
metadata:
72-
name: SRIOVnet
73-
namespace: openshift-SRIOV-network-operator
74-
spec:
75-
capabilities: '{ "mac": true }'
76-
ipam: '{"type":"whereabouts","range":"FD97:0EF5:45A5:4000:00D0:0403:0000:0001/64","range_star t":"FD97:0EF5:45A5:4000:00D0:0403:0000:0001","range_end":"FD97:0EF5:45A5:4000:00D0:0403 :0000:0020","routes":[{"dst":"fd97:0ef5:45a5::/48","gw":"FD97:EF5:45A5:4000::1"}]}'
77-
networkNamespace: <WORKLOAD-NAMESPACE>
78-
resourceName: w1ens3f0grp2
79-
spoofChk: "off"
80-
trust: "on"
81-
vlan: 282
82-
----
83-
84-
[id="example-3"]
85-
.Example 3: Static IPAM
86-
[source,yaml]
87-
----
88-
apiVersion: SRIOVnetwork.openshift.io/v1
89-
kind: SRIOVNetwork
90-
metadata:
91-
name: SRIOVnet
92-
namespace: openshift-SRIOV-network-operator
93-
spec:
94-
capabilities: '{ "mac": true }'
95-
ipam: '{"type": "static","addresses":[{"address":"10.120.26.5/25","gateway":"10.120.26.1"}]}' networkNamespace: <WORKLOAD-NAMESPACE>
96-
resourceName: w1ens3f0grp2
97-
spoofChk: "off"
98-
trust: "on"
99-
vlan: 282
100-
----
101-
102-
[id="example-4"]
103-
.Example 4: Using Pod Annotations to attach
104-
[source,yaml]
105-
----
106-
apiVersion: v1
107-
kind: Pod
108-
metadata:
109-
name: sample-pod
110-
annotations: k8s.v1.cni.cncf.io/networks: |-
111-
[
112-
{
113-
"name": "net1",
114-
"mac": "20:04:0f:f1:88:01",
115-
"ips": ["192.168.10.1/24", "2001::1/64"]
116-
}
117-
]
118-
----
119-
120-
The examples depict scenarios used within to deliver secondary network interfaces with and without IPAM to a pod.
121-
122-
<<example-1>> creates a network attachment definition that does not specify an IP address, <<example-2>> makes use of the static IPAM and <<example-3>> makes use of the whereabouts CNI that provides a cluster wide dhcp option.
123-
124-
The actual addresses used for both whereabouts and static IPAM are managed external to the cluster.
125-
126-
The above `SRIOVnetwork` CR will configure a network attachment definition within the workload namespace.
127-
128-
[source,terminal]
129-
----
130-
$ oc get net-attach-def -n <workload_namespace>
131-
NAME AGE
132-
SRIOVnet 9d
133-
----
134-
135-
Within the workload namespace the SR-IOV resource is consumed via a pod annotation:
136-
137-
[source,yaml]
138-
----
139-
kind: Pod
140-
metadata:
141-
annotations:
142-
k8s.v1.cni.cncf.io/networks: SRIOVnet
143-
----

0 commit comments

Comments
 (0)