Install xNIC Daemonset on K8s Cluster

Prev Next

WHAT TO EXPECT

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 always. 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.

BEFORE STARTING

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

The following example is based on Azure AKS, Cillium CNI, and using the Azure Cloud Shell. But a similar approach can be done using a different cloud, connecting with a direct shell, and using any supported CNI.

Running the xNIC Daemonset Install Script

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_ctrl_IP> with the cloudSwXtch’s Ctrl IP address.

    kubectl run installer --image=busybox -- sh -c "wget http://<cloudSwXtch_ctrl_IP>/swx/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 depending on the connectivity of the network used:

    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. (Optional) Run the following command to view the xNIC DaemonSet logs in the Bash window:

    kubectl logs -n kube-system daemonsets/swxtch-xnic -f

    When the log shows the final message, users can exit the log visualization.

  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

    PLEASE NOTE

    The new agents will look like a standard xNIC agent in the Component list

    An actual swx-top output with two nodes/pods:

    ┌─────────────────────────────────────────────────────────────────────────────── Information - dev [ - ] ──────────────────────────────────────────────────────────────────────────────┐
    │ip-172-31-25-167  v4.1.0    (testLicense) Bandwidth          0 bps/unlimited                                                                                                          │
    │Cloud             AWS                     xNICs              2/unlimited                                                                                                              │
    │Account Id        639720666639            Bridges            0/4                                                                                                                      │
    │Region            us-east-1               License expiration 2025-Nov-30                                                                                                              │
    │swXtch Id         i-0bd964733da693cfb                                                                                                                                                 │
    │Licensing         License File                                                                                                                                                        │
    │Status            OK                                                                                                                                                                  │
    │NEW NOTIFICATIONS                                                                                                                                                                     │
    │                                                                                                                                                                                      │
    └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
    ╔═══════════════════════════════════════════════════════════════════════════════════ Components (3) ═══════════════════════════════════════════════════════════════════════════════════╗
    ║Filter                                   Class   X                                                                                                                                    ║
    ║--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------║
    ║[+] Name                                 Class     Type  Rx (bps)    Rx (pps)    Tx (bps)    Tx (pps)    Primary IP       OS               Version          Primary Swxtches          ║
    ║      ip-172-31-25-167                   swXtch    X1    0           0           0           0           172.31.25.167    Ubuntu 24.04     v4.1.0           --                        ║
    ║      ip-192-168-93-187.ec2.internal     xNIC      2     0           0           0           0           192.168.93.187   Ubuntu 24.04     v4.1.0           ip-172-31-25-167          ║
    ║      ip-192-168-100-230.ec2.internal    xNIC      2     0           0           0           0           192.168.100.230  Ubuntu 24.04     v4.1.0           ip-172-31-25-167          ║
    ║                                                                                                                                                                                      ║
    ║                                                                                                                                                                                      ║
    ║                                                                                                                                                                                      ║
    ║                                                                                                                                                                                      ║
    ║                                                                                                                                                                                      ║
    ║                                                                                                                                                                                      ║
    ║                                                                                                                                                                                      ║
    ║                                                                                                                                                                                      ║
    ║                                                                                                                                                                                      ║
    ║                                                                                                                                                                                      ║
    ║                                                                                                                                                                                      ║
    ║                                                                                                                                                                                      ║
    ║                                                                                                                                                                                      ║
    ║                                                                                                                                                                                      ║
    ║                                                                                                                                                                                      ║
    ╚══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
    ┌──────────────────────────────────────────────────────────────────────────── Interfaces  ip-172-31-25-167 ────────────────────────────────────────────────────────────────────────────┐
    │[+] Name                                 Index  Ip               SubnetPrefix         Public Ip        MTU     Driver        PciAddress                                               │
    │      dpdk-0                             0      172.31.31.37     172.31.16.0/20       --               --      igb_uio       0000:00:06.0                                             │
    │      ens5                               2      172.31.25.167    172.31.16.0/20       --               9001    ena           0000:00:05.0                                             │
    │                                                                                                                                                                                      │
    │                                                                                                                                                                                      │
    │                                                                                                                                                                                      │
    └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
     Views │           Notifications                       Components                       Streams                       Adaptors                                     │ Colors      Help