I have created a managed Kubernetes cluster in Azure, but it's only for learning purposes and so I only want to pay for the compute whilst I'm actually using it.
Is there a easy way to gracefully shut down and start up the VMs, availablity sets and load balancers?
You can reduce the cluster footprint by scaling all the User node pools to 0, but your System pool is still required to run the system components while the cluster is running.
You can't stop system pools. Spot node pools are supported. Stopped node pools can be upgraded. The cluster and node pool must be running.
Why are two resource groups created with AKS? AKS builds upon many Azure infrastructure resources, including virtual machine scale sets, virtual networks, and managed disks. This enables you to apply many of the core capabilities of the Azure platform within the managed Kubernetes environment provided by AKS.
Azure Kubernetes Service is a robust and cost-effective container orchestration service that helps you to deploy and manage containerized applications in seconds where additional resources are assigned automatically without the headache of managing additional servers.
You could use the Azure CLI to stop the the entire cluster:
az aks stop --name myAksCluster --resource-group myResourceGroup
And start it again with
az aks start --name myAksCluster --resource-group myResourceGroup
Before this feature, it was possible to stop the virtual machines via Powershell:
az vm deallocate --ids $(az vm list -g MC_my_resourcegroup_westeurope --query "[].id" -o tsv)
Replace MC_my_resourcegroup_westeurope
with the name of your resource group that contains the VM(s).
When you want to start the VM(s) again, run:
az vm start --ids $(az vm list -g MC_my_resourcegroup_westeurope --query "[].id" -o tsv)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With