Clean Up Kubernetes Cluster

This guide will walk you through purging an existing Kubernetes cluster.

Note

If you have already cleaned up your Kubernetes cluster, you may proceed to the Verify section.

Note

By following these instructions you will lose all Rok volumes residing on these nodes. However, you can restore them from the most recent Rok snapshots later on. See the Scale In Kubernetes Cluster section for more information.

What You'll Need

Procedure

Choose one of the following options, based on your cloud provider.

  1. Delete the node groups of your cluster:

    root@rok-tools:~# aws eks list-nodegroups --cluster-name ${EKS_CLUSTER?} | \
    >   jq -r '.nodegroups[]' | \
    >   xargs -r -n1 aws eks delete-nodegroup --cluster-name ${EKS_CLUSTER?} --nod
    
  2. Delete the Kubernetes cluster:

    root@rok-tools:~# aws eks delete-cluster --name ${EKS_CLUSTER?}
    
  1. List the user node pools of your AKS cluster:

    root@rok-tools:~# az aks nodepool list --cluster-name ${AKS_CLUSTER?} \
    >    --resource-group ${AZ_RESOURCE_GROUP?} \
    >    --query "[?mode=='User'].{name:name}" \
    >    --output tsv
    The behavior of this command has been altered by the following extension: aks-preview
    workers
    
  2. Delete all node pools in the list above. To do that, repeat the following steps for each one of the node pools in the list.

    1. Pick a node pool from the list:

      root@rok-tools:~# export NODEPOOL=<NODEPOOL>
      
    2. Delete the node pool:

      root@rok-tools:~# az aks nodepool delete \
      >    --resource-group ${AZ_RESOURCE_GROUP?} \
      >    --cluster-name ${AKS_CLUSTER?} \
      >    --name ${NODEPOOL?}
      
    3. Go back to step 1, and repeat the steps for the remaining node pools.

  3. Delete the AKS cluster:

    root@rok-tools:~# az aks delete --name ${AKS_CLUSTER?} \
    >    --resource-group ${AZ_RESOURCE_GROUP?} --yes
    
This section is a work in progress.

Verify

Choose one of the following options, based on your cloud provider.

  1. Attempt to retrieve your cluster and verify it does not exist:

    root@rok-tools:~# aws eks describe-cluster --name ${EKS_CLUSTER?}
    An error occurred (ResourceNotFoundException) when calling the
    DescribeCluster operation: No cluster found for name:
    arrikto-cluster.
    
  1. Attempt to retrieve your AKS cluster and verify it does not exist:

    root@rok-tools:~# az aks show --resource-group ${AZ_RESOURCE_GROUP?} \
    >    --name ${AKS_CLUSTER?}
    The behavior of this command has been altered by the following extension: aks-preview
    (ResourceNotFound) The Resource 'Microsoft.ContainerService/managedClusters/arrikto-cluster'
    under resource group 'arrikto' was not found. For more details
    please go to https://aka.ms/ARMResourceNotFoundFix
    
This section is a work in progress.

Summary

You have successfully deleted your Kubernetes cluster.

What's Next

You can now perform a new installation of Rok.