Installation
This document describes setting up FPP for multi-node production deployments.
Terminology used in this document:
- VPPSwitch - Amberd pod in the
nodemode, which acts as a virtual switch on each Data Plane node - Uplink - network interface, virtual or physical, which is used by VPPSwitch to communicate inside the cluster and create a VXLAN mesh to interconnect workload CNFs between nodes
Prerequisites
Configure the following before deploying FPP:
- Uplink connectivity
- Hugepages enabled
- Multus CNIOpens in a new tab installed in the Kubernetes cluster
- Whereabouts CNI IPAM pluginOpens in a new tab to handle uplink IP address assignment, if SRIOV Virtual Functions as uplink are used in VPPSwitch
- CNI v1.1.1+ with the static pluginOpens in a new tab
- cert-manager installedOpens in a new tab
- NIC firmware updated to the latest version in the case of Intel e810 cards for direct NIC assignment in VPPSwitch
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 through kernel boot options hugepagesz=2M hugepages=2048.
As a common starting point, allocate at least 12Gi of 2MB hugepages per node.
Check the memory configuration section for more details.
Uplink configuration
VPPSwitch uses DPDK-enabled uplink interfaces. It is required for the DPDK driver to use an 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.
Two types of uplink interfaces are supported:
To assign an IP address for uplinks, you can use an IPAM plugin, such as Whereabouts, or you can specify IP manually by VPPConfig spec.uplinkConfig.ips.
Enable IOMMU
In order to enable IOMMU grouping, add the 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
IPAM for uplinks
Unless you use FPP on a single node, for example in a test environment, you must provide uplink IPs in the pod annotation in the same format as that provided by Multus CNIOpens in a new tab for VPPSwitch deployments.
For SRIOV VFs as uplinks, 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 as follows:
For direct NIC attachment, you can use spec.uplinkConfig.ips in VPPConfig to assign the IPs to the interfaces. A sample excerpt from the values.yaml file:
Uplinks using SRIOV VFs
SR-IOV Network OperatorOpens in a new tab must be installed on the cluster.
FPP requires is to have PCIDEVICE_ as environment variables with a PCI device ID, for example:
The above variable is set by SRIOV Network Device Plugin, which can be installed independently or by SRIOV Operator.
FPP was tested with the following versions of SRIOV Operator:
- 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
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 directly in the FPP deployment.
The Helm-based deployment uses directNICMappings, which configures PCI IDs through environment
variables 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, you can bind NICs to the vfio driver using an init container in the FPP node deployment. For example:
Every time the FPP node DaemonSet starts, the proper NIC binding is configured, so the method is reboot-safe.
The 8086 1593 is a vendor and device ID of the NIC. You can check it by running lspci -nn -s <PCI-ID>. Example:
After performing these steps, NICs should be ready to be used by FPP Manager. The following chart configuration enables FPP DaemonSet to use 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
Uplink interface missing in fpp-manager
If there are no uplink interfaces present in the VPPSwitch pod, access the pod and execute:
Search for output like the following:
If the above output is present in VPP logs, enable IOMMU grouping if the node is able to use it, or configure the no-IOMMU mode for the VFIO kernel module described below.
Configuration for VFIO-no-IOMMU platform
When a worker node does not support IOMMU, you can run VPPSwitch
by disabling IOMMU. Make sure that the following boot options are not set
in /proc/cmdline:
In the case of a platform that does not support IOMMU, DPDK driver can pick up NIC (PF/VF) only after you enable the unsafe no-IOMMU mode:
You must apply the above setting after each node restart.
To check if the 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
Configuring the cluster
Configure the following before the actual FPP deployment:
- Configure the SRIOV Operator if VFs are used for uplinks
- Enable image download
- Label the nodes
Configure the SRIOV operator
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:
SRIOV VF MAC conflict
When using SRIOV VF as the FPP uplink, VPP inside the container sets the MAC address generated for the DPDK interface. SRIOV driver on the NIC side sets the VF MAC address after creating the VF. Overriding it inside the container by VPP results in a warning message in dmesg:
The following kernel and driver versions are known not to work:
- kernels:
5.4.0-131-generic,5.4.0-148-generic - Intel NIC driver i40e in version
2.8.20-k
Setting different MAC addresses on a node and in VPP may sometimes result in connectivity issues.
As a workaround, set the MAC address of a node to 00:00:00:00:00:00 on the VF that would be used for the FPP uplink. Sample bash command:
Set the $NIC_LIST variable to the name of the network interface for which the VFs are created.
This action should be done by the cluster operator during the maintenance window, because setting the MAC address interrupts the network connectivity on the VF used in FPP. After you reset the MAC, FPP must be restarted.
MAC address can be set also in the Network Attachment Definition. This requires defining SRIOV NADs used for uplinks by hand, for example:
This approach enables automatic MAC reset done by SRIOV-CNI on VFs assigned by SRIOV operator to the FPP pod. It requires the FPP definition to be adjusted to use new NADs and after VPPDeployment modification, FPP pods are restarted. This approach does not affect other workloads using the VFs.
Enable image download
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:
This secret should be created in {fpp-namespace}:
Label the nodes
For the FPP DaemonSet to actually start, each node in the cluster that
will be using FPP must get a label, for example fpp-manager.cennso.com/vppswitch-uplinks=2:
fpp-manager.cennso.com/vppswitch="" is used for workloads' nodeSelector to select the nodes where VPPSwitch is available.
FPP Deployment
FPP is delivered as Helm charts that provide you all necessary Custom Resource Definitions (CRDs) that you can use to configure FPP. To deploy FPP using Helm charts, follow these steps:
- Install the
fpp-crdchart. - Install the
fpp-operatorchart. - Install the
fppchart. - Install the
fpp-supportchart if you want to have Grafana and Prometheus enabled.
Deploy fpp-crd
fpp-crd is a cluster-wide Helm chart that installs the following Custom Resource Definitions:
- FPPNetworks
- IPFixExporters
- RoutingTables
- VPPConfigs
- VPPDeployments
- VPPInterfaces
- VPPTools
- VXLANs
This Helm chart does not require any configuration values.
Deploy fpp-operator
This chart install FPP Operator - a central entity responsible for reconciling FPP CR objects and passing them to Amberd pods. Slicing mechanism is introduced to run multiple FPP Operator per cluster.
This is the sample configuration you can use to deploy and configure FPP using the fpp-operator chart:
Deploy fpp
fpp is the main Helm chart that deploys FPP Amberds - VPP wrapper pods. You can deploy multiple instances of the fpp chart on a single cluster.
There are two types of deployment:
nodemode is the default deployment that uses physical interfaces, either direct or VFs, as uplink or external network interfaces. In this case, FPP Operator creates VPPDeployment withspec.modeset tonode, which in turn results in KubernetesDaemonSetobject.instancemode is used for VPP-based application deployment. The VPP-based application instance is configured by means of FPP Custom Resources targeting that instance by its labels. In this case, FPP Operator creates VPPDeploymentspec.modeset toinstance, which results in KubernetesStatefulSetobject.
Each FPP installation in the node mode must target an exclusive set of nodes not intersecting with other FPP installations in the node mode, as only one FPP acting as a VPP Switch can run on a node. FPP installation in the 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, use the following chart configuration:
- 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
Instead of using image pull Secret, the preconfigured service account can be used:
- 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 Rx/Tx configuration, refer to the Uplinks environment variablesBroken link 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.:
vppConfigs[].spec.externalNetworkConfig.ifacePrefix must match externalNetworks key name (ext-net or anotherExtNet from above example).
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 2.0.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:
This is the full configuration of the CGW values.yaml file:
To start configuring the instance mode based on the CGW example above, first provide the CNF name:
For FPP 2.0, the configuration above creates the VPPDeployment object with mode set to instance, which in turn creates Kubernetes StatefulSet object (as opposed to DaemonSet which is used for the node mode), and adds the cennso.net/cnf: cgw label to all resources created by the chart.
imageSecret must be defined to download FPP Manager image from a private registry:
To enable external connectivity, you can use an external network interface based on VF with SriovNetwork configuration which provides a VF for use by CGW-VPP. Also, you can assign the IP address of the external network using VPPConfig, for example:
vppConfigs[].spec.externalNetworkConfig.ifacePrefix must match externalNetworks key name (ext-net).
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
called net-100, the network must be created outside of a Helm chart:
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:
Deploy fpp-support
fpp-support chart provides you with the Prometheus ServiceMonitors and Grafana dashboards that contain FPP metrics. This chart provides two dashboards and two ServiceMonitors, one for FPP node mode and second dedicated to CGW deployment in instance mode.
You install fpp-support only once per cluster.
Memory configuration
It is advised to have the following resources allocated for VPPSwitch pods for the most common cases:
The FPP 1.0 version 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>).