Error in running DPDK L2FWD application on a container managed by Kubernetes

3/14/2019

I am trying to run DPDK L2FWD application on a container managed by Kubernetes.

To achieve this I have done the below steps -

  • I have created single node K8s setup where both master and client are running on host machine. As network plug-in, I have used Calico Network.

  • To create customized DPDK docker image, I have used the below Dockerfile

FROM ubuntu:16.04 RUN apt-get update
RUN apt-get install -y net-tools
RUN apt-get install -y python
RUN apt-get install -y kmod RUN apt-get install -y iproute2
RUN apt-get install -y net-tools ADD ./dpdk/ /home/sdn/dpdk/
WORKDIR /home/sdn/dpdk/

  • To run DPDK application inside POD, below host's directories are mounted to POD with privileged access:

/mnt/huge
/usr
/lib
/etc

Below is k8s deployment yaml used to create the POD

apiVersion: v1
kind: Pod
metadata:
  name: dpdk-pod126
spec:
  containers:
  - name: dpdk126
    image: dpdk-test126
    imagePullPolicy: IfNotPresent
    command: ["/bin/sh"]
    args: ["-c", "while true; do echo hello; sleep 10;done"]
    resources:
      requests:
        memory: "2Gi"
        cpu: "100m"
    volumeMounts:
      - name: hostvol1
        mountPath: /mnt/huge
      - name: hostvol2
        mountPath: /usr
      - name: hostvol3
        mountPath: /lib
      - name: hostvol4
        mountPath: /etc
    securityContext:
      privileged: true
  volumes:
  - name: hostvol1
    hostPath:
      path: /mnt/huge
  - name: hostvol2
    hostPath:
      path: /usr
  - name: hostvol3
    hostPath:
      path: /home/sdn/kubernetes-test/libtest
  - name: hostvol4
    hostPath:
      path: /etc
  • Below configurations are already done in host -

    1. Huge page mounting.
    2. Interface binding in user space.
  • After successful creation of POD, when trying to run a DPDK L2FWD application inside POD, I am getting the below error -

root@dpdk-pod126:/home/sdn/dpdk# ./examples/l2fwd/build/l2fwd -c 0x0f -- -p 0x03 -q 1
EAL: Detected 16 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: No free hugepages reported in hugepages-1048576kB
EAL: 1007 hugepages of size 2097152 reserved, but no mounted hugetlbfs found for that size
EAL: FATAL: Cannot get hugepage information.
EAL: Cannot get hugepage information.
EAL: Error - exiting with code: 1
Cause: Invalid EAL arguments

-- Abhishek Nandi
dpdk
kubernetes

1 Answer

3/21/2019

According to this, you might be missing medium: HugePages from your hugepage volume.

Also, hugepages can be a bit finnicky. Can you provide the output of:
cat /proc/meminfo | grep -i huge
and check if there's any files in /mnt/huge?

Also maybe this can be helpful. Can you somehow check if the hugepages are being mounted as mount -t hugetlbfs nodev /mnt/huge?

-- AdamTL
Source: StackOverflow