Running your Azure Kubernetes Service (AKS) clusters when you are not using them is a waste of money. Depending on the size of your cluster, that can be a lot of money!
Remembering to stop the cluster when you do not need it and manually starting it back up when you need to use it can be challenging. So automating the stop and start of your cluster based on your work schedule saves a lot of money and gets rid of the hassle of remembering to stop or start your cluster.
Unfortunately, there is no easy way to automate stop and start of AKS in azure. We need to create an automation account, assign roles to that account, create a runbook and create an automation schedule for that runbook. All these steps are, although one time task, still manual and requires prior knowledge of automation in Azure. So I have automated these manual steps using terraform. You can simply specify your schedule and action (stop/start) in terraform configuration and the rest is taken care of by terraform.
In this github project, I show you how to automate stopping and starting your AKS cluster on a schedule using terraform.
Please let me know if the instructions in the github project are unclear or if you have any questions or comments in the comments section below. Have fun automating your Azure cost savings!!
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.