Working with Kubernetes clusters and xNIC DS

Prev Next

WHAT TO EXPECT

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

Restarting xNIC DaemonSet

To restart the xNIC DaemonSet for K8s, run the following command:

 kubectl rollout restart ds/swxtch-xnic -n kube-system

Getting a shell to an xNIC DaemonSet pod

At times, it is useful to be able to get into the pod and run commands such as swxtch-tcpdump. To accomplish this, follow these steps: 

  1. Sign in to your desired cloud

  2. Open cloudShell as Bash. In this example, the user is using Azure.

  3. Enter the following command to get the pod name:

    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
  4. Enter the following command, replacing swxtch-xnic-name with the pod name:

    kubectl exec -it pod/swxtch-xnic-name -n kube-system -- bash

    Example:

    $ kubectl exec -it pod/swxtch-xnic-kn9hg -n kube-system -- bash
    root@aks-nodepool1-23164585-vmss00000A:/

You can now enter commands similar to any VM, such as ip a or sudo swxcth-tcpdump -i eth0. Note that the pods created in this example do not have tools such as the standard tcpdump. However, swxtch-tcpdump will work. For testing, see swxtch-perf under Testing cloudSwXtch

Switching Contexts

If you have more than one AKS Kubernetes cluster, then you may need to change the context to work on the desired instance. For more information, please review the Changing K8s Context in Your Preferred Cloud section.

Accessing xNIC Logs

Users can get xNIC logs once signed in to the pod. See How to View xNIC Logs page.

Using xNIC config

Getting to the xNIC config is available once the user has signed into the Pod. To get to the xNIC config, use the command below:

 cat /var/opt/swxtch/swxtch-xnic.conf

Exiting the Pod

To exit the pod, enter the following command:

exit