-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add external interfaces support for custom networks, update example
Signed-off-by: Rastislav Szabo <[email protected]>
- Loading branch information
1 parent
f87e2fc
commit f878a13
Showing
10 changed files
with
155 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Custom Networks in Contiv-VPP | ||
|
||
This example showcases usage of custom networks for multi-interface pods in Contiv-VPP. | ||
The main use-case for this feature are CNF deployments, where it can be combined with | ||
[service function chaining](../sfc). | ||
|
||
For more information on multi-interface pods in Contiv-VPP, look at the | ||
[custom pod interfaces documentation](../../../docs/operation/CUSTOM_POD_INTERFACES.md). | ||
|
||
## Demo Topology | ||
This demo deploys 2 CNF pods, each with one additional TAP interface in a layer 2 | ||
custom network defined as a CRD. Additionally, an external DPDK interface is defined | ||
with another CRD, and is placed into the same custom network as well. This means that the | ||
CNF interfaces and the external DPDK interface will be interconnected in a bridge | ||
domain on VPP: | ||
|
||
 | ||
|
||
Note that this demo refers to a single-node k8s cluster deployment. If the CNFs are deployed | ||
on different k8s nodes, they will be connected to different bridge domains, but still | ||
interconnected on L2 layer using a VXLAN tunnel between the bridge domains | ||
(actually, this is not working now, but will be implemented soon). | ||
|
||
This folder contains three yaml files: | ||
- [custom-network.yaml](custom-network.yaml) defines a L2 custom network with the name `l2net` | ||
- [cnfs-linux.yaml](cnfs-linux.yaml) defines CNF pods with additional interfaces in the `l2net` | ||
network (using the annotation `contivpp.io/custom-if: tap1/tap/l2net`) | ||
- [external-interface.yaml](external-interface.yaml) defines an external DPDK sub-interface | ||
in the `l2net` network. | ||
|
||
### Setup | ||
Before deploying, [external interface deployment yaml](external-interface.yaml) needs to be modified | ||
to match your setup: | ||
|
||
- change `node` identifier to match your hostname: | ||
- change `vppInterfaceName` identifier to match a DPDK interface on the particular node: | ||
|
||
```yaml | ||
nodes: | ||
- node: k8s-master | ||
vppInterfaceName: GigabitEthernet0/a/0 | ||
``` | ||
Don't forget to [modify your VPP startup config file](../../../docs/setup/VPP_CONFIG.md) | ||
with the PCI address of the external interface. | ||
## Demo | ||
Start by deploying the yaml files: | ||
```bash | ||
kubectl apply -f custom-network.yaml | ||
kubectl apply -f cnfs-linux.yaml | ||
kubectl apply -f external-interface.yaml | ||
``` | ||
|
||
Verify that `linux-cnf` pods are running: | ||
```bash | ||
$ kubectl get pods -o wide | ||
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES | ||
linux-cnf1 1/1 Running 0 56m 10.1.1.4 lubuntu <none> <none> | ||
linux-cnf2 1/1 Running 0 56m 10.1.1.5 lubuntu <none> <none> | ||
|
||
``` | ||
|
||
Verify that CNF taps and DPDK sub-interface are all connected into the same bridge domain on the | ||
vswitch VPP: | ||
```bash | ||
$ sudo vppctl | ||
_______ _ _ _____ ___ | ||
__/ __/ _ \ (_)__ | | / / _ \/ _ \ | ||
_/ _// // / / / _ \ | |/ / ___/ ___/ | ||
/_/ /____(_)_/\___/ |___/_/ /_/ | ||
|
||
vpp# sh inter addr | ||
... | ||
GigabitEthernet0/a/0.200 (up): | ||
L2 bridge bd-id 2 idx 2 shg 1 | ||
... | ||
tap5 (up): | ||
L2 bridge bd-id 2 idx 2 shg 1 | ||
tap6 (up): | ||
L2 bridge bd-id 2 idx 2 shg 1 | ||
``` | ||
|
||
Try sending some L2 broadcast traffic (e.g. ARP) from one of the CNFs or external interface. | ||
You should see it coming to all other interfaces in the bridge domain. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,12 @@ | ||
--- | ||
apiVersion: contivpp.io/v1 | ||
kind: ExternalInterface | ||
metadata: | ||
name: vlan-200 | ||
spec: | ||
type: L2 | ||
network: l2net | ||
nodes: | ||
- node: k8s-master | ||
vppInterfaceName: GigabitEthernet0/a/0 | ||
VLAN: 200 |
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
49 changes: 30 additions & 19 deletions
49
plugins/crd/handler/externalinterface/model/externalinterface.pb.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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