Enabling the Luigi Operator via Qbert API

Starting Clusters with Luigi NetworkOperator via API

Qbert-API Calls

In PMK version 4.5, new entries have been added to the qbert-api, including the following values.

  • IPv6: This is the most significant parameter. This value 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) Selecting IPv6 also sets the calicoIPv6 and the calicoIPv6PoolCidr (more on this below).

  • deployLuigiOperator: This boolean value allows users to deploy a cluster with the Luigi NetworkOperator Installed

  • “networkplugin”: “calico”: Platform9 supports both Flannel and Calico network plugins. However, calico only supports IPv6.

  • containersCidr & servicesCidr: When specifying the IPv6 setting, the CIDR notation is required. Additionally, if the IPv6 flag is set, the value passed in containersCidr must also be set in the calicoIPv6PoolCidr setting. Calico only supports a subnet mask greater than /112. Please ensure the CIDR notation setting is specified 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. 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. Need to turn it on if pod traffic leaving the host needs to be NAT’d. (valid values are 0/1)

  • calicoIPv6PoolBlockSize: Block size to use for the IPv6 POOL created at startup. Block size for IPv6 should be in the range 116-128.

  • calicoIPv4DetectionMethod and calicoIPv6DetectionMethod options:

    • first-found — Uses the first valid IP address on the first enumerated interface. (commonly known exceptions are filtered out, e.g., the docker bridge). Use is not recommended 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.).

To deploy Luigi Operator as part of the bootstrap process via the qbert-api, the networkPlugin *_entry allowed to use is *_calico.

Python Payload Example

JSON
Copy

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.

Bash
Copy

Inside the container, update packages, install python3 and python3-pip.

Bash
Copy

Next, create a virtual environment using the following command.

Bash
Copy

Then, activate the virtual environment.

Bash
Copy

Now, add the requirements text file.

Bash
Copy

Next, install the module requirements.

Bash
Copy

Create Python Bootstrap Script

Now, create the Python deploy script and then update the following parameters DU_NAME, TENANT_NAME, TENANT_ID, USER, PASSWORD, NODE_POOL, MASTER_NODE_ID, WORKER1_NODE_ID, WORKER2_NODE_ID

Bash
Copy

Create New Custer via API

Finally, we can create and deploy the new cluster using the above script.

Bash
Copy

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

Bash
Copy
Bash
Copy

Kube-sriov-device-plugin

  • A known issue with sriov-device-plugin pod that runs on every node is that if you make a change to a hostconfig object that will match a resource definition in your sriov-config map that links to a sriov networkattachdefinition the allocatable resources will not change. In order 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 recreates by simply deleting the pod and let the daemonset to take care of it. See https://github.com/k8snetworkplumbingwg/sriov-network-device-plugin/issues/276 for more details.

SRIOV — DPDK

  • NetworkManager needs to be disabled since NetworkManager auto DHCP 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 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 be 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: https://github.com/intel/sriov-cni
  • In order for the test DPDK application to work successfully, hugepages should be enabled at the host level. Users can enable it on CentOS7 by editing /etc/default/grub file and add the following kernel boot parameters to enable iommu and create 8 GB of 2M size hugepages. See https://github.com/openshift/sriov-network-device-plugin/blob/master/docs/dpdk/README.md for more information.
Bash
Copy

Repurpose Worker Nodes for a New Cluster

To repurpose a worker node once it has been dissociated from the cluster, users should perform the following commands to fully clean the node.

Bash
Copy

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

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated