Installation
This document describes setting up FPP for multi-node production deployments.
Prerequisites
First, you need to install SR-IOV Network OperatorOpens in a new tab. You may also need to install Whereabouts CNI IPAM pluginOpens in a new tab to handle uplink IP address assignment. Unless you want to use FPP-CNI as your primary CNI (it was not tested so far in this quality), you also need to install Multus CNIOpens in a new tab.
FPP requirement is to have PCIDEVICE_ as env vars with PCI device ID, example:
Above variable can be set by SRIOV Network Device Plugin (which can be install standalone or by SRIOV Operator).
FPP was tested with SRIOV Operator versions
- origin-sriov-operatorOpens in a new tab
4.3.0 - openshift/sriov-network operatorOpens in a new tab commit
104db73503782b16900ebc1ce14f809bde2f1086, based on release 4.9
Whereabouts as IPAM plugin was tested with latest release, FPP requirement is
to have IP in pod annotations:
Unless FPP is being used on a single node (e.g. in a test environment), FPP VPPSwitch deployments need to be provided with uplink IPs in the pod annotation in a format such as that provided by Multus CNIOpens in a new tab. It's convenient to use WhereaboutsOpens in a new tab CNI IPAM plugin as described in the Configuring the cluster section of this document. The pod annotation expected by FPP is this:
Hugepages
The cluster nodes that run FPP need to provide hugepages as managed allocatable resource:
You can enable hugepages via sysfs, which should be early in the boot process:
Hugepages may also be allocated already during the boot process via kernel boot options hugepagesz=2M hugepages=2048
As a common starting point, allocate at least 12Gi of 2MB hugepages per node. Production hugepages setting is:
- fpp 1.0 6Gi for FPP-manager.
- fpp 1.1 9Gi for FPP-manager.
Uplink configuration
vppswitch uses DPDK-enabled uplink interfaces, it is required for dpdk driver
to use IOMMU enabled platform with isolation of IOMMU groups - for processor-
based (northbridge) PCI root ports and controller hub-based (southbridge) PCI
root ports. This is called Access Control Service (ACS) capabilities.
In order to enable IOMMU grouping, add following to boot options:
To activate those options, add them to e.g. /etc/default/grub and run:
and reboot the host.
To check if the system supports IOMMU grouping, run:
The proper output should look like this:
If the platform does not support IOMMU grouping, then above output would look like following:
References:
- https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#Ensuring_that_the_groups_are_validOpens in a new tab
- https://forum.level1techs.com/t/sr-iov-all-virtual-functions-in-same-iommu-group-breaking-vms/163152/3Opens in a new tab
Uplink interface missing in fpp-manager
If there are no uplink interfaces present in vppswitch, exec to vppswitch
pod and execute:
Search for output like this:
If above output is present in vpp logs, enable IOMMU grouping if node is able to use it, or configure no-iommu mode for VFIO kernel module described below.
Configuration for VFIO-no-IOMMU platform
When a worker node does not support IOMMU, it is possible to run fpp-manager
by disabling IOMMU, make sure that following boot options are not set
in /proc/cmdline:
For DPDK driver to pick up NIC (PF/VF) on platform that does not support IOMMU, enablement of unsafe no-iommu mode needs to be done:
Above setting needs to be applied after each restart of a node.
To check if kernel supports no-iommu module run:
References:
- https://www.mail-archive.com/vpp-dev@lists.fd.io/msg14509.htmlOpens in a new tab
- https://dpdk-guide.gitlab.io/dpdk-guide/setup/binding.html#vfio-no-iommuOpens in a new tab
- https://doc.dpdk.org/guides/linux_gsg/linux_drivers.html#vfio-no-iommu-modeOpens in a new tab
Uplinks using direct NIC assignment
FPP Manager can use Physical Functions (PFs) as uplinks. This means that no SRIOV
operator is needed, and NIC PCI IDs can be passed in FPP deployment directly.
Helm based deployment uses directNICMappings, which configures PCI IDs via env
vars and enables direct access to the system firmware directory (/lib/firmware).
To use PFs of a NIC, first make sure that the machine uses the newest firmware files (see next section for details on how to update ICE DDP package for Intel E810), then check which card should be used by FPP, for example:
In this example, 8a:00.1 and 8a:00.3 will be used. When using PFs with VPP,
vfio-pci driver should be used. Ensure that no VFs are created on that NICs,
in case if SRIOV Network Operator is used this means that SRIOV Custom Resources
using these NICs need to be removed (SriovNetworkNodePolicy objects).
Below is an example command that disables VFs on the machine:
After that, bind NICs to the vfio driver (e.g. using dpdk-devbind.sh tool from dpdk package):
Caution
This method of binding NICs to vfio-pci must be repeated after reboot
Following these steps, NICs should be ready to be used by FPP Manager. The following chart configuration will enable FPP DaemonSet to use the NICs and assign IPs:
The above settings will be translated into env vars in the FPP DaemonSet:
The following DPDK interfaces will be configured in startup.conf:
uplink0 and uplink1 can be used in VPPConfig beforeCommands and afterCommands sections.
FPP Manager will create these VPPInterface objects corresponding to these NICs to be used
as uplinks or as external network interfaces if according to the external network prefixes
defined in VPPConfig (interfaces not matching any interface name prefixes are used as uplinks).
spec.uplinkConfig.ips in VPPConfig can be used to assign the IPs to the interfaces
(an example of values.yaml fragment):
Intel E810 support
FPP Manager supports Intel E810 NIC cards after updating the DDP (Dynamic Device Personalization) package. The following steps needs to be performed to update the DDP package:
- Download DDP package from Intel driver pageOpens in a new tab , tested with
1.3.37.0version. - Unpack the zip file you downloaded from the Intel site and then unpack the zip file inside it (
ice_comms-1.3.37.0.zip) - Copy the DDP package file
ice_comms-1.3.37.0.pkgto/lib/firmware/intel/ice/ddp/ - In the same directory (
/lib/firmware/intel/ice/), create symlink/lib/firmware/intel/ice/ddp/ice.pkgto point to the file you copied above:
- On the host, run
update-initramfs -c -k $(uname -r)to update initrd. All the PFs need to have the same version of the DDP package - Reboot the node to load the updated DDP package
- Check that the DDP package has been updated
Configuring the cluster
You need then to configure SriovNetworkNodePolicy objects for
uplinks, that is the NICs that will be used by VPPSwitch daemon
pods. If you want to use the standard deployment YAMLs without
changing resource specifications, you need to name the uplink
resources uplink0, uplink1 and so on, which together with
RESOURCE_NAME of openshift.io specified for SR-IOV Network
Operator results in Kubernetes resource names like
openshift.io/uplink0, openshift.io/uplink1 and so on.
The following is an example of SriovNetworkNodePolicy for Intel XL710 VFs:
The above example will create 4 VFs on eth0 NIC on nodes that match nodeSelector.
If the hardware is different across different nodes of the cluster (different
NICs or their PCI configurations), there should be multiple SriovNetworkNodePolicy
objects created with different nodeSelector values. This also requires creating
multiple fpp-manager deployments with different networks attached to it via
NetworkAttachmentDefinitions.
If multiple uplinks are used, FPPManager creates a bond that is comprised of these uplinks.
You also need to create SriovNetwork objects for the uplinks. For
uplinks that are used without bonding, you need to specify IP address
in the ipam section. In case of bonded interfaces, the first
interface among bonded must have an IP address. You can use
Whereabouts CNI IPAM pluginOpens in a new tab
to facilitate this task. A SriovNetwork with an assigned IP address may look like this:
In order to be able to pull FPP images from a private registry, you
may need to configure imagePullSecrets for the FPP service
account. One possibility is to create /tmp/pullsecret.yaml file,
adding proper base64-encoded docker auth information, so that later it
can be used to augment the FPP deployment:
Apply the deployment files (the order is important!):
For the DaemonSet to actually start, each node in the cluster that will be using FPP must get a label according to the number of uplinks it has, for example the following labels nodes with 2 uplinks:
fpp-manager.cennso.com/vppswitch="" is used for workloads'
nodeSelector to select the nodes where VPPSwitch is available.
In order to specify bond interface parameters, you can create a VPPConfig for VPPSwitch. There are examples of such config for LACPOpens a file and ActiveBackupOpens a file bonding modes.
List of environment variables used by FPPManager
The following environment variables are supported by FPPManager and can be customized by updating k8s deployment yaml:
FPP_VPP_PATH- path to the VPP binary. May make sense to be overridden for custom imagesFPP_VPP_PLUGIN_PATH- VPP plugin path. May make sense to be overridden for custom imagesFPP_VPP_USE_GDB- if set to a non-empty value, run VPP under GDB. This should not be used for production deploymentsFPP_VPP_GDB_SCRIPT- specify GDB script to use. NeedsFPP_VPP_USE_GDBto be set.FPP_VPP_DISPATCH_TRACE- enable dispatch trace for VPP. This feature presently only properly works with e2e/integration tests.FPP_HEAP_SIZE- specify fixed VPP heap size. Note that you also need to adjust the resources for the pod if you change this. Defaults to 6G.FPP_STAT_SEG_SIZE- specify VPP statseg size. Note that you also need to adjust the resources for the pod if you change this. Defaults to 512M.FPP_BUFFERS_PER_NUMA- specify the number of buffers per NUMA node in VPP. Defaults to 256000DEFAULT_DATA_SIZEspecifies the default VPP buffer data size in bytes. Note that VPP buffers also include a 128-byte header and a 128-byte scratchpad, so full buffer size is 256+data size (refOpens in a new tab). Defaults to 3776.FPP_PODINFO_PATHspecifies pod annotation path used by uplink config, which is provided via Downward API spec in the DaemonSet definition for VPPSwitchFPP_DUMP_CONTROLLER_EVENTSenables the verbose mode for FPP controllers that shows why exactly each reconciliation run is happening, complete with k8s object dumps / diffsFPP_STOP_ON_HANGmakes FPPManager send SIGINT to the VPP process in case if it becomes unresponsive. When used together withFPP_VPP_GDB_SCRIPT, this makes it possible to get backtrace for the spot that has caused the problemFPP_TRACE_API_CALLSenables verbose tracing of VPP API calls on the VPPLink level (not via the VPP API tracing facility)FPP_NO_HEAP_HUGEPAGESdisables hugepages for the VPP main heapFPP_NO_STATSEG_HUGEPAGESdisables hugepages for the VPP statsegFPP_NO_BUFFER_HUGEPAGESdisables hugepages for the VPP buffersFPP_COREDUMP_DIR, if specified, enables core dumping for VPP and the manager process in case of e.g. SIGSEGVFPP_VPP_MULTICOREenables multicore mode, in which VPP sets up VPP cores in a way compatible with Kubernetes CPU ManagerOpens in a new tab according to cgroup information. Otherwise, only single core for VPP main thread is allocatedFPP_VPP_MAX_CORES, when set to an integer number, limits the number of cores assigned to VPP. It includes 1 core to be used as the VPP main core, with remaining cores used as VPP worker cores that perform packet processingFPP_VPP_ALLOW_HT_SIBLINGSspecifies that cores that are HyperThreading siblings can be used for VPP. This is not recommended for any production environment as it will have negative performance impact.FPP_VPP_STATIC_CORESprovides static core list to be used by VPP. In this case, regardless ofFPP_VPP_MULTICOREorFPP_VPP_ALLOW_HT_SIBLINGS, the specified cores are assigned to VPP ignoring cgroup information. This setting is to be used in conjunction withisolcpuskernel parameter
The following environment variables are handled by the startup script (converted to command line flags). "Node" here refers to VPPSwitch daemon pod mode, while "instance" means VPP-based workload pods.
FPP_INSTANCE_NAMESPACE(-namespace) - namespace for the VPPInterfaces created (node) or the VPPInterfaces being processed (instance)FPP_INSTANCE_NAME(-instance-name) - the name of the instance for the instance modeFPP_INSTANCE_UID(-instance-uid) specifies pod UID for the instance modeFPP_NODE_NAME(-node-name) - the name of the node for the VPPSwitch modeFPP_DISABLE_UPLINK(-disable-uplink) disables FPP uplink detection mechanismFPP_VPP_EXIT_FATAL(-vpp-exit-fatal) enables manager exits when VPP is dead, defaultfalseFPP_RUN_PATH(-vpp-run-path) specifies the path for VPP directory that contains binary API / CLI sockets etc. Defaults to/var/run/vppFPP_MEMIF_SOCKET_PATH(-memif-socket-path) specifies the path for VPP memif socket. Defaults to/run/vppswitch/memif.sock
The following environment variables are handled by the startup script
FPP_CNI_BIN_DIRspecifies the directory for deploying FPP CNI plugin. It defaults to/opt/cni/bin/FPP_CNI_DEBUGenables FPP CNI plugin debugging. If this environment variable is not empty, all of the CNI commands that the plugin is handling, along with their results are stored in/tmp/cni.log
FPP_INSTANCE_NAME and FPP_NODE_NAME should be never specified
together.
Uplink-related env vars
Uplink DPDK device setup is done based on PCI device information
provided by the SR-IOV Network Device pluginOpens in a new tab.
The names of corresponding VPP interfaces are derived from MAPPING_*
environment variables.
So, for example, if we have the following environment variable set by the SR-IOV Network Device Plugin:
and we also set
this will result in uplink0 and uplink1 DPDK interfaces created in
VPP. These names will be used as the VPP interface names, and they
should also be used in the corresponding uplink VPPInterface objects
(which is done automatically when the automatic uplink setup is
enabled).
There's also a possibility to specify RX/TX queue settings in mapping environment variables. The full format of mapping environment variable values is this:
For example:
Below is the description of the values:
prefixspecifies the interface name prefix in VPP, as described for the simple syntaxnum-rx-queuesspecifies the number of RX queues for the NICs. Defaults to the number of worker cores, or to 1 in case of a non-multicore setupnum-tx-queuesspecifies the number of TX queues for the NICs. Defaults to the number of worker cores, or to 1 in case of a non-multicore setupnum-rx-descspecifies the number of descriptors in each of the RX queues. Defaults to 2048num-tx-descspecifies the number of descriptors in each of the TX queues. Defaults to 2048
FPP Helm Deployment
FPP provides Helm charts for Custom Resource Definitions (CRDs), support configuration for Prometheus and Grafana dashboard and FPP deployment.
FPP-CRD
fpp-crd helm chart installs Custom Resource Definitions like:
- FPPNetworks
- IPFixExporters
- RoutingTables
- VPPConfigs
- VPPInterfaces
- VXLANs
It does not require any configuration values. fpp-crd should be installed once per cluster.
FPP-Support
fpp-support chart includes Prometheus Service Monitor and a Grafana dashboard with overview of FPP metrics.
By default, if no values.yaml is provided, nothing will be installed. To enable ServiceMonitor and
the Grafana dashboard, the following config should be used:
FPP Manager Deployment
The main helm chart that deploys FPP is named fpp. Multiple instances of the fpp chart
can be deployed on a single cluster.
There are 2 types of deployment:
mode: nodeis the default and uses physical interfaces (direct or VFs) as uplink or external network interfaces. In this case, FPP Manager is run using KubernetesDaemonSetobjectmode: instanceis used for VPP-based application deployment. The VPP-based application instance is configured by means of FPP Custom Resources targeting that instance via its labels. In this case, FPP Manager is run using KubernetesDeploymentobject
Each FPP installation in node mode needs to target an exclusive set of nodes not intersecting
with other FPP installations in node mode, as only one FPP acting as a VPP Switch can run on a node.
FPP installation in instance mode can be deployed multiple times on the same node.
FPP deployment using 'node' mode
To run FPP in node mode for a production use-case, the following chart configuration
should be used:
- Configure the number of buffers per NUMA for optimal performance
- configure image pull secret to be able to download
fpp-managerimage from a private registry
- specify optional log level:
To enable more verbose logging, VPP API calls (on the internal intermediate VPPLink level) and Kubernetes controller events (Create/Update/Delete) can be logged:
- specify the node selector for the subset of nodes where the FPP DaemonSet should be deployed:
- configure pod resources:
- configure uplink and external network interfaces:
For more details about the values above, please refer to uplinks env vars section of this document.
To configure external network interfaces using VFs, use following chart config:
In order to configure an external network interface, VPPConfig can be used, e.g.:
To define a VPPConfig that applies to all fpp pods in node mode:
Additional interfaces
A field named assumedInterfaces in VPPConfig is introduced to allow manual
configuration of additional VPP interfaces. The idea is to use beforeCommands
to configure interfaces of a type that is not directly supported by FPP but supported by VPP,
for example, subinterfaces that correspond to VLANs, and then create uplink/extnet
VPPInterface objects corresponding to these interfaces.
If assumedInterfaces is declared, DPDK interfaces declared in startup.conf
are not used, unless explicitly mentioned. Example configuration using helm chart:
directNICMappings configures 2 DPDK interfaces in startup.conf: uplink0 and
uplink1. These interfaces are used in VPPConfig.beforeCommands to create
a bond (bond0) and subinterfaces for this bond for VLANs 1001 and 1002
(bond0.1001 and bond0.1002 respectively). FPP creates VPPInterface objects
for bond0.1001 and bond0.1002.
From these, bond0.1001 is used as the uplink interface. bond0.1002 is used as
an external interface, connected to bridge domain 1.
FPP deployment using 'instance' mode
The instance mode was introduced to enable VPP-based workloads. This makes it possible to manage workloads using FPP Custom Resources and configure VPP in a unified way. The benefit of using VPP-based applications is a possibility to employ fast vector packet processing with traffic not touching Linux kernel networking stack.
One of possible application to use the VPP as a base is Connectivity Gateway (CGW), product of Travelping that currently uses Linux kernel to create external connectivity to outside of the cluster endpoints, with GRE tunnels and BGP routing. This application is called CGW-FPP in this section.
Caution
FPP-based CGWs should only be scheduled on the nodes with FPP version 1.2.0 or later serving as VPP Switch to have VPP interfaces configured properly
Below is a diagram with the CGW-FPP example deployment described further in this section:
Full configuration of CGW values yamlOpens a file is included in the assets directory. Here is an overview of particular configuration sections:
- first we configure the instance mode and add provide the CNF name:
This creates Kubernetes Deployment object (as opposed to DaemonSet which is used in case of
mode: node) and adds cennso.net/cnf: cgw label to all resources created by the chart.
imageSecret needs to be defined to be able to download FPP Manager image from a private registry:
To enable external connectivity, an external network interface based on VF can be
used, with SriovNetwork config which provides a VF for use by CGW-VPP.
Also, the IP address of the external network can be assigned using VPPConfig, for example:
Next thing is to configure the GRE interface, which can also be created using the chart:
The above configuration will create a tunnel from the external IP of the interface named ext-net0n0
(10.75.0.10/29) to the destination IP somewhere in the external network, that is
where the other endpoint of the GRE tunnel resides (10.75.0.11/29). The VPP interface
for the local GRE tunnel endpoint will be named gre1 and will be assigned the IP address 198.19.1.1.
It is possible to specify inner and outer routing tables for VPP GRE interfaces.
These tables (inner-table and outer-table) can also be defined outside the FPP chart.
Example of inner-table RoutingTable definition:
A Network Attachment Definition can be used to provide routing between the GRE tunnel and
the internal FPP network. Here we create a memif interface connected to the internal FPP network
with id 100 (usually this means VXLAN network with VNI 100):
In this example, CGW-FPP serves as a gateway to the FPP VXLAN network, connecting it to an external network via the GRE tunnel.
Minimal resource configuration for test run of VPP-based application is:
Memory usage
It is advised to have the following resources allocated for VPPSwitch pods for most common cases:
For earlier versions (FPP 1.0), it is recommended to have the following settings:
CPU Pinning
By default, FPP relies on Kubernetes CPU ManagerOpens in a new tab
running in static mode. FPP Manager pods use Guaranteed QoS in this
case (requests being same as the limits), and resulting cpuset cgroup
configuration is used to assign cores to the VPP process viastartup.conf.
The cores assigned to the VPP processes in VPP Switch pods
can be checked using the following command:
Static CPU cores
In some cases, it may be desirable to preallocate dedicated cores to VPP
processes, excluding them from being used by any other process on node.
In this case, a subset of cores first need to be specified in the isolcpus
kernel parameter, e.g. in /etc/default/grub
After adjusting the grub settings, run grub-mkconfig -o /boot/grub/grub.cfg
and reboot the host. To check if the setting is configured on node, run:
The cores must be specified together with their HyperThreading siblings in case if HyperThreading is enabled on the system. The HT siblings can be checked using:
(hwloc package) or by looking at /sys/devices/system/cpu/cpu*/topology/thread_siblings_list
for each of the CPU cores to be used.
After configuration done on node level, the cores can be specified via vpp.staticCPUCores in
values.yaml, but note that from each HT sibling pair, just one core can be specified:
It's possible to verify whether the desired cores are actually assigned to the VPP process
by checking startup.conf inside FPP pod and also e.g. by adding PROCESSOR column in htop on node.
Max CPU cores
Another approach to VPP CPU allocation is to use vpp.maxCPUCores without isolcpus kernel parameter.
In this case, like in normal FPP deployment, Guaranteed QoS class is used for FPP pods so that Kubernetes
CPU Manager provides it with a dedicated cpuset. In this case FPP pod needs to be assigned more CPU
than used for VPP itself, for example 14:
In this case, FPP pod will have 7 physical cores assigned, but only 5 of them will be used for VPP.
Resulting startup.conf:
Cores 6 and 7 will be used by the Linux scheduler to run other processes than VPP,
most importantly, kernel threads that are created to serve TAP interfaces (vhost-<PID>).