---
title: "CDM removal: AKS"
description: To remove the CDM from AKS when you're done working with it:
component: forgeops
version: 7.2
page_id: forgeops::cdm/aks/remove
canonical_url: https://docs.pingidentity.com/forgeops/7.2/cdm/aks/remove.html
---

# CDM removal: AKS

To remove the CDM from AKS when you're done working with it:

1. Set the active namespace in your local Kubernetes context to the namespace in which you have deployed the CDM.

2. Run the forgeops delete --force command to shut down your deployment, remove it from your cluster, and delete CDM PVCs and secrets. For example:

   ```
   $ cd /path/to/forgeops/bin
   $ ./forgeops delete --force
   "small" platform detected in namespace: "my-namespace"
   Uninstalling component(s): ['all'] from namespace: "my-namespace"
   OK to delete these components? [Y/N]
   ```

   1. Enter **Y** to proceed with CDM deletion.

      ```
      Using --force delete: This will erase all your PVCs and Secrets. This cannot be undone.
      OK to proceed? [Y/N]
      ```

   2. Enter **Y** to confirm that you want to delete PVCs and secrets.

      ```
      service "admin-ui" deleted
      service "end-user-ui" deleted
      . . .
      ```

3. Remove your cluster:

   1. Change to the directory that contains the cluster removal script:

      ```
      $ cd /path/to/forgeops/cluster/aks
      ```

   2. Source the script that contains the configuration for your cluster size. For example:

      ```
      $ source ./small.sh
      ```

   3. Run the cluster removal script:

      ```
      $ ./cluster-down.sh
      The "small" cluster will be deleted. This action cannot be undone.
      Press any key to continue, or CTRL+C to quit
      ```

      1. Press Enter to proceed with cluster and data removal:

         ```
         Getting the cluster credentials for small in Zone my-region-a
         Fetching cluster endpoint and auth data.
         kubeconfig entry generated for small.
         Do you want to delete all PVCs allocated by this
         cluster (recommended for dev clusters)? [Y/N]
         ```

      2. Enter Y to confirm that you want to remove all the data created by this cluster, or enter N if you don't want to delete the data.

         ```
         Draining all nodes
         node/aks-primsmall-18811554-vmss000000 cordoned
         node/aks-primsmall-18811554-vmss000001 cordoned
         node/aks-primsmall-18811554-vmss000002 cordoned
         . . .

         Deleting AKS cluster small…​
         Deleting resource group small-res-group…​
         ```

4. Run the kubectx command.

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