Mount the hugepages, if not already mounted by default.
Setting up OVS-DPDK with Pf9 DHCP Server on a PMK cluster
Create a PMK Cluster with the configured worker nodes in the previous section.
PMK cluster pre-requisites
PMK cluster should have the following add-ons enabled:
KubeVirt Add-on
Advanced Networking Operator (Luigi) Add-on
1. Create Network Plugins Custom Resource
Network Plugin customer resource used to install advanced networking plugins such as ovs, sriov, dpdk, etc. and their configuration.
Dpdk configuration parameters:
lcoremask : Specifies the CPU cores on which dpdk lcore threads should be spawned and expects hex string
socketMem : Comma separated list of memory to pre-allocate from hugepages on specific sockets
pmdCpuMask : The pmd-cpu-mask is a core bitmask that sets which cores are used by OVS-DPDK for datapath packet processing.
hugepageMemory : (no. of hugepages*hugepagesize) : The amount of memory for hugepages. For example, in the above yaml it indicates that 2Gi hugepage-backed RAM will be used for ovs-dpdk pod. huge page size is 1Gi it would allocate 2 hugepage.
Note: hugepageMemory needs to be greater than or equal to socket mem. if socketmem: “1024,1024“ then hugepageMemory >= 2Gi
DHCP controller plugin
DHCP controller plugin enables running PF9 DHCPserver inside pod/virtual machine to cater to the DHCP requests from virtual machine instance(not pod in case of Kubevirt). Multus network-attachment-definitions will use DHCP server to assign IPs. Pf9 DHCP server serves as an alternate to the IPAM CNIs (whereabouts, host-local), which are used as delegate from backend CNI, which gets managed/triggered at pod creation and pod deletion.
Host Network Template is used to define configuration such as ovs-config etc. on the PMK cluster.
ovsCofig parameters:
bridgeName : User Defined name of the OVS bridge
nodeInterface : Physical Network interface to be used to create ovs-bridge with.
dpdk: Boolean to enable dpdk on hosts.
3. Create Network Attachment Definition
Network Attachment Definition is a Multus CRD used to configure additional NIC on pods and virtual machines.
4. Create Pf9 DHCP server
About the fields:
Name: Name of the DHCPServer. Configurations of dnsmasq will be generated in a Configmap with the same name
networks: list of all networks that this pod will serve:
networkName: Name of NetworkAttachmentDefinition to provide IPs for. NAD should not have dhcp plugin enabled.
interfaceIp: IP address that the pod will be allocated. Must have prefix to ensure proper routes are added.
leaseDuration: Duration the leases offered should be valid for. Provide in valid formats for dnsmasq (eg: 10m, 5h, etc). Defaults to 1h
vlanId: Dnsmasq network identifier. Used as an identifier while restoring IPs. Optional.
cidr: range_start, range_end, gateway are optional. range is compulsory. If range start and end are provided, they will be used in place of the default start and end.
At this point the PMK cluster is ready to be used for workloads such as Pods and Virtual Machines.
Create a sample Virtual Machines to use the nad-ovs-dpdk-dhcp network.
Let’s validate your work by creating a Virtual Machine to consume the nad-ovs-dpdk-dhcp network.
Validate the VM
Validate the VMI
Note that the VMI is annotated with the IP from PF9 DHCP server :