Qbert API
Bootstrapping Cluster with Luigi NetworkOperator via API
Qbert-API Calls
In PMK version 4.5, several new entries have been added to the qbert-api including:
ipv6 networkplugin: calico**,** deployLuigiOperator**,** containersCidr**,** servicesCidr**,** calicoIPv6PoolCidr**,** privileged, calicoIPv4, calicoIPv6, calicoIPv6PoolNatOutgoing and calicoIPv6PoolBlockSize*_. *_These are discussed in further detail below.
ipv6: This is the most important parameter. It triggers the cluster components to use IPv6 addressing for various Kubernetes components like CoreDNS, KubeProxy, Canal, API server etc. (valid values are 0, 1 or false/true) Setting ipv6 must also set calicoIPv6 and calicoIPv6PoolCidr (more on this below).
deployLuigiOperator: this boolean value will allow you to deploy a cluster with Luigi NetworkOperator Installed
“networkplugin”: “calico”: Platform9 supports Flannel and Calico network plugins, for the IPv6 only Calico is supported.
containersCidr & servicesCidr: Please specify the IPv6 CIDR when setting the “ipv6”: 1. Additionally, if the ipv6 flag is set, the value populated in containersCidr must also be populated in calicoIPv6PoolCidr. Calico only supports a subnet mask greater than /112. Please make sure the CIDR specified is between /112 - /123. For example, fd00:101::/64 is an invalid value, but fd00:101::/112 is acceptable.
privileged: This is a requirement for calico to run - so turning ipv6 on must turn this on automatically.
calicoIPv4 and calicoIPv6: These are complimentary. If the ipv6 flag is set to true, we need to set calicoIPv4 to none and calicoIPv6 to** autodetect and vice versa if ipv6 is set to false. (valid values are none and autodetect).
calicoIPv6PoolNatOutgoing: This is similar to the calicoNatOutgoing field that exists already. Turn it on if pod traffic leaving the host needs to be NAT’d. (valid values are 0/1)
calicoIPv6PoolBlockSize: This is the block size to use for the IPv6 POOL created at startup. Block size for IPv6 should be in the range 116-128.
calicoIPv4DetectionMethod & calicoIPv6DetectionMethod options:
first-found= Use the first valid IP address on the first enumerated interface (common known exceptions are filtered out, e.g. the docker bridge). It is not recommended using this if you have multiple external interfaces on your host.
can-reach= Use the interface determined by your host routing tables that will be used to reach the supplied destination IP or domain name.
interface= Use the first valid IP address found on interfaces named as per the first matching supplied interface name regex. Regexes are separated by commas (e.g. eth.,enp0s.).
skip-interface= Use the first valid IP address on the first enumerated interface (same logic as first-found above) that does NOT match with any of the specified interface name regexes. Regexes are separated by commas (e.g. eth.,enp0s.).
Info
To deploy Luigi Operator as part of the bootstrap process via qbert-api, the only networkPlugin entry that is allowed to be use is calico.
Python Payload Example
Python Snippet to Bootstrap Cluster
Prerequisites
The easiest way to use this script is by deploying a virtual environment in a docker container, so please follow the next steps to set up the environment.
Inside the container update packages and install python3 and python3-pip
Create a virtual environment
Activate virtual environment
Requirements file
Install module requirements.
Create python bootstrap script
Create a python deploy script and update the following parameters
** DU_NAME
TENANT_NAME
TENANT_ID
USER
PASSWORD
NODE_POOL
MASTER_NODE_ID
WORKER1_NODE_ID
WORKER2_NODE_ID
Create New Cluster via API
Tips
MacVLAN
When declaring the network attach definitions, the master section cannot use the same physical/virtual/VLAN interface of another network-attach-definition that is being used for IPvlan.
IPvlan
In order for kubelet to create pods with IPvlan interface types Kernel version 4.1+ should be installed across all the nodes of the cluster, please follow the instructions to install Kernel 4.1+ on CentOS7
Kube-sriov-device-plugin
A known issue with the sriov-device-plugin pod that runs on every node, is that if you make a change to a hostconfig object that matches a resource definition in your sriov-config map, that links to a sriov networkattachdefinition, the allocatable resources will not change. In order for the sriov-device-plugin pod to re-read the new VFs resources and update the networkattach definition allocatable resources, the sriov-device-plugin pod needs to be recreated by deleting the pod and letting the daemonset take care of it.
SRIOV - DPDK
NetworkManager needs to be disabled, since NetworkManager uses auto DHCP for all the Virtual Functions.
Due to the way VFIO Driver works, there are certain limitations to which devices can be used with VFIO. Mainly it comes down to how the IOMMU groups work. Any Virtual Function device can be used with VFIO on its own, but physical devices will require either all ports bound to VFIO, or some of them bound to VFIO, while others not being bound to anything at all. If your device is behind a PCI-to-PCI bridge, the bridge will then become part of the IOMMU group in which your device is in. Therefore, the bridge driver should also be unbound from the bridge PCI device for VFIO to work with devices behind the bridge.
IPAM not valid for DPDK enabled networks, see SRIOV-CNI section on DPDK:
In order for the test DPDK application to work successfully, you need hugepages enabled at the host level. Enable it on CentOS7 by editing the /etc/default/grub and add the following kernel boot parameters to enable IOMMU, and then create 8 GB of 2 MB size hugepages. The following info denotes this example.
Repurpose Worker Nodes for a New Cluster
To repurpose a worker node once it has been dissociated from the cluster, you should perform the following commands to fully clean the node.
References
SR-IOV - DPDK Drivers
https://doc.dpdk.org/guides/linux_gsg/linux_drivers.html
https://github.com/ceph/dpdk/blob/master/tools/dpdk-devbind.py
NetworkAttachDefinition Examples
https://github.com/intel/sriov-network-device-plugin#configurations
Last updated
Was this helpful?
