Running inline_upf_demo in Kubernetes

Link-Inline™ Software User Guide

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

Use this procedure to run the inline_upf_demo application in the Kubernetes environment.

Before you begin

Make sure that you have:

About this task

The inline_upf_demo application demonstrates the offload features in a UPF test setup. As shown in the following figure, the inline_upf_demo application is connected to the Napatech DPDK PMD (ntnic) in the Kubernetes environment.

The inline_upf_demo application is connected to the Napatech DPDK PMD (ntnic) in the Kubernetes environment.

In this setup, the traffic generator transmits GTPv1-U tunneled traffic on one port (uplink), and transmits IP traffic on another port (downlink). On the DUT node, port 0 of the SmartNIC receives uplink traffic which contains the GTPv1-U header, and port 1 receives downlink traffic. Received frames on port 0 are delivered to the inline_upf_demo application. The application then configures flow rules for offloading based on the received frames. After flows are learned, the SmartNIC offloads frames with matched flows before transmitting them on another port. For more information on the inline_upf_demo application, see UPF Demo Application.

Procedure

  1. Delete any application containers, which are currently running.
    For example:
    kubectl delete -f kubernetes_v22.11.1/manifest/k8s-forward.yaml
    kubectl delete -f kubernetes_v22.11.1/manifest/k8s-custom-main.yaml
    An output example:
    deployment.apps "forward" deleted
    deployment.apps "custom-main" deleted
  2. Edit the ntdevplugin.yaml configuration file.
    cd /opt/ntinl/
    vim kubernetes_v<version>/ntdevplugin/ntdevplugin.yaml
    where version is the version identifier of the corresponding package.
    Set the MainApp parameter to "disabled" if it is currently enabled. Disabling the Napatech main-app container allows the inline-upf-demo container to request the nt_pf resource to the Napatech device plugin.
    MainApp: "disabled"
    Adjust other parameters if necessary.

    For more information on the supported parameters in the ntdevplugin.yaml file, see ConfigMap.

  3. Edit the k8s-inline-upf-demo.yaml file if necessary.
    vim kubernetes_v<version>/manifest/k8s-inline-upf-demo.yaml
    Parameters for the inline_upf_demo application can be added. For example:
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: napatech-inline-upf-demo-config
      namespace: default
    data:
      DpdkArgs: "--single-file-segments"
      AppArgs: "-v -n"
    immutable: true
    ---
    
    It is possible to add the EAL parameters to DpdkArgs and the application parameters to AppArgs. For information on supported parameters, see UPF Demo Application.
  4. Delete the Napatech device-plugin container, after making changes in the ntdevplugin.yaml file.

    Skip this step if the ntdevplugin.yaml file has not been changed.

    Whenever the ntdevplugin.yaml file is changed, the Napatech device-plugin container must be deleted and restarted.
    kubectl delete -f kubernetes_v<version>/ntdevplugin/ntdevplugin.yaml
    where version is the version identifier of the corresponding package. For example:
    kubectl delete -f kubernetes_v22.11.1/ntdevplugin/ntdevplugin.yaml
    An output example:
    configmap "napatech-device-plugin-config" deleted
    daemonset.apps "napatech-device-plugin" deleted
    Deploy the Napatech device-plugin container. For example:
    kubectl apply -f kubernetes_v22.11.1/ntdevplugin/ntdevplugin.yaml
    An output example:
    configmap/napatech-device-plugin-config created
    daemonset.apps/napatech-device-plugin created
    Reboot the system.
    reboot
  5. Deploy the UPF demo.
    For example:
    kubectl apply -f kubernetes_v22.11.1/manifest/k8s-inline-upf-demo.yaml
    An output example:
    configmap/napatech-inline-upf-demo-config created
    deployment.apps/inline-upf-demo created
  6. Check whether the inline-upf-demo pod is running.
    kubectl get pods -A
    An output example:
    NAMESPACE     NAME                                     READY   STATUS      RESTARTS        AGE
    kube-system   helm-install-traefik-79rrr               0/1     Completed   1               56d
    kube-system   helm-install-traefik-crd-xtdj9           0/1     Completed   0               56d
    kube-system   svclb-traefik-5fecb96c-whwnn             2/2     Running     12 (120m ago)   56d
    kube-system   napatech-device-plugin-rkw6q             2/2     Running     2 (120m ago)    128m
    kube-system   coredns-77ccd57875-4kxvk                 1/1     Running     6 (120m ago)    56d
    kube-system   traefik-64f55bb67d-wlq42                 1/1     Running     6 (120m ago)    56d
    kube-system   local-path-provisioner-957fdf8bc-xgrkk   1/1     Running     7 (120m ago)    56d
    kube-system   metrics-server-648b5df564-2l7lp          0/1     Running     7 (120m ago)    56d
    default       inline-upf-demo-58fd8cb9d-p4mpf          1/1     Running     0               14s
  7. Check the log messages of the inline-upf-demo pod to verify whether the application is running properly.
    kubectl logs -n default inline-upf-demo-58fd8cb9d-p4mpf
    An output example:
    [root@doc-jmh2 ntinl_package-3.0.0-linux]# kubectl logs -n default inline-upf-demo-577d5787bd-m5w5zPOD Configuration from Napatech Device Plugin for resource 'napatech.com/nt_pf: 1
      NT_PF_DEV =       0000:42:00.0
      VF_TOKEN =        6daa2fe3-9144-4706-90c0-8ca6a34b35cb
    Configuration from configmap napatech-inline-upf-demo-config:
      DpdkArgs  =       
      AppArgs   =       -v
    Executing: dpdk-inline_upf_demo -l 1-4 -n 4 --file-prefix=nt-container0 --vfio-vf-token=6daa2fe3-9144-4706-90c0-8ca6a34b35cb -a 0000:42:00.0 -- -v
    EAL: Detected CPU lcores: 32
    EAL: Detected NUMA nodes: 2
    EAL: Detected static linkage of DPDK
    EAL: Multi-process socket /var/run/dpdk/nt-container0/mp_socket
    EAL: Selected IOVA mode 'VA'
    EAL: VFIO support initialized
    EAL: Using IOMMU type 1 (Type 1)
    EAL: Probe PCI driver: net_ntnic (18f4:1c5) device: 0000:42:00.0 (socket 1)
    ETHDEV: WRN: iova mode (2) should be PA for performance reasons
    ETHDEV: INF: NT VFIO device setup 0000:42:00.0
    NTHW: INF: PCI:0000:42:00.0: FPGA 0200-9563-55-16 (C8255B3710) [644B901E]
    ETHDEV: INF: PCI:0000:42:00.0:intf_0: link is up
    ETHDEV: INF: PCI:0000:42:00.0:intf_1: link is up
    Check pod processes on the host.
    ps ax | grep dpdk
    An output example:
      17223 ?        SLl    2:01 dpdk-inline_upf_demo -l 1-4 -n 4 --file-prefix=nt-container0 --vfio-vf-token=6daa2fe3-9144-4706-90c0-8ca6a34b35cb -a 0000:42:00.0 -- -v
      17378 pts/0    S+     0:00 grep --color=auto dpdk
  8. Transmit traffic on the traffic generator.
  9. Start the monitoring tool.
    kubectl -n kube-system exec \
    -it daemonsets/napatech-device-plugin -c napatech-main-app -- monitoring
    An output example:
     ┌─────────────────────────── monitoring pci:0000:42:00.0 fpga:200-9563-55-24 ──────────────────────────┐
     │  Port  Type   PCI   Intf       NIM    Link    Speed    MTU    Rx Mbps    Tx Mbps  Rx Mpps  Tx Mpps   │
     │ *   0  phys  00.0   phy0     present    up     100G   1500   69017.48   48741.74    56.75    40.08  ♦│
     │     1  phys  00.0   phy1     present    up     100G   1500   34632.82   49039.02    40.08    56.75  ▒│
     └──────────────────────────────────────────────────────────────────────────────────────────────────────┘
      MAC: 00:0d:e9:07:9d:17
     ┌──────────────────────────────────────────────────────────────────────────────────────────────────────┐
     │                                             Rx counters                                              │
     │ Packets         : 00000003087882542  Octets          :  00000407600495544                            │
     │ Broadcast       : 00000000000000000  Multicast       :  00000000000000000                            │
     │ Unicast         : 00000003087882542  Crc errors      :  00000000000000000                            │
     │ 64 octets       : 00000000000000000  65-127 octets   :  00000000000000000                            │
     │ 128-255 octets  : 00000003087882542  256-511 octets  :  00000000000000000                            │
     │ 512-1023 octets : 00000000000000000  1024-1518 octets:  00000000000000000                            │
     │ 1519-2047 octets: 00000000000000000  2048-4095 octets:  00000000000000000                            │
     │ 4096-8191 octets: 00000000000000000  8192-max octets :  00000000000000000                            │
     │ Undersize       : 00000000000000000  Oversize        :  00000000000000000                            │
     │ Fragments       : 00000000000000000  Drop events     :  00000000000000000                            │
     └──────────────────────────────────────────────────────────────────────────────────────────────────────┘
      Reset  Port   TX/Rx  Queue  Color  Flowstat
    
    Press the q key on the keyboard to view queue statistics. An output example:
     ┌─────────────────────────── monitoring pci:0000:42:00.0 fpga:200-9563-55-16 ──────────────────────────┐
     │  Queue  Owner   Dest           Packets              Octets      VQ Drop pkts      VQ Drop octets     │
     │ *   0   phy0  ctl/in  #000003036053532  #00000400759066224  #000000000000000  #00000000000000000    ♦│
     │     1   phy1  ctl/in  #000000000000000  #00000000000000000  #000000000000000  #00000000000000000    ▒│
     │     2     -unused-    #000000000000000  #00000000000000000  #000000000000000  #00000000000000000    ▒│
     │     3     -unused-    #000000000000000  #00000000000000000  #000000000000000  #00000000000000000    ▒│
     │     4     -unused-    #000000000000000  #00000000000000000  #000000000000000  #00000000000000000    ▒│
     │     5     -unused-    #000000000000000  #00000000000000000  #000000000000000  #00000000000000000    ▒│
     │     6     -unused-    #000000000000000  #00000000000000000  #000000000000000  #00000000000000000    ▒│
     └──────────────────────────────────────────────────────────────────────────────────────────────────────┘
    
     ┌──────────────────────────────────────────────────────────────────────────────────────────────────────┐
     │ QueueId:   0                                                                                         │
     │ flush packets   : 000000000000000  flush octets    : 00000000000000000                               │
     │ drop packets    : 000000000000000  drop octets     : 00000000000000000                               │
     └──────────────────────────────────────────────────────────────────────────────────────────────────────┘
      Reset  Port   TX/Rx  Queue  Color  Flowstat
  10. To delete the application pod, run:
    kubectl delete -f kubernetes_v22.11.1/manifest/k8s-inline-upf-demo.yaml
    An output example:
    deployment.apps "inline-upf-demo" deleted