AKS allows us to have different VM sku in the same node pool. For example, lets say you have a single node pool, we are restricted to use the same sku 'standard_ds3_v2' and subsequent VM would require us to use the same sku.
AKS allow different vm sku now.
You can easily set it up by enabling this feature in your cluster.
az extension add --name aks-preview
az extension update --name aks-preview
az feature registration create --namespace Microsoft.ContainerService --name VMsAgentPoolPreview
az feature show --namespace "Microsoft.ContainerService" --name "VMsAgentPoolPreview"
Next create your cluster with the preview VMs.
az aks create --resource-group my-aks-rg --name myakscluster --vm-set-type "VirtualMachines" --node-count 1 --node-vm-size standard_a2_v2 --generate-ssh-keys
Your cluster no longer uses VMSS scale set. Instead you can see VM directly provision in your management cluster resource group.
Add a user pool in to your cluster
az aks create --resource-group my-aks-rg --name myakscluster --vm-set-type "VirtualMachines" --node-count 1 --node-vm-size standard_a2_v2 --generate-ssh-keys
Then add a different VM sku in there
az aks nodepool manual-scale add --resource-group my-aks-rg --cluster-name myakscluster --name mixedpool --vm-sizes "standard_a2m_v2" --node-count 1
In my case, i am adding standard_a2m_v2 - otherwise you might bump into sku incompatibility issue as shown here:-
agent pool mixedpool contains incompatible VM sizes. VM sizes in each of the following groups will resolve to a different node image: (Standard_D2s_v3), (standard_a2_v2).
The sku types are given here:-
To get the sku using kubectl, run the following command
kubectl get nodes -o custom-columns=NAME:.metadata.name,INSTANCE_TYPE:.metadata.labels.node\\.kubernetes\\.io/instance-type,AGENT_POOL:.metadata.labels.kubernetes\\.azure\\.com/agentpool
If you want to update, you can use the following command
az aks nodepool manual-scale update --resource-group my-aks-rg --cluster-name myakscluster --name mixedpool --current-vm-sizes "standard_a2m_v2" --vm-sizes "standard_a4_v2" --node-count 1
Please note: You notice that i am using all A series. Updating to D series or other series would give you sku image error above.
Comments