title: Error in running DPDK L2FWD application on a container managed by Kubernetes
body: <p>I am trying to run DPDK L2FWD application on a container managed by Kubernetes.</p>
  
  <p>To achieve this I have done the below steps -</p>
  
  <ul>
  <li><p>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. </p></li>
  <li><p>To create customized DPDK docker image, I have used the below Dockerfile</p></li>
  </ul>
  
  <blockquote>
    <p>FROM ubuntu:16.04  RUN apt-get update<br>
    RUN apt-get install -y net-tools<br>
    RUN apt-get install -y python<br>
    RUN apt-get install -y kmod 
    RUN apt-get install -y iproute2<br>
    RUN apt-get install -y net-tools 
    ADD ./dpdk/ /home/sdn/dpdk/<br>
    WORKDIR /home/sdn/dpdk/</p>
  </blockquote>
  
  <ul>
  <li>To run DPDK application inside POD, below host's directories are mounted to POD with privileged access: </li>
  </ul>
  
  <blockquote>
    <p>/mnt/huge<br>
    /usr<br>
    /lib<br>
    /etc</p>
  </blockquote>
  
  <p>Below is k8s deployment yaml used to create the POD</p>
  
  <pre><code>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
  </code></pre>
  
  <ul>
  <li><p>Below configurations are already done in host -</p>
  
  <ol>
  <li>Huge page mounting. </li>
  <li>Interface binding in user space.</li>
  </ol></li>
  <li><p>After successful creation of POD, when trying to run a DPDK L2FWD application inside POD, I am getting the below error -</p></li>
  </ul>
  
  <blockquote>
    <p>root@dpdk-pod126:/home/sdn/dpdk# ./examples/l2fwd/build/l2fwd -c 0x0f -- -p 0x03 -q 1<br>
    EAL: Detected 16 lcore(s)<br>
    EAL: Detected 1 NUMA nodes<br>
    EAL: Multi-process socket /var/run/dpdk/rte/mp_socket<br>
    EAL: No free hugepages reported in hugepages-1048576kB<br>
    EAL: 1007 hugepages of size 2097152 reserved, but no mounted hugetlbfs found for that size<br>
    EAL: FATAL: Cannot get hugepage information.<br>
    EAL: Cannot get hugepage information.<br>
    EAL: Error - exiting with code: 1<br>
    Cause: Invalid EAL arguments</p>
  </blockquote>