As a vSphere administrator, you can remove the Tanzu Mission Control cluster agent from a Tanzu Kubernetes Grid Service supervisor cluster running in vSphere with Tanzu.

When you register a Tanzu Kubernetes Grid Service Supervisor Cluster running in vSphere with Tanzu, Tanzu Mission Control installs a cluster agent to facilitate management of the cluster from Tanzu Mission Control. If you subsequently deregister the cluster without removing the cluster agent, you need to remove the agent manually.

Prerequisites

This procedure assumes that you have a Tanzu Kubernetes Grid Service Supervisor Cluster running in vSphere with Tanzu that has been registered with Tanzu Mission Control.

To remove the cluster agent from a Supervisor Cluster, you must have administrator access to the Supervisor Cluster.

Procedure

  1. In a command window, log in to the Supervisor Cluster with administrative credentials, as described in Connect to the Supervisor Cluster as a vCenter Single Sign-On User in the vSphere with Tanzu Configuration and Management documentation.
  2. Make sure your current context is set appropriately for the Supervisor Cluster from which you want to remove the cluster agent.
    You might need to run a kubectl config use-context command to explicitly set the context, for example:
    kubectl config use-context CONTEXT-NAME
  3. Locate the Tanzu Mission Control namespace on the Supervisor Cluster.
    The following kubectl command returns namespaces on the cluster.
    kubectl get ns
    The Tanzu Mission Control namespace begins with svc-tmc-, for example:
    svc-tmc-c8                                  Active   14m
  4. Delete the existing AgentInstall resource.
    Run the following command, replacing TMC-NAMESPACE with the name of your Tanzu Mission Control namespace.
    kubectl delete -n TMC-NAMESPACE agentinstall tmc-agent-installer-config
    The output from this command looks something like this:
    agentinstaller.installers.tmc.cloud.vmware.com "tmc-agent-installer-config" deleted
  5. Create a YAML file to contain the AgentInstall resource information, for example deregistration.yaml.
    1. Enter the following YAML code in the file, replacing TMC-NAMESPACE with the name of your Tanzu Mission Control namespace.
      apiVersion: installers.tmc.cloud.vmware.com/v1alpha1
      kind: AgentInstall
      metadata:
        name: tmc-agent-installer-config
        namespace: TMC-NAMESPACE
      spec:
        operation: UNINSTALL
      
    2. Save and close the file.
  6. In your command window, run a kubectl apply command to apply the deregistration YAML to your Supervisor Cluster.
    For example:
    kubectl apply -f deregistration.yaml
    When you run this command, the uninstall process begins. The resulting output looks something like this:
    agentinstall.installers.tmc.cloud.vmware.com/tmc-agent-installer-config created

Results

After you the issue the command to uninstall the agent, the Supervisor Cluster starts removing the agent. This process can take a few minutes. When the process completes, the Tanzu Mission Control cluster agent is uninstalled from the Supervisor Cluster.