Microsoft are doing an amazing job updating Azure Kubernetes Service (AKS) with the release on 18/05/2020 Gen 2 VM’s came into public preview. Below I am going to quickly explain what gen 2 VM’s are and the benefits and then walkthrough enabling the new feature and creating a cluster using them.
Please not as the feature is in preview, do not use it for production workloads and the below steps may change when the feature goes GA (Generally Available).
What are Gen 2 VM’s and what benefits do they bring.
Generation 2 VM’s in Azure are just like the ones you find in Hyper-V back in Windows Server 2012 r2. They use the new UEFI-based boot architecture which lets you build VM’s up to 12TB in size and have OS disks exceeding 2TB. Having Gen 2 VM’s in Azure makes migration from on-premises estates a lot easier.
To read more about Gen 2 VM’s and Azure support, have a look at this.
Time to build the cluster!
Before you can create the cluster, you have a few steps to complete first.
Firstly, you are going to need to register the Gen 2 VM preview feature using the az feature register command:
1 |
az feature register --name "Gen2VMPreview" --namespace "Microsoft.ContainerService" |
It can take some time for the feature to register. To check its status, you can use the az feature show command:
1 |
az feature show --name Gen2VMPreview --namespace "Microsoft.ContainerService" --output table |
Now that the feature is registered, it’s time to re-register the AKS namespace provider. To do this you need to use the az provider register command:
1 |
az provider register --namespace 'Microsoft.ContainerService' |
Now you are ready to build the cluster
But first you need to create a resource group. You will use the az group create command for this:
1 |
az group create --name aks --location eastus |
Below is a simple one liner to build the AKS cluster with a lot of defaults. The bit of interest in the az aks create command is the –aks-custom-headers switch with the parameter usegen2vm=true:
1 |
az aks create -n aks -g aks -s Standard_D2s_v3 --aks-custom-headers usegen2vm=true |
You can see that its running as a gen 2 VM via the Azure portal. You will need to navigate to the Virtual Machine Scale Set (VMSS) for the node pool. It should be under the resource group MC_aks_aks_eastus. In here click on Operating system on the left.
You will see that the image reference stats gen2. It is also using the 1804 version of ubuntu which is also in preview.
All in all
I hope you found this helpful and are looking forward to this new feature coming to AKS. If you have any questions or comments please reach out.
0 Comments