Delete AKS Cluster
![](../../__attachments/89360826/Enterprise_50%25.png?inst-v=fbc98f0a-f9ae-4d4c-828f-dc0defe966ca)
Ensure that the KUBECONFIG
environment variable is set to the self-managed cluster by running export KUBECONFIG={SELF_MANAGED_AZURE_CLUSTER}.conf
Delete the AKS cluster and clean up your environment
Delete the workload cluster
Delete the Kubernetes cluster and wait a few minutes:
Before deleting the cluster, DKP deletes all Services of type LoadBalancer on the cluster. Deleting the Service deletes the Azure LoadBalancer that backs it. To skip this step, use the flag
--delete-kubernetes-resources=false
.
NOTE: Do not skip this step if the Azure Network is managed by DKP. When DKP deletes cluster, it deletes the Network.
dkp delete cluster --cluster-name=${CLUSTER_NAME}
✓ Deleting Services with type LoadBalancer for Cluster default/aks-example
✓ Deleting ClusterResourceSets for Cluster default/aks-example
✓ Deleting cluster resources
✓ Waiting for cluster to be fully deleted
Deleted default/aks-example cluster
Known Limitations
NOTE: Be aware of these limitations in the current release of DKP.
The DKP version used to create the workload cluster must match the DKP version used to delete the workload cluster.