Tanzu Kubernetes clusters that you deploy with Tanzu Kubernetes Grid CLI provide in-cluster container networking with a limited version of the Antrea container network interface (CNI). VMware Tanzu Advanced provides a more feature rich version of Antrea, VMware Container Networking with Antrea for Tanzu Advanced Edition v0.11.1.

To take advantage of the additional features of VMware Container Networking with Antrea for Tanzu Advanced Edition, you must upgrade the CNI in the Tanzu Kubernetes clusters that you deploy.

NOTE: This procedure only applies to Tanzu Kubernetes clusters that you deploy with Tanzu Kubernetes Grid CLI. You cannot modify clusters that you deploy with Tanzu Kubernetes Grid Service in vSphere with Tanzu.

Prerequisites

Obtain the Antrea Configuration from a Tanzu Kubernetes Cluster

  1. List the contexts of all of your Tanzu Kubernetes clusters.

    kubectl config get-contexts
    
  2. Set the context of kubectl to the Tanzu Kubernetes cluster on which you want to upgrade the Antrea CNI.

    Replace $CONTEXT_NAME with a context name that you obtained in the preceding step.

    kubectl config use-context $CONTEXT_NAME
    
  3. Get the name of the ConfigMap that Antrea uses.

    kubectl get daemonset antrea-agent -n kube-system -o jsonpath='{.spec.template.spec.volumes[?(@.configMap)].configMap.name}' ; echo
    

    You will see output similar to antrea-config-9c7h568bgf.

  4. Get the Configmap in yaml format.

    Replace $CONFIGMAP_NAME with the ConfigMap name that you obtained in the preceding step, for example antrea-config-9c7h568bgf.

    kubectl get configmap $CONFIGMAP_NAME -o yaml
    
  5. In the output of the get configmap command, find the data: entry, and note down any configuration that has been modified from the default values in antrea-agent.conf and antrea-controller.conf. You can ignore antrea-cni.conflist.

    For example:

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: antrea-config-9c7h568bgf
      namespace: kube-system
    data:
      antrea-agent.conf: |
        ... 
      antrea-cni.conflist: |
        ... 
      antrea-controller.conf: |
        ... 
    

    In a typical Tanzu Kubernetes cluster, usually only the serviceCIDR option under antrea-agent.conf is modified.

  6. In a text editor, open the YAML file for VMware Container Networking with Antrea for Tanzu Advanced Edition, antrea-v0.11.1.yml.

  7. Locate antrea-agent.conf and antrea-controller.conf, and modify the options according to the information that you noted in the preceding step.

Distribute the VMware Container Networking with Antrea for Tanzu Advanced Edition Image to All Nodes

  1. Extract the antrea-debian-v0.11.1.tar.gz file to get a .tar file.

    gunzip antrea-debian-v0.11.1.tar.gz
    

    The resulting file is antrea-debian-v0.11.1.tar.

  2. List the IP addresses of your Tanzu Kubernetes cluster nodes.

    kubectl get nodes -o custom-columns='ip:{.status.addresses[?(@.type=="InternalIP")].address}' --no-headers=true
    

    You should see a list of IP addresses

    12.10.10.66
    12.10.10.67
    12.10.10.68
    ...
    
  3. Copy the .tar file onto all of the nodes.

    Replace $NODE_IP with the IP address of one of the nodes. Repeat the command for all the nodes in the cluster.

    scp antrea-debian-v0.11.1.tar capv@$NODE_IP
    
  4. Import the image into all of the nodes.

    Replace $NODE_IP with the IP address of one of the nodes. Repeat the command for all the nodes in the cluster.

    ssh capv@$NODE_IP sudo ctr -n=k8s.io images import antrea-debian-v0.11.1.tar
    
  5. Upgrade Antrea in all of the nodes.

    kubectl apply -f antrea-v0.11.1.yml
    
  6. Monitor the status of the upgrade.

    kubectl rollout status deployment antrea-controller -n kube-system
    
    kubectl rollout status daemonset antrea-agent -n kube-system
    

Known Limitations

After manually upgrading to a new Antrea release, if you attempt to scale up the Tanzu Kubernetes cluster by increasing the number of nodes, there is no new Antrea image present on the new nodes. As a workaround, you can upload the Antrea image to a registry, and modify the antrea-v0.11.1.yml file to use the image from the registry.

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