Deleting your Azure Kubernetes Service cluster
The final thing we will 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 rg-myfirstakscluster-eus --name aks-myfirstakscluster-eus
You will be asked if you are sure, and answering yes will proceed to delete the cluster.
The process takes about five minutes. The preceding command only deletes the cluster and not the resource group. To delete the latter, run the following command:
$ az group delete --name rg-myfirstakscluster-eus
Again, you will be asked if you want to delete the group – just answer yes.
So, how much will our cluster cost to run?
Unlike the other two cloud services we examined in the previous two chapters, cluster management is free for non-production workloads, and you only pay for the compute resource.
In our case, two Standard_DS2_v2 instances in the US East region...