Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop all compute in AKS (Azure Managed Kubernetes)

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?

like image 740
Dan O'Leary Avatar asked Jan 21 '18 14:01

Dan O'Leary


People also ask

How do I stop AKS cluster?

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.

How do you stop node pool in Azure aks?

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 does AKS create a new resource group?

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.

Which service simplifies the process of configuring deploying and managing a simple containerized application on the Azure cloud?

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.


1 Answers

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) 
like image 185
officer Avatar answered Sep 23 '22 18:09

officer