How to save costs on AKS

How To Save A Fortune On Azure Kubernetes Service

Various tactics to help you minimize your spend on AKS

Zartis
Published in
7 min readJan 28, 2021

--

We all know the story — your team gets access to a cloud provider and the first month everyone is happy and engaged. DevOps teams quickly spin up multiple Kubernetes clusters for development, test, and production environments. And it’s all beautiful… until the first invoice comes. Suddenly it’s not so colorful anymore.

What did AKS do with my money?

It’s easy to provision an Azure Kubernetes Cluster (AKS) — simply start the wizard and click “Next” until it’s finished. However, this simplified approach might cost you a lot of money. Cloud vendors are not eager to decrease your cloud spending, thus it takes some time and effort to find all the possible ways to do it.

There are multiple ways you could keep your AKS spending under control. Here, we gathered some of the most important ones:

Using spot instances

Azure cloud is often underutilized, customers do not use lots of computing power. This unused capacity led Microsoft to offer a new type of Virtual Machines — Spot Instances. They are a lot cheaper than a normal VM and can be evicted at any time. This makes spot instances ideal for development & test environments, but not so much for production. Unless you are fully aware of how spot instances work and what risks they have, you should not apply this to production environments.

AKS can use Spot Instances as an additional Node Pool, that is underneath mapped to Virtual Machine Scale Set (VMSS). Let’s take a look at how default AKS looks like in terms of Node Pools — a cluster with a single, expensive Node Pool.

zartis aks cost saving analysis — nodepools

Now, what happens if we add the cheap Spot Instance Pool? We can see that the cluster now has two Node Pools, but the one we added is a little different — it has a special taint. It makes the new Spot Pool unavailable for all workloads.

--

--

We know good code. We are a digital solutions provider specialised in building cutting-edge software with bespoke development teams. www.zartis.com