Skip to content

Commit 179e5f0

Browse files
committed
cleanup: Simple NAD example and standarise on bond0 interface
1 parent dcc34c1 commit 179e5f0

File tree

4 files changed

+66
-6
lines changed

4 files changed

+66
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ To accelerate a pod:
8282

8383
* Configure the [Onload Operator](#onload-operator)
8484
* Configure an [Onload Custom Resource (CR)](#onload-custom-resource-cr)
85-
* Configure a pod network with AMD Solarflare interfaces, ie. Multus IPVLAN or MACVAN
85+
* Configure a pod network with AMD Solarflare interfaces, ie. Multus [IPVLAN or MACVAN](docs/nad.md)
8686
* Configure the [out-of-tree `sfc` module](#out-of-tree-sfc-kernel-module)
8787
* [Configure your pods](#run-onloaded-applications) to use the resource provided by
8888
the [Onload Device Plugin](#onload-device-plugin) and the network
@@ -246,14 +246,14 @@ An easy test to verify everything is correctly configured is the
246246

247247
### Run Onloaded applications
248248

249-
To accelerate your workload, configure a pod with a AMD Solarflare network interface and
249+
To accelerate your workload, configure a pod with a AMD Solarflare [network interface](docs/nad.md) and
250250
[`amd.com/onload` resource](#resource-amdcomonload):
251251

252252
```yaml
253253
kind: Pod
254254
metadata:
255255
annotations:
256-
k8s.v1.cni.cncf.io/networks: ipvlan-sf0
256+
k8s.v1.cni.cncf.io/networks: ipvlan-bond0
257257
spec:
258258
...
259259
containers:

config/samples/sfnettest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Obtain the SFC interface's IP address of the `onload-sfnettest-server` pod:
1717
```sh
1818
$ kubectl describe pod onload-sfnettest-server | grep AddedInterface
1919
Normal AddedInterface 24s multus Add eth0 [192.168.8.114/23] from openshift-sdn
20-
Normal AddedInterface 24s multus Add net1 [198.19.0.1/16] from default/ipvlan-sf0
20+
Normal AddedInterface 24s multus Add net1 [198.19.0.1/16] from default/ipvlan-bond0
2121
```
2222

2323
The server pod is already running the accelerated `sfnt-pingpong` instance.

config/samples/sfnettest/client-server.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
name: onload-sfnettest-server
77
namespace: default
88
annotations:
9-
k8s.v1.cni.cncf.io/networks: ipvlan-sf0
9+
k8s.v1.cni.cncf.io/networks: ipvlan-bond0
1010
spec:
1111
restartPolicy: Always
1212
securityContext:
@@ -34,7 +34,7 @@ metadata:
3434
name: onload-sfnettest-client
3535
namespace: default
3636
annotations:
37-
k8s.v1.cni.cncf.io/networks: ipvlan-sf0
37+
k8s.v1.cni.cncf.io/networks: ipvlan-bond0
3838
spec:
3939
restartPolicy: Never
4040
securityContext:

docs/nad.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Network Attachment Definitions (NADs)
2+
3+
KubernetesOnload's recommended CNI is Multus, which is configured through a `NetworkAttachmentDefinition` *kind* of CR.
4+
5+
## Simple examples
6+
7+
The following examples presume an interface name of `bond0` and address allocation of `whereabouts` but
8+
neither bonding nor a specific address allocation method are required.
9+
10+
Ensure the NAD's `metadata.namespace` matches that of workload pods if Multus namespace isolation is configured.
11+
12+
### IPVLAN
13+
14+
```yaml
15+
apiVersion: k8s.cni.cncf.io/v1
16+
kind: NetworkAttachmentDefinition
17+
metadata:
18+
name: ipvlan-bond0
19+
spec:
20+
config: |
21+
{
22+
"cniVersion": "0.3.1",
23+
"type": "ipvlan",
24+
"name": "ipvlan-bond0",
25+
"master": "bond0",
26+
"ipam": {
27+
"type": "whereabouts",
28+
"range": "198.19.0.0/16"
29+
}
30+
}
31+
```
32+
33+
### MACVLAN
34+
35+
```yaml
36+
apiVersion: k8s.cni.cncf.io/v1
37+
kind: NetworkAttachmentDefinition
38+
metadata:
39+
name: macvlan-bond0
40+
spec:
41+
config: |
42+
{
43+
"cniVersion": "0.3.1",
44+
"type": "macvlan",
45+
"name": "macvlan-bond0",
46+
"master": "bond0",
47+
"mode": "bridge",
48+
"ipam": {
49+
"type": "whereabouts",
50+
"range": "198.18.0.0/16"
51+
}
52+
}
53+
```
54+
55+
## Footnotes
56+
57+
```yaml
58+
SPDX-License-Identifier: MIT
59+
SPDX-FileCopyrightText: (c) Copyright 2023 Advanced Micro Devices, Inc.
60+
```

0 commit comments

Comments
 (0)