Skip to main content
Skip table of contents

Delete the EKS Cluster from CLI

These pages refer to DKP Enterprise and DKP Gov Advanced products.

Ensure that the KUBECONFIG environment variable is set to the self-managed cluster by running export KUBECONFIG={SELF_MANAGED_AWS_CLUSTER}.conf

Delete the EKS Cluster

If you prefer to continue working in the terminal or shell using the CLI, the steps for deleting the cluster are listed below. If you are in the DKP UI, you can also delete the cluster from the UI using the steps on this page: Delete EKS Cluster from the DKP UI

Follow these steps for deletion from the CLI:

  1. Ensure your AWS credentials are up to date. If you are using user profiles, then refresh the credentials using the command below. Otherwise, proceed to step 2.

    CODE
    dkp update bootstrap credentials aws 
  2. Delete the Kubernetes cluster and wait a few minutes:

    Before deleting the cluster, dkp deletes all Services of type LoadBalancer on the cluster. Each Service is backed by an AWS Classic ELB. Deleting the Service deletes the ELB that backs it. To skip this step, use the flag --delete-kubernetes-resources=false.

    NOTE: Do not skip this step if the VPC is managed by DKP. When DKP deletes the cluster, it deletes the VPC. If the VPC has any EKS Classic ELBs, EKS does not allow the VPC to be deleted, and DKP cannot delete the cluster.

    CODE
    dkp delete cluster --cluster-name=${CLUSTER_NAME} 

    Output will be similar to:

    CODE
     ✓ Deleting Services with type LoadBalancer for Cluster default/eks-example
     ✓ Deleting ClusterResourceSets for Cluster default/eks-example
     ✓ Deleting cluster resources
     ✓ Waiting for cluster to be fully deleted
    Deleted default/eks-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.

Next Step

Day 2 - Cluster Operations Management

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.