Setting Up the Workshop Environment¶
This section guides you through setting up your environment for the Karpenter workshop on Azure. You'll deploy an AKS cluster and configure Node Auto Provisioning (NAP).
Prerequisites¶
Before you begin, ensure you have:
- An active Azure subscription
- Azure CLI installed on your machine
- PowerShell (for PowerShell users) or Bash terminal
1. Set Up Variables¶
Region Choice
For the purpose of Module 6 it is important you use a region where your subscription is allowed to deploy VMs across multiple availability zones. The default configuration uses the D family ARM64 nodes (eg D4pls nodes). You can verify the list for your subscription using az vm list-skus --location swedencentral --resource-type virtualMachines --output table
.
2. Create Resource Group¶
Self-Hosted Option
At this stage you might follow the documentation in the next section to install Karpenter in a self-hosted fashion. This is a more complex setup but currently is the only way for you to watch Karpenter logs. It is not necessary for the understanding of the workshop but is useful to understand Karpenter reasoning. If you choose to install Karpenter self-hosted, you can come back to this page on step 9.
Self-Hosted currently does not refresh the bootstrap token allowing new nodes to join the cluster, which means it will fail eventually - this should not affect the workshop if done in one setting, but be aware this is something you need to take care of to use this in your own environment in the current version.
3. Install and Update the AKS Preview Extension¶
This step is required for Node Auto Provisioning (NAP) as it's currently in preview.
4. Register the Node Auto Provisioning Preview Feature¶
Note
The feature registration process may take a few minutes. Continue to the next step only after the feature shows as "Registered".
5. Create AKS Cluster with Node Auto Provisioning¶
Create a new AKS cluster with Node Auto Provisioning enabled. This requires the Azure CNI Overlay network with the Cilium dataplane.
6. Connect to Your Cluster¶
7. Explore NAP Configuration¶
After your cluster is created, you can view the Node Auto Provisioning configuration:
Contrary to the self-hosted deployment, NAP comes preinstalled with two Node Pools and an AKSNodeClass by default.
The default nodepool is intended to be used by default for all workloads besides the system pods, while the system-surge nodepool is intended to allow for additional scaling of capacity specifically for system pods.
Tue default nodeclass is intended as a standard nodeclass compatible with most workloads, using Ubuntu2204.
For the purpose of the workshop, and since node pools will be explained from scratch it is best to remove the default nodepool to avoid confusion
8. Monitor NAP Events¶
You can monitor NAP events to observe deployment and scheduling decisions:
9. (Optional) Install AKS Node Viewer¶
The AKS Node Viewer is a helpful tool for visualizing dynamic node usage within a cluster, showing the scheduled pod resource requests vs. the allocatable capacity on each node. The simplest way to install it is to download the correct binary from the project's releases page. Alternatively you can install it directly if you have go on your system via go install github.com/Azure/aks-node-viewer/cmd/aks-node-viewer@latest
.
If you have downloaded the binary, you can directly make it executable and run it.
You can use the Node Viewer to visualize your cluster's node resource allocation (be aware it ignores any node not created by Karpenter for the purpose of price calculation):
The tool will provide a real-time visualization of node resources and pod allocations, which will be very useful as you test Karpenter's node provisioning capabilities throughout this workshop.
Pricing Information
Please remember the price values found in the screenshots of AKS Node Viewer throughout this workshop were a snapshot of a specific subscription, region and configuration, and are only meant for illustration purposes. You will not see the exact same values in your run of the workshop.
Next Steps¶
Now that you have a working AKS cluster with Karpenter, you're ready to deploy workloads and observe how Karpenter automatically provisions the appropriate nodes based on your workload requirements.
In the next sections, we'll explore how to configure node pools, set constraints, and deploy sample workloads to demonstrate NAP's capabilities.
AKSNodeClass API version
This workshop current uses the AKSNodeClass
API version v1alpha2
which is already deprecated in favor of v1beta1 in the self-hosted version. Please feel free to update the API version in the manifests to v1beta1 if you want to use the latest version, and it should work as expected.