Delete an EKS Cluster

Here is how to delete the EKS Cluster you’ve provisioned:

  1. Go to your Cloud9 IDE
  2. In the command line, check out all the namespaces that are attached to your EKS cluster:

    kubectl get svc --all-namespaces
  3. Delete any services that has an associated EXTERNAL-IP value

    # These services are fronted by an ELB which must be deleted for associated resources to be released properly
    kubectl delete svc <service-name>
  4. Delete the EKS cluster with the code snippet below:

    # If you named your EKS cluster something other than basic-eks, replace the basic-eks below with the name used
    eksctl delete cluster --name basic-eks
  5. This process may take up to 30 minutes for everything to be fully deleted.

Delete Cloud9 Instance

Now that we’ve deleted the EKS cluster, we can now safely delete our Cloud9 EC2 instance:

  1. Go to your EC2 dashbord
  2. Select the EC2 instance with the name “harness-workshop”
  3. Go to the actions drop down menu and select delete instance