Deleting your AKS cluster
The final thing we are going to look at is how to delete the cluster. Moving back to the Azure CLI, all we need to run to delete the cluster is the following command:
$ az aks delete --resource-group k8sforbeginners-rg --name k8sforbeginners-aks
You will be asked if you are sure – answering yes will proceed to delete the cluster.
The process takes about 5 minutes. The preceding command only deletes the cluster itself and not the resource group. To delete the latter, run the following command:
$ az group delete --name k8sforbeginners-rg
Again, you will be asked if you want to delete the group – just answer yes.
So how much would our cluster cost to run?
Unlike the other two cloud services we looked at in the previous two chapters, there is no charge for cluster management, and all that you need to pay for is the compute resource.
So, in our case, 2 x Standard_DS2_v2 instances in US East would cost around $213 per month...