Hello, fellow Kubernetes enthusiasts! Today, we’re diving into an exciting new feature in Azure Kubernetes Services (AKS) – Mixed SKU Node Pools. This feature, currently in preview, allows you to deploy multiple VM SKUs from a SKU family within a single node pool, providing more flexibility and reducing the need for multiple node pools.
Prerequisites
Before we get started, make sure you have the following:
- An Azure subscription.
- AKS-preview extension (v4.0.0b4 or later).
- Minimum Kubernetes version 1.26.
Installation and Registration
First things first, let’s get the AKS-preview extension installed or updated. Open your Azure Cloud ell and run:
1 2 |
az extension add --name aks-preview az extension update --name aks-preview |
Next, set your subscription and register the VMsAgentPoolPreview
feature flag. This will enable the mixed SKU node pools feature for your subscription:
1 |
az feature registration create --namespace Microsoft.ContainerService --name VMsAgentPoolPreview |
After a few minutes, verify that the feature is registered:
1 |
az feature show --namespace "Microsoft.ContainerService" --name "VMsAgentPoolPreview" |
Finally, refre the registration of the Microsoft.ContainerService resource provider:
1 |
az provider register --namespace "Microsoft.ContainerService" |
Limitations
Before you jump in, note these limitations:
- Cluster autoscaler isn’t available.
- InfiniBand and Windows node pools aren’t supported.
- Management is only via CLI or REST APIs.
- VM sizes must be from the same family.
Create a Mixed SKU Node Pool
Now, let’s create a new AKS cluster with a mixed SKU node pool. Here’s how you do it:
1 2 3 4 5 |
az aks create \ --resource-group rg-aks-mixed-pools \ --name aks-mixed-pools \ --vm-set-type "VirtualMachines" \ --node-count 2 |
This command sets up a new AKS cluster named aks-mixed-pools with two nodes in the rg-aks-mixed-pools resource group. If you look at the managed resource group you will see Virtual machines rather than a Virtual Machine Scale Set (VMSS).
Add a Mixed SKU Node Pool to an Existing Cluster
To add a mixed SKU node pool to an existing cluster, run:
1 2 3 4 5 6 7 |
az aks nodepool add \ --resource-group rg-aks-mixed-pools \ --cluster-name aks-mixed-pools \ --name mixedpool \ --vm-set-type "VirtualMachines" \ --vm-sizes "Standard_D4s_v3" \ --node-count 3 |
This adds a new node pool named mixedpool to your aks-mixed-pools cluster with three nodes of Standard_D4s_v3
VM SKU. One cool thing to note is --vm-size
can have more than one vm size, it accepts comma seperated lists like: "Standard_D4s_v3,Standard_D8s_v3"
Manage Scale Profiles
You can also manage scale profiles for your mixed SKU node pools. Here’s how to add, update, and delete scale profiles:
Add a Manual Scale Profile
To add a manual scale profile to a node pool, use the following command. This example adds a profile to mixedpool
with two nodes of Standard_D2s_v3
:
1 2 3 4 5 6 |
az aks nodepool manual-scale add \ --resource-group rg-aks-mixed-pools \ --cluster-name aks-mixed-pools \ --name mixedpool \ --vm-sizes "Standard_D2s_v3" \ --node-count 2 |
After running this command you will notice that the mixedpool node pool now has 5 nodes in it, 3 “Standard_D4s_v3” and 2 “Standard_D2s_v3”. You can check with the following command:
1 |
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 |
Update an Existing Manual Scale Profile
To update an existing manual scale profile, use this command. This example updates mixedpool
to change from Standard_D4s_v3
to Standard_D8s_v3
and sets the node count to five:
1 2 3 4 5 6 7 |
az aks nodepool manual-scale update \ --resource-group rg-aks-mixed-pools \ --cluster-name aks-mixed-pools \ --name mixedpool \ --current-vm-sizes "Standard_D4s_v3" \ --vm-sizes "Standard_D8s_v3" \ --node-count 5 |
Delete a Manual Scale Profile
To delete a manual scale profile, use this command. This example deletes the profile using Standard_D8s_v3
in mixedpool
:
1 2 3 4 5 |
az aks nodepool manual-scale delete \ --resource-group rg-aks-mixed-pools \ --cluster-name aks-mixed-pools \ --name mixedpool \ --current-vm-sizes "Standard_D8s_v3" |
Conclusion
Mixed SKU node pools are a powerful addition to AKS, enabling greater flexibility and efficiency in managing diverse workloads. While currently in preview, this feature promises to streamline your AKS deployments significantly.
0 Comments