If you destroy the Antrea container cluster or delete the Antrea-NSX Interworking Adapter before running the deregisterjob.yaml file, some Antrea data is retained in the NSX inventory.

You can use the instructions in this documentation to clean up the Antrea data from NSX.

Starting with VMware Container Networking™ with Antrea™ version 1.7.0, the antreansxctl command-line utility provides the cluster-cleanup command to clean up leftover Antrea data in the NSX inventory. The antreansxctl utility is a Linux-only executable. So, you require a Linux machine to run this utility.

To learn about the usage of this cluster-cleanup command, see the antreansxctl Command-Line documentation in the VMware Container Networking with Antrea Installation Guide.

In VMware Container Networking™ with Antrea™ versions prior to 1.7.0, the antreansxctl command-line utility is unavailable. In that case, you can run a curl command, as explained in the following procedure. The curl command calls an NSX API to delete the leftover Antrea data from the NSX inventory.

Prerequisites

  • You must have the user name and password of the NSX Enterprise Admin user.
  • You must be able to connect to NSX Manager UI and API.

Procedure

  1. Find the path of the Antrea container cluster in the NSX Manager UI.
    1. From your browser, log in to an NSX Manager at https://nsx-manager-ip-address.
    2. Navigate to Inventory > Containers > Clusters.
    3. Expand the cluster to be deleted and copy the text that you see next to the Path field.
      For example:
      Highlights the path of a container cluster in NSX Manager UI.
  2. Run the following curl command from the command line to delete the Antrea container cluster:
    curl -k -u '{AdminUserName}:{AdminPassword}' \
     -X DELETE -H "X-Allow-Overwrite: true" \
     https://{NSX-Mgr-IP}/policy/api/v1{Path}?cascade=true
    In this command:
    • Replace {AdminUserName}, {AdminPassword}, and {NSX-Mgr-IP} with their actual values as applicable to your NSX environment.
    • Replace {Path} with the text that you copied in step 1.
    For example:
    curl -k -u 'Admin:Password123' \
     -X DELETE -H "X-Allow-Overwrite: true" \
     https://192.168.1.1/policy/api/v1/infra/sites/default/enforcement-points/default/cluster-control-planes/cluster-sales?cascade=true