When you use the Tanzu CLI to deploy a Tanzu Kubernetes cluster, an Antrea cluster network interface (CNI) is automatically enabled in the cluster. Alternatively, you can enable a Calico CNI or your own CNI provider.

Existing Tanzu Kubernetes clusters that you deployed with a version of Tanzu Kubernetes Grid earlier than 1.2.x and then upgrade to v1.3 continue to use Calico as the CNI provider. You cannot change the CNI provider for these clusters.

You can change the default CNI for a Tanzu Kubernetes cluster by specifying the CNI variable in the configuration file. The CNI variable supports the following options:

If you do not specify the CNI variable, Antrea is enabled by default.

CNI: antrea

#! ---------------------------------------------------------------------
#! Antrea CNI configuration
#! ---------------------------------------------------------------------
ANTREA_NO_SNAT: false
ANTREA_TRAFFIC_ENCAP_MODE: "encap"
ANTREA_PROXY: false
ANTREA_POLICY: true 
ANTREA_TRACEFLOW: false

Enable Calico

To enable Calico in a Tanzu Kubernetes cluster, specify the following in the configuration file:

CNI: calico

After the cluster creation process completes, you can examine the cluster as described in Retrieve Tanzu Kubernetes Cluster kubeconfig and Examine the Deployed Cluster.

Enable a Custom CNI Provider

To enable a custom CNI provider in a Tanzu Kubernetes cluster, follow the steps below:

  1. Specify CNI: none in the configuration file when you create the cluster. For example:

    CNI: none
    

    The cluster creation process will not succeed until you apply a CNI to the cluster. You can monitor the cluster creation process in the Cluster API logs on the management cluster. For instructions on how to access the Cluster API logs, see Monitor Workload Cluster Deployments in Cluster API Logs.

  2. After the cluster has been initialized, apply your CNI provider to the cluster:

    1. Get the credentials of the cluster. For example:

      tanzu cluster kubeconfig get my-cluster
      
    2. Set the context of kubectl to the cluster. For example:

      kubectl config use-context my-cluster-admin@my-cluster
      
    3. Apply the CNI provider to the cluster:

      kubectl apply -f PATH-TO-YOUR-CNI-CONFIGURATION/example.yaml
      
  3. Monitor the status of the cluster by using the tanzu cluster list command. When the cluster creation completes, the cluster status changes from creating to running. For more information about how to examine your cluster, see Connect to and Examine Tanzu Kubernetes Clusters.

check-circle-line exclamation-circle-line close-line
Scroll to top icon