Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Is The Cheapest VM That Can Be Used As An AKS Node?

I am testing out some Terraform code to create a Kubernetes cluster so I chose the smallest/cheapest VM

resource "azurerm_kubernetes_cluster" "k8s" {
    name                = "${var.cluster_name}"
    location            = "${azurerm_resource_group.resource_group.location}"
    resource_group_name = "${azurerm_resource_group.resource_group.name}"
    dns_prefix          = "${var.dns_prefix}"

    agent_pool_profile {
        name            = "agentpool"
        count           = "${var.agent_count}"
        vm_size         = "Standard_B1s"
        os_type         = "Linux"
        os_disk_size_gb = "${var.agent_disk_size}"
    }

    service_principal {
        client_id     = "${var.client_id}"
        client_secret = "${var.client_secret}"
    }
}

However, when I terraform apply I get this error message back from azure:

"The VM SKU chosen for this cluster Standard_B1s does not have enough CPU/memory to run as an AKS node."

How do I list the valid VM SKUs for AKS nodes and sort them by cost?

like image 571
opticyclic Avatar asked Feb 25 '19 23:02

opticyclic


2 Answers

You need to select an instance with at least 3.5 GB of memory. Read A note on node size from this blog. You can list the VM size and price on the Azure sales site.

Currently, the cheapest is Standard_B2s with 4 GB RAM. You can also sort it directly in the Azure portal. enter image description here

like image 58
Nancy Xiong Avatar answered Sep 21 '22 19:09

Nancy Xiong


You do a B1 which is cheaper than B2 if you resize the vmss, then upgrade the instance. This one is $3.80/month for Linux and $10.22/month for Windows

For whatever reason you can't do this in Terraform yet.

Step 1: Click on vmss -> settings -> size -> see all sizes (in small print) -> resize

Step 2: Click on vmss -> settings -> instance -> _0 -> upgrade (at top controller bar)

I wouldn't worry about the vm instance size too much. This is where Terraform rips you off. os_disk_size_gb. Set this lower otherwise it defaults to $20/month per instance. There seems to be no way to change the tier, they defaulted to a premium 128GB disk, and made it seem like you would only spend $30 per node.

UPDATE: I started experiencing some problems with instance at size b1ls.

like image 21
Ryan Harlich Avatar answered Sep 20 '22 19:09

Ryan Harlich