Enabling Luigi Operator through Qbert API

Bootstrapping Cluster with Luigi NetworkOperator via API

Qbert-API Calls

In PMK version 4.5 new entries have been added to the qbert-api including: ipv6, networkplugin: calico, deployLuigiOperator, containersCidr, servicesCidr, calicoIPv6PoolCidr, privileged, calicoIPv4, calicoIPv6, calicoIPv6PoolNatOutgoing and calicoIPv6PoolBlockSize.

  • 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. 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 & calicoIPv6DetectionMethod:
  1. 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 to use this if you have multiple external interfaces on your host.
  2. can-reach= Use the interface determined by your host routing tables that will be used to reach the supplied destination IP or domain name.
  3. 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.).
  4. 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.).

Notes: In order to deploy Luigi Operator as part of the bootstrap process via 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 in order to set up the environment.

Bash
Copy

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

Bash
Copy

Create a virtual environment

Bash
Copy

Activate virtual environment

Bash
Copy

Requirements file

Bash
Copy

Install module requirements.

Bash
Copy

Create python bootstrap script

Create python deployer script and update the parameters of DU_NAME, TENANT_NAME, TENANT_ID,USER, PASSWORD,NODE_POOL, MASTER_NODE_ID, WORKER1_NODE_ID, WORKER2_NODE_ID

Bash
Copy

Create new cluster via API

Bash
Copy

Tips

MacVLAN

  • When declaring the network attach definitions the master section can not 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 know issue with sriov-device-plugin pod that runs on every node is that if you make a change on a hostconfig object that will match a resource definition in your sriov-config map that links to an 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. https://github.com/k8snetworkplumbingwg/sriov-network-device-plugin/issues/276

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, you need hugepages enabled at the host level, you can enable it on CentOS7 by editing /etc/default/grub and add the following kernel boot parameters to enable iommu and create 8GB of 2M size hugepages. https://github.com/openshift/sriov-network-device-plugin/blob/master/docs/dpdk/README.md
Bash
Copy

Repurpose Worker Nodes for a New Cluster

In order to repurpose a worker node once it has been dissociated from the cluster you should perform the following commands in order 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