Enabling the Napatech SmartNIC with Link-Inline™ Software in Kubernetes

Link-Inline™ Software User Guide

Platform
Napatech SmartNIC
Content Type
User Guide
Capture Software Version
Link-Inline™ Software 3.2

The Napatech device-plugin (NTDevPlugin) pod is required to use the Napatech SmartNIC running Link-Inline™ Software with containers managed by Kubernetes.

Kubernetes architecture with the Napatech SmartNIC running Link-Inline™ Software

The following figure illustrates the Napatech Kubernetes architecture.


The init container, the Napatech device-plugin container and the Napatech main-app container are included in the Napatech device-plugin pod . The Napatech main-app container is connected to the physical function using the ntnic PMD, and the user-application container is connected to a virtual function via the DPDK virtio PMD with the Napatech patch.

As depicted in the figure, the Napatech device-plugin pod consists of three containers: The init container, the Napatech device-plugin container and the Napatech main-app container.
  • The init container: Detects the SmartNIC, activates virtual functions and binds both the physical and virtual functions of the SmartNIC to the vfio-pci driver. See Init Container.
  • The Napatech device-plugin container: Runs the Napatech device plugin, which allocates resources for the physical and virtual functions. See Napatech Device-Plugin Container.
  • The Napatech main-app container: Runs the ntmain application, which is connected to the physical function. In the ntmain application, the VLAN ID for each virtual function is passed to the Napatech DPDK PMD, which then creates a table of VLAN IDs with associated virtual functions. The Napatech device-plugin pod can operate without the Napatech main-app container. See Napatech Main-App Container.

The Napatech main-app container is connected to the Napatech DPDK PMD (ntnic), and the user-application container is connected to the DPDK virtio PMD with the Napatech patch. Establishing a connection to the physical function using the Napatech DPDK PMD is required to access the SmartNIC for flow configuration, while traffic reception based on VLAN ID occurs through virtual function using the standard DPDK virtio PMD with the Napatech patch. When multiple user applications/containers/pods are running, it is recommended to have connections to the Napatech DPDK PMD and the DPDK virtio PMD in separate applications/containers/pods.

To enable flow configuration in the user application, the following components are supported:
  • The Napatech patch: This patch must be applied to the standard DPDK virtio PMD, enabling hardware offloading features of the DPDK rte_flow API functions.
  • The NTConnect module: This module facilitates a socket connection between the Napatech DPDK PMD and the user application. When DPDK rte_flow API functions are called in the user application, they are passed to the Napatech DPDK PMD via the NTConnect socket connection. The Napatech DPDK PMD adds the VLAN ID of the associated virtual function to the rte_flow configuration commands before forwarding them to the SmartNIC.
The NTConnect module is also used to retrieve statistics from the SmartNIC in the monitoring tool.

eth0 in the figure represents a standard network connection on each pod, which Kubernetes requires for controlling and communicating with pods.

ConfigMap

The ConfigMap, napatech-device-plugin-config for the Napatech device plugin pod can be found in the ntdevplugin.yaml file of the Napatech Link-Inline™ Software package.
ntinl_package-<version>/kubernetes_v<version>/ntdevplugin/ntdevplugin.yaml
where version is the version identifier of the corresponding package.
The following configuration parameters are supported.
Parameter Default value Description
NicPci autodetect The SmartNIC PCI bus ID should be provided in the format xxxx:xx:xx.0 or set to autodetect for automatic detection.
NicAutoInit enabled Enables the SmartNIC automatic configuration. The value disabled causes the pod failure if the SmartNIC configuration is incorrect.
MainApp enabled Enables the main-app container. See Enabling/disabling the Napatech main-app container.
vfCount 2 The number of virtual functions to be configured for the SmartNIC. The valid value range is 1 to 128.
vfMacStart 02:11:22:33:44:00 The MAC address of the first virtual function.
vfVlanStart 44 The VLAN ID of the first virtual function.
vfNumberOfQueues 1 The number of queues per virtual function. The SmartNIC supports a maximum of 128 queues in total across multiple virtual functions.

Deploying the Napatech device-plugin pod at selected Kubernetes nodes

It is recommended to assign a specific label to Kubernetes nodes with a Napatech SmartNIC running Link-Inline™ Software to make sure deploying the Napatech device-plugin pod only on nodes with the label. For instance, the following command adds the label napatech.com/ntdevplugin=enabled to the Kubernetes nodes, worker03 and workder04.
kubectl label nodes worker03 worker04 napatech.com/ntdevplugin=enabled
The nodeSelector can be added to the ntdevplugin.yaml file as demonstrated in the following example.
…
spec:
  selector:
    matchLabels:
      app: napatech-device-plugin
  template:
    metadata:
      labels:
        app: napatech-device-plugin
    spec:
      nodeSelector:
        napatech.com/ntdevplugin: enabled
This configuration ensures that the Napatech device-plugin pod is deployed on the Kubernetes nodes with the label napatech.com/ntdevplugin set to enabled, such as worker03 and workder04.