Install xNIC Daemonset on K8s Cluster

Prev Next

WHAT TO EXPECT

For Kubernetes, the xNIC is a lightweight Daemonset that must be installed on every node with pods sending or receiving multicastntraffic. This creates a virtual network interface within the node in a Kubernetes Cluster. Applications that use IP multicast should target this virtual network interface.

In this article, users will learn how to install xNIC Daemonset for Kubernetes on any of the supported clouds (AKS, EKS, OCI, or GKE).

Overview

Unicast traffic will not be affected by this feature since it will work as it did before. The xNIC will only be used for Multicast traffic. The default interface xNIC will use is eth0. It can be installed via the cloud’s Cloud Shell or using a VM that will act as a manager to control the cluster. Either way, it is required to have connectivity to the cloudSwXtch and the Kubernetes cluster.

In this document, we will discuss how to do it via CloudShell. However, the commands below will work in either CloudShell or on the VM managing the K8s cluster.

Running the xNIC Daemonset Install Script

BEFORE STARTING

If the cluster is not created already, please create it. This is a prerequisite before installing the xNIC. 

To make installation easy, the Daemonset is installed from the cloudSwXtch instance via shell commands. The xNIC is matched to the attached cloudSwXtch and should be upgraded if the cloudSwXtch version changes.

This process takes less than a minute to install on an existing K8s cluster. 

To run the install:

  1. Sign in to the desired cloud provider

  2. Open cloudShell as Bash.

  3. Paste in the following commands, replacing the <cloudSwXtch_IP> with the cloudSwXtch’s Ctrl IP address.

    kubectl run installer --image=busybox -- sh -c "wget http://<cloudSwXtch_IP>/services/install/xnic_ds_installer.sh; sleep 3650"
    kubectl cp default/installer:/xnic_ds_installer.sh xnic_ds_installer.sh
    kubectl delete po/installer --grace-period 1
    chmod +x xnic_ds_installer.sh
  4. Run one of the following scripts:

    cloudSwXtch with Internet Access:

    ./xnic_ds_installer.sh

    cloudSwXtch without Internet Access (Air-Gapped):

    ./xnic_ds_installer.sh -ag

    An example of a successful install without INTERNET access is shown below:

    $ ./xnic_ds_installer.sh -ag
    
    [i] Detected Cloud: AZURE
    [i] Cilium Installation detected
    [i] Setting CNI to CILIUM...
    
    ########################################################################################################
            This script modifies the underlying configuration of Cilium CNI to make it compatible
            with Multicast Networks.
            It also installs xNIC DaemonSet on the existing cluster. 
    ########################################################################################################
    
    
    - RUNNING INSTALLER: Airgap
    
    - IMAGE: 10.144.0.115:443/xnicv2:airgap
    
    - CNI PLUGIN: CILIUM
    
    - SWXTCH IP ADDRESS: 10.144.0.115
    
    - AGENT TYPE: XNIC XCD
    
    =======================================================
          Adjusting BPF filter priority on Cilium 
    =======================================================
    Setting flag "bpf-filter-priority" to "50000" 
    configmap/cilium-config patched
    Done!
    
    =======================================================
                 Restarting Cilium Agents
    =======================================================
    daemonset.apps/cilium restarted
    daemonset.apps/cilium-node-init restarted
    Waiting for Cilium Agents to be fully UP and Running......OK
    Done!
    Proceeding with xNIC Installation
    
    =======================================================
                 Creating xNIC ConfigMap
    =======================================================
    configmap/xnic-config created
    
    =======================================================
                    Installing xNIC
    =======================================================
    daemonset.apps/swxtch-xnic created
    Done!
    
    ==================== Completed! =======================
    
    Please allow a minute for the xNIC DaemonSet to fully spin up before starting to use it.
    Feel free to follow up on the xNIC Agents installation by running 
    
    	kubectl logs -n kube-system daemonsets/swxtch-xnic -f
  5. Run the following command to view the xNIC DaemonSet logs in the Bash window:

    kubectl logs -n kube-system daemonsets/swxtch-xnic -f
  6. Use the command below to follow the xNIC DaemonSet status in the Bash window and check if they have started (i.e, “Running”):

    kubectl get pods -l app=swxtch-xnic -n kube-system

    Example:

    $ kubectl get pods -l app=swxtch-xnic -n kube-system
    NAME                READY   STATUS    RESTARTS   AGE
    swxtch-xnic-fc58t   1/1     Running   0          11d
    swxtch-xnic-kn9hg   1/1     Running   0          11d
  7. Sign in to the cloudSwXtch and enter the following command to see the new instances in swx-top.

    swx-top