-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LACP support: added lacprate and xmitpolicy
- Loading branch information
killianmuldoon
committed
May 29, 2020
1 parent
f1722e1
commit 2e41fe1
Showing
4 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## LACP bonding mode - experimental | ||
|
||
Three parameters are used in the bonding config to configure LACP mode: | ||
|
||
First mode must be set to "802.3ad". | ||
|
||
Second LACP Rate can be set to either "fast" or "slow" | ||
|
||
Third xmitHashPolicy must be set. This defaults to layer2 and can be set to any of: | ||
* "layer2" | ||
* "layer3+4" | ||
* "layer2+3" | ||
* "encap2+3" | ||
* "encap3+4" | ||
|
||
Which of those is preferred depends your specific network design. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: "k8s.cni.cncf.io/v1" | ||
kind: NetworkAttachmentDefinition | ||
metadata: | ||
name: bond-lacp | ||
spec: | ||
config: '{ | ||
"type": "bond", | ||
"cniVersion": "0.3.1", | ||
"name": "bond-lacp", | ||
"ifname": "bond0", | ||
"mode": "802.3ad", | ||
"xmitHashPolicy": "layer2+3", | ||
"lacpRate": "fast", | ||
"mtu": 1500, | ||
"linksInContainer": true, | ||
"miimon": "100", | ||
"links": [ | ||
{"name": "net1"}, | ||
{"name": "net2"} | ||
], | ||
"ipam": { | ||
"type": "host-local", | ||
"subnet": "10.56.217.0/24", | ||
"routes": [{ | ||
"dst": "0.0.0.0/0" | ||
}], | ||
"gateway": "10.56.217.1" | ||
} | ||
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: test-pod | ||
annotations: | ||
k8s.v1.cni.cncf.io/networks: '[ | ||
{"name": "sriov-backup-bondnet", | ||
"interface": "net1" | ||
}, | ||
{"name": "sriov-backup-bondnet", | ||
"interface": "net2" | ||
}, | ||
{"name": "bond-lacp", | ||
"interface": "bond0" | ||
}]' | ||
spec: | ||
restartPolicy: Never | ||
hostPID: true | ||
hostIPC: true | ||
containers: | ||
- name: bond-test | ||
image: alpine:latest | ||
command: | ||
- /bin/sh | ||
- "-c" | ||
- "sleep 60m" | ||
imagePullPolicy: IfNotPresent | ||
resources: | ||
requests: | ||
intel.com/intel_sriov_netdevice: '2' | ||
limits: | ||
intel.com/intel_sriov_netdevice: '2' |