Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Allocate CPUs to the Cloud-Native Router Forwarding Plane

Learn how to allocate CPU cores using static CPU allocation or using the Kubernetes CPU Manager.

The Cloud-Native Router installation Helm chart and the vRouter CRD provide you with a number of controls to allocate CPU cores to the Cloud-Native Router vRouter. You can specify the requested number of cores, the core limit, and the cores to be assigned, either through static CPU allocation or through the Kubernetes CPU Manager.

Allocate CPUs Using the Kubernetes CPU Manager

Use this procedure to allocate CPU cores to vRouter DPDK pods using the Kubernetes CPU Manager.

This is the recommended approach if your cluster is running the Kubernetes CPU Manager.

  1. Configure the Helm chart to specify the number of guaranteed vRouter CPUs that you want for the vRouter pods.
    In the main values.yaml file:
    1. Disable the static CPU allocation method of assigning CPU cores by commenting out the following lines:
    2. Configure the vRouter DPDK pods to use the guaranteed CPUs reserved by the Kubernetes CPU Manager.
      For example, to reserve 5 CPU cores:This value must be smaller or equal to the number of CPU cores reserved by the Kubernetes CPU Manager.
      The minimum recommended number is one more than the desired number of forwarding cores.
    3. Specify the number of CPU cores to use for vRouter DPDK service/control threads.
      For example, to reserve 1 core for vRouter DPDK service/control threads:This leaves the remaining cores (four, in this example) for forwarding.
  2. Proceed with your Cloud-Native Router installation.
  3. After Cloud-Native Router is installed, check to make sure the vRouter DPDK pods has a QoS Class of Guaranteed.
    The output should look like this:
  4. To find out which CPUs are allocated to the vRouter DPDK container:
    The output should list the cores assigned to the container.
  5. To view the CPU assignment from the Kubernetes CPU Manager:
    1. SSH into a node where Cloud-Native Router is running.
    2. Look at the Kubernetes CPU Manager state.
      For example:
      Note:

      You'll need to install jq (dnf install -y jq) in order to see formatted output.

Allocate CPUs Using Static CPU Allocation

Use this procedure to allocate CPU cores to vRouter DPDK pods using static CPU allocation.

We recommend you use this method only when your cluster is not running the Kubernetes CPU Manager.

  1. Configure the Helm chart to specify the cores that you want the vRouter DPDK to use. Specify the CPU cores to use for static CPU allocation. You can also specify the CPU core(s) to allocate to vRouter DPDK control threads using dpdkCtrlThreadMask and the CPU core(s) to allocate to vRouter DPDK service threads using the serviceCoreMask.
    For example, to specify cores 2, 3, 22, and 23:
  2. Proceed with your Cloud-Native Router installation.

Allocate CPUs Using Nokia CPU Pooler

Note: Nokia CPU Pooler is supported only for Cloud-Native Router single-pod installation.

The Nokia CPU Pooler is a Kubernetes device plugin designed to manage CPU resources more effectively by organizing them into distinct pools. It exposes CPU cores as consumable devices to the scheduler and physically isolates CPU resources for containers based on their performance needs.

It supports three types of CPU pools:

  • Exclusive Pool: Allocates dedicated CPU cores to latency-sensitive containers.

  • Shared Pool: Allocates fractional CPUs (millicores) to containers that can tolerate some sharing.

  • Default Pool: The standard Kubernetes CPU allocation used when no specific pool is requested.

Use this procedue to allocate CPU cores to vRouter DPDK using Nokia CPU Pooler:

  1. Ensure Nokia CPU pooler is set up on the node where the Cloud-Native Router needs to be installed.
  2. Update the Cloud-Native Router helm chart with the guaranteedVrouterCpus flag. Comment the cpu_core_mask flag to disable the default setting. Ensure dpdkCtrlThreadMask and serviceCoreMask is disabled as well.