Azure node pool scaling using Azure Automation

9/3/2019

I'm trying to accomplish the goal of managing cost of different azure resource groups, the project consists of several VMs and kubernetes clusters. To accomplish this goal I want to use the Azure Automation service, using this it's easy to shutdown and start VMs on a schedule.

So the problem is that I have not found a way to schedule squeezing each node pool of the K8s cluster down.

If any one can help doing this it would be great :)

-- Shadesfear
azure
azure-resource-group
kubernetes

2 Answers

9/3/2019

To shut down and start VMs of AKS cluster nodes pools on a schedule, you can schedule the resource group which the nodes in, not node pool. As I think, the node pool is just used to manage the VMs convenient. You can take a look at Start/Stop VMs during off-hours solution in Azure Automation. This way can manage the VMs inside a resource group.

-- Charles Xu
Source: StackOverflow

9/4/2019

To start and stop VM's it's done according to Charles Xu answer. To scale the Kubernetes cluster I needed to install the AKS module the in the azure portal and create my own runbook in the portal aswell. Invoking the AKS function as such

Set-AzAks -ResourceGroupName <RG_name> -Name <K8s_names> -NodeCount <node_count>
-- Shadesfear
Source: StackOverflow