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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With