Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Subinterface Support with Multus

Starting with Release 23.3, Cloud-Native Contrail® Networking™ (CN2) supports multiple network subinterfaces using the Multus "meta" plugin. The "meta" references the Multus multi-vendor support.

Prerequisites

For Multus to process subinterfaces, the parent interface (physical or virtual) must be available.

VLAN Subinterface Overview

The following applies to the VLAN subinterface:

  • A subinterface is always defined and associated with a parent interface.

  • This subinterface is associated with a virtual network different from the parent interface.

  • The subinterface should have a valid VLAN tag (1–4095).

  • Subinterfaces, like regular interfaces, are created by CN2 for a pod based on the network annotations supplied.

For more information about how Multus works in a Cloud-Native Contrail environment, see Enable Pods with Multiple Network Interfaces and Enable VLAN Subinterface Support on Virtual interfaces.

Configuring Subinterfaces on Pods

To configure subinterfaces on pods use the network definition tags net.juniper.contrail.interfacegroup and net.juniper.contrail.vlan in the annotations cni-args section of the YAML.

  • The net.juniper.contrail.interfacegroup tag does the following:

    • InterfaceGroup groups together two or more interfaces.

    • The parent interface is the network selection element associated with only this tag.

    • The subinterface is the network selection element associated with this tag and a VLAN tag.

  • The net.juniper.contrail.vlan tag specifies the VLANID on the subinterface.

CN2 CNI with Multus

This section includes example YAMLs for configuring the CN2 CNI using Multus.

Example Network Attachment Definition for Subinterfaces

A VLAN subinterface belongs to its parent interface. You must specify the namespace to which the subinterface attaches. See the following example.

Example Pod YAML

The following example shows specified pod annotations for the cni-args. This example configuration creates the following three virtual machine interfaces (VMIs) and three interface IP addresses (IIPs) within the pod:

  • VMI, IIP for eth0 on the default pod network

  • VMI, IIP for eth1 on multus-vn-1 (parent interface)

  • VMI, IIP for eth1.100 on multus-vn-2 (subinterface)

Pod Creation Flow Overview

Kubemanager listens to pod creation, deletion, and update events. When detecting new pod creation:

  • Kubemanager parses the pod information and creates the corresponding VM (pod), VMI (pod interface), and IIP (pod interface IP).

  • This information is passed to vRouter agent using the XMPP communication channel between the Contrail controller and vRouter agent.

  • In parallel to this communication, the kubelet gets a setup pod event and evokes the CN2 CNI to configure the pod networking.

API Calls and Output

The following steps show the API calls and output when creating and configuring the subinterfaces.

  1. The CN2 CNI calls get vm-cfg (GET POD_CONFIG()) (sample get url [<span class="underline">http://127.0.0.1:9091/vm-cfg/\_\_multus-vlan\_\_multus-pod-4</span>](http://127.0.0.1:9091/vm-cfg/__default__testpmd-pod)) API to get a list of all VMIs (virtual machine interfaces) configured using the Contrail controller.

    Example output:

  2. The CN2 CNI processes this information and calls the port add message (POST VMI) (sample post api [<span class="underline">http://127.0.0.1:9091/vm</span>](http://127.0.0.1:9091/vm) )

    Example output:

  3. Then the CN2 CNI does get result (GET VM IP) to vrouter-agent ( sample api [<span class="underline">http://127.0.0.1:9091/vm/68627577-c1c5-4dac-acf1-3f4547b795e0/83fbe4ee-79ce-4d1a-972e-5420138eae7f</span>](http://127.0.0.1:9091/vm/68627577-c1c5-4dac-acf1-3f4547b795e0/83fbe4ee-79ce-4d1a-972e-5420138eae7f) )

    Example output:

  4. Now the CN2 CNI gets the IP address to configure in the pod, performs the configuration as needed, and returns results to the kubelet.

    • If configuration request is to add a subinterface, check if parent interface exists. If not, create the parent interface and then create the subinterface.

    • If configuration request is to delete the parent interface, delete the subinterfaces.

Verify Subinterfaces

To confirm the subinterfaces are created:

  • Ping between two pods via subinterfaces.

  • Create multiple subinterfaces on a single parent interface in a pod.

  • Create multiple subinterfaces and multiple parent interfaces in a pod.

You can also run the kubectl exec command to access inside the pod. Then run the ip addr command to display the current networking.

Example output: