vpp
vpp copied to clipboard
Is Contiv-vpp supported as a secondary plugin in Multus
My requirement is to setup Contiv on a network running Multus+Flannel with some nodes running Contiv/VPP. This is an updated version of the issue(https://github.com/contiv/vpp/issues/1739).
Here's what I have done so far -
- Bare K8 cluster running Multus + Flannel
- Apply
contiv-vpp.yaml
- Created a crd with contiv-cni as Network Attachment Definition -
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: contiv-cni-test
spec:
config: '{
"cniVersion": "0.3.1",
"type": "contiv-cni",
"grpcServer": "/var/run/contiv/cni.sock",
"logFile": "/var/run/contiv/cni.log"
}'
- Tried to create a Pod with the above network-attachment-definition in metadata as follows,
metadata:
name: pod3
annotations:
k8s.v1.cni.cncf.io/networks: contiv-cni-test
After which contiv earlier threw an error, cannot create eth0 as the file exists
I manually modified the file plugins/ipnet/pod.go
and changed the default podInterfaceHostName
to eth1
as follows -
diff --git a/plugins/ipnet/pod.go b/plugins/ipnet/pod.go
index f6cd032..fa57034 100755
--- a/plugins/ipnet/pod.go
+++ b/plugins/ipnet/pod.go
@@ -46,7 +46,7 @@ const (
podLinuxLoopLogicalNamePrefix = "linux-loop-"
// interface host name as required by Kubernetes for every pod
- podInterfaceHostName = "eth0" // required by Kubernetes
+ podInterfaceHostName = "eth1" // required by Kubernetes
// prefix for logical name of AF-Packet interface (VPP) connecting a pod
podAFPacketLogicalNamePrefix = "afpacket"
After recompiling contiv, I tested with updated docker images and got the following error -
Failed to create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "99dcc03daff59b936f3761ff2aa9d7be642e01c8fc3f98a224ea6653e66dedf2" network for pod "pod3": networkPlugin cni failed to set up pod "pod3_default" network: Multus: [default/pod3]: error adding container to network "contiv-cni-test": delegateAdd: error invoking DelegateAdd - "contiv-cni": error in getting result from AddNetwork: rpc error: code = Unknown desc = KeyErrors: [config/linux/l3/v2/route/0.0.0.0/0/linux-tap-99dcc03daff59b936f3761ff2aa9d7be642e01c8fc3f98a224ea6 (CREATE): failed to add linux route: file exists]
Note the failed to add linux route: file exists
What I wanna know before doing anything is that does Contiv support Multus and can act as a secondary plugin by changing some configuration? or is there any plan to extend support to Multus.
Thanks for any support.