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?
Just to add to existing answer. I dont think there is an enum to list all the valid sizes of vms, but if you look at the API definition, it lists all of them pretty clearly.
And you can use azureprice.net or something similar to figure out cheapest vm for your region (usually its B series).
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.