CDM Removal: AKS

When you’re done working with the CDM, you can remove it from Azure by following this procedure:

Remove the CDM
  1. Run the skaffold delete command to shut down your deployment and remove it from your namespace.

  2. Log in to Pulumi using the local option or the Pulumi service. Be sure to log in the same way that you logged in when you created your cluster in Step 3 of Create a Kubernetes Cluster for the CDM.

  3. Remove your cluster:

    1. Change to the directory that contains the cluster configuration files:

      $ cd /path/to/forgeops/cluster/pulumi/azure/aks
    2. Select the Pulumi stack that you used when you created your cluster:

      $ pulumi stack select aks-medium
    3. Delete your cluster:

      $ pulumi destroy

      Pulumi provides a preview of the operation and issues the following prompt:

      Do you want to perform this destroy?

      Review the operation, and then select yes if you want to proceed.

    4. To verify that Pulumi removed the cluster, log in to the Azure console and select Kubernetes services.

      You should not see the CDM cluster in the list of Kubernetes clusters.

  4. Remove infrastructure components:

    1. Change to the directory that contains the Azure infrastructure stack configuration files:

      $ cd /path/to/forgeops/cluster/pulumi/azure/infra
    2. Select the azure-infra Pulumi stack:

      $ pulumi stack select azure-infra
    3. Delete the infrastructure components:

      $ pulumi destroy

      Pulumi provides a preview of the operation and issues the following prompt:

      Do you want to perform this destroy?

      Review the operation, and then select yes if you want to proceed.

    4. To verify that Pulumi removed the infrastructure components, log in to the Azure console. Display the resource groups.

      The resource group named azure-infra-ip-resource-group should not be present.

  5. Remove the CDM cluster from your local computer’s Kubernetes settings:

    1. Unset the KUBECONFIG environment variable:

      $ unset KUBECONFIG
    2. Run the kubectx command.

      The Kubernetes context for the CDM cluster should not appear in the kubectx command output.