Skip to main content

Azure AKS cluster

AstroPulse creates and runs an Azure Kubernetes Service cluster in a resource group of your own Azure subscription, and you pay Azure for it directly. Azure runs the control plane; you choose the node pools and AstroPulse manages them in your subscription. This page covers what is specific to AKS. The whole walkthrough is Create a cluster.

Before you start​

  • The subscription ID, a GUID:

    Terminal
    az account show --query id -o tsv
  • A resource group in that subscription. It must already exist: the setup does not create it. To make an empty one:

    Terminal
    az group create --name my-resource-group --location eastus
  • An Azure account that can assign roles on that resource group and register resource providers on the subscription, for example Owner.

  • Room in the subscription's vCPU quotas for the VM sizes you pick. For GPUs, compare models, zones and prices first under Infrastructure › Accelerators.

In the console​

Create a cluster walks through every step. What is particular to Azure:

  1. Name and cloud. Pick Microsoft Azure under Cloud, then the Region.

  2. Account. Under How Kubernetes runs, pick Azure Kubernetes Service. Under Your cloud account, enter the Subscription ID and the Resource Group, or pick a subscription listed after Connected:, which fills in both.

    Open zoom view

    The Account step with Azure Kubernetes Service, a Subscription ID and a Resource Group

    The Account step with Azure Kubernetes Service, a Subscription ID and a Resource GroupThe Account step with Azure Kubernetes Service, a Subscription ID and a Resource Group
  3. Connect. Select Connect this account, then run the setup the step shows in Azure Cloud Shell, signed in to the tenant that owns the subscription (Connect your Azure subscription).

    Open zoom view

    The Connect step showing the subscription already connected, with its resource group and region

    The Connect step showing the subscription already connected, with its resource group and regionThe Connect step showing the subscription already connected, with its resource group and region
  4. Kubernetes. Pick a Kubernetes Version, an Auto-Upgrade Channel and a Node OS Upgrade Channel. Enable Workload Identity and Enable OIDC Issuer are on. Add Tags if you want them on the cluster.

    Open zoom view

    The Kubernetes step for AKS: version, tags, auto-upgrade and node OS upgrade channels, workload identity and OIDC issuer

    The Kubernetes step for AKS: version, tags, auto-upgrade and node OS upgrade channels, workload identity and OIDC issuerThe Kubernetes step for AKS: version, tags, auto-upgrade and node OS upgrade channels, workload identity and OIDC issuer
  5. Network. Leave Use Existing VNet (BYO VNet) off for a new VNet, or turn it on to use a subnet of your own (Bring your own VNet).

    Open zoom view

    The Network step with Use Existing VNet on and the Subnet Resource ID field

    The Network step with Use Existing VNet on and the Subnet Resource ID fieldThe Network step with Use Existing VNet on and the Subnet Resource ID field
  6. Node groups. Each node pool has a Minimum nodes and Maximum nodes. The first one is the system pool, and must be On-Demand.

You should see​

The cluster's page in Infrastructure › Kubernetes reads Ready once AKS has created it and its node pools are up. Its Events tab shows each step, and says why if one fails.

Connect your Azure subscription​

AstroPulse never holds an Azure secret for your subscription. The connect setup adds the AstroPulse application to your tenant and gives it roles on the cluster's resource group only. Connect once per cluster, before you create it.

Connect this account makes a setup script for this cluster. Run it in Azure Cloud Shell, or in any terminal where az is signed in to the subscription's tenant. It stops before it changes anything if the signed-in account cannot open the subscription. It then:

  1. Registers the resource providers AKS needs on the subscription.
  2. Adds the AstroPulse application to your tenant.
  3. Assigns it these roles on the resource group: Azure Kubernetes Service Contributor Role, Azure Kubernetes Service RBAC Cluster Admin and Managed Identity Contributor.
  4. Checks that everything is in place, and says "Setup complete" with the cluster and subscription.

A setup script runs only within 24 hours of being made, and stops after 15 minutes. If you later remove AstroPulse's access in your subscription, don't run an old script again, since it would grant it again.

Installing Vulnerability Scanning on a cluster later creates a managed identity for the scanner in the resource group and grants it AcrPull on the cluster's registries; removing the add-on removes them.

Node pools​

AKS resizes each pool between its Minimum nodes and Maximum nodes as pods need room. Pools after the first can scale to 0. Pricing is On-Demand or Spot; Spot costs less, but Azure can take a node back at short notice.

The system pool​

The first node group is always the AKS system pool, whatever its name. Azure runs cluster-critical pods there, so:

  • It keeps at least 1 node: a minimum of 0 is refused. Scale a later pool to zero instead.
  • It is On-Demand. Spot is refused by the dry run, because Azure refuses it.
  • It cannot use a B-series VM.
  • For production, give it at least 2 nodes, 3 across zones. With fewer, the dry run warns.

Quota and VM sizes​

The dry run checks vCPU quota before anything is created. Quota / Capacity counts each pool's minimum nodes against its VM family and the region's total; Quota Headroom counts each pool's maximum nodes against its VM family. Both fail when the nodes need more vCPUs than the quota allows, because Azure refuses such a VM. Request an increase in the Azure portal under Subscriptions › Usage + quotas › Compute, or pick a VM size from a family with room.

Open zoom view

The Review step after a dry run that failed on Quota / Capacity and Quota Headroom, each with How to fix, and the passed checks below

The Review step after a dry run that failed on Quota / Capacity and Quota Headroom, each with How to fix, and the passed checks belowThe Review step after a dry run that failed on Quota / Capacity and Quota Headroom, each with How to fix, and the passed checks below

Some subscriptions do not allow every VM size. To list the restricted ones in a region:

Terminal
az vm list-skus --location eastus --resource-type virtualMachines \
--query "[?not_null(restrictions)].{name:name, reasonCode:restrictions[0].reasonCode}" \
-o table

For a GPU pool, choose Request GPU hardware and name the GPU model and Devices per node; AstroPulse picks the VM size. AKS installs the GPU driver, and AstroPulse the device plugin. GPU node groups need Kubernetes 1.36 or newer. See GPU node groups.

Bring your own VNet​

Without your own VNet, a new one is created for the cluster. To use yours, turn on Use Existing VNet (BYO VNet) and enter the Subnet Resource ID:

/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.Network/virtualNetworks/{vnet}/subnets/{subnet}

An Azure subnet spans every zone of its region, so one subnet is enough. It must be in the cluster's own subscription, with room for one address per node plus the five Azure reserves in every subnet. Its resource group may differ from the cluster's.

Network Plugin is Azure CNI (Recommended), Kubenet or None. Azure CNI runs in overlay mode: pods take addresses from a private overlay range, not from the subnet. Kubenet keeps pods on a separate network behind NAT.

Setup Commands under the field shows the az commands that make a VNet in the cluster's subscription, resource group and region:

Terminal
az network vnet create \
--resource-group my-resource-group \
--name my-vnet \
--location eastus \
--address-prefix 10.0.0.0/8 \
--subnet-name aks-subnet \
--subnet-prefix 10.240.0.0/16 \
--subscription 00000000-0000-0000-0000-000000000000

az network vnet subnet show \
--resource-group my-resource-group \
--vnet-name my-vnet \
--name aks-subnet \
--query id -o tsv \
--subscription 00000000-0000-0000-0000-000000000000

More on the layout: Networking.

API access and registries​

On the Network step, the configuration section below the VNet fields holds:

  • Authorized IP Ranges: the CIDR blocks that may reach the Kubernetes API server, up to 200, added one at a time. Empty means any address. A range that is not a valid CIDR block is refused as you add it.
  • Container registries (ACR): up to 20 registry resource IDs. AstroPulse grants the cluster AcrPull on each, so images pull with no secret, and the dry run checks it can. To find one: az acr show --name <registry-name> --query id --output tsv.
Open zoom view

An accepted authorized IP range, a refused one with the reason, and the container registries field

An accepted authorized IP range, a refused one with the reason, and the container registries fieldAn accepted authorized IP range, a refused one with the reason, and the container registries field

Private Cluster is not available for managed AKS clusters. For a cluster with a private API server only, register it instead.

Versions​

Kubernetes Version lists what AKS offers in the region; AstroPulse default uses the version AKS defaults to. In a manifest, <major>.<minor> picks the newest supported patch. To list them:

Terminal
astroctl cloud azure k8s-versions -r eastus

AKS keeps the cluster current on its own through two channels:

ValueLabelMeaning
StableStableUpgrades to the latest patch of the previous minor version.
PatchPatchUpgrades to the latest patch of the current minor version.
RapidRapidUpgrades to the latest patch of the newest minor version.
NodeImageNode imageUpgrades the node image only. The Kubernetes version stays the same.
NoneNoneTurns off automatic upgrades.
ValueLabelMeaning
NodeImageNode imageUpdates nodes to the latest node image. Nodes are restarted.
SecurityPatchSecurity patchApplies only security updates to the nodes.
UnmanagedUnmanagedNodes install operating system updates themselves, outside AKS.
NoneNoneTurns off automatic node operating system updates.

The Node Image auto-upgrade channel runs only with the Node Image node OS channel; the console offers only that pair.

Updates and upgrades​

Upgrades, node pool changes and rollback are on the cluster's Update and Node groups tabs, with a dry run before each change. AstroPulse plans every upgrade one minor version at a time. AKS upgrades a pool by adding surge nodes before it drains old ones, so keep vCPU quota for them; the upgrade's dry run checks it. See Cluster management.

Version discovery

Start with the versions and upgrade paths the platform currently returns for this cluster. The console upgrade wizard reads the same list.

Terminal
# Versions available to this cluster
astroctl infra k8s upgrade <cluster-name> --list-versions

# Versions and upgrade paths available in the region
astroctl cloud azure k8s-versions -r eastus
astroctl cloud azure k8s-versions --show-upgrade-paths

Kubernetes version upgrade

Preview first, review the readiness report, then run the approved upgrade.

Terminal
# Preview and validate
astroctl infra k8s upgrade <cluster-name> <next-version> --dry-run

# Generate the readiness report
astroctl infra k8s upgrade <cluster-name> <next-version> --generate-report

# Run the approved upgrade
astroctl infra k8s upgrade <cluster-name> <next-version>

Other ways in​

  • Nova: ask it, for example "create an AKS cluster in my connected subscription with a two-node system pool". It shows you the manifest and its dry run before it creates anything.
  • SDK and API: the same operations, in the API reference.

With astroctl​

Terminal
astroctl cloud azure connect --subscription-id 00000000-0000-0000-0000-000000000000 --resource-group my-resource-group --region eastus --cluster-name aks-prod
bash astro-azure-setup-aks-prod.sh
astroctl infra k8s template aks > aks-prod.yaml
astroctl infra k8s apply -f aks-prod.yaml --dry-run
astroctl infra k8s apply -f aks-prod.yaml

connect saves the setup script as astro-azure-setup-<cluster-name>.sh (--output names it) and waits while you run it. Use the same cluster name, resource group and region in the manifest. Every flag: astroctl cloud azure connect and astroctl infra k8s apply.

Settings​

The AKS fields. astroctl infra k8s template aks --schema lists every field.

Subscription IDprovisioner.aks.subscriptionIdRequired

The Azure subscription the cluster is created in.

Accepts
A UUID.
Resource Groupprovisioner.aks.resourceGroupRequired

The existing resource group the cluster is created in.

Accepts
1 to 90 letters, digits, underscores, hyphens and periods.
Kubernetes Versionprovisioner.aks.kubernetesVersion

<major>.<minor> or <major>.<minor>.<patch>.

Default
The version AKS defaults to.
Auto-Upgrade Channelprovisioner.aks.autoUpgradeChannel

How AKS upgrades the cluster. What each channel means is on Azure's cluster auto-upgrade page. When both channels are omitted, AstroPulse sets this to Stable and nodeOsUpgradeChannel to NodeImage; when only this one is omitted, AKS's own default applies.

Accepts
  • Stable Stable Upgrades to the latest patch of the previous minor version.
  • Patch Patch Upgrades to the latest patch of the current minor version.
  • Rapid Rapid Upgrades to the latest patch of the newest minor version.
  • NodeImage Node image Upgrades the node image only. The Kubernetes version stays the same.
  • None None Turns off automatic upgrades.
Node OS Upgrade Channelprovisioner.aks.nodeOsUpgradeChannel

How AKS updates the nodes' OS. What each channel means is on Azure's node OS auto-upgrade page. When both channels are omitted, AstroPulse sets this to NodeImage and autoUpgradeChannel to Stable; when only this one is omitted, AKS's own default applies. Only NodeImage with autoUpgradeChannel: NodeImage.

Accepts
  • NodeImage Node image Updates nodes to the latest node image. Nodes are restarted.
  • SecurityPatch Security patch Applies only security updates to the nodes.
  • Unmanaged Unmanaged Nodes install operating system updates themselves, outside AKS.
  • None None Turns off automatic node operating system updates.
Enable Workload Identityprovisioner.aks.enableWorkloadIdentity

Lets pods authenticate to Azure services without keys. Needs the OIDC issuer.

Default
true
Enable OIDC Issuerprovisioner.aks.enableOidcIssuer

The cluster's OIDC issuer. Stays on while Workload Identity is on.

Default
true when Workload Identity is on.
Tagsprovisioner.aks.tags

Azure tags on the cluster.

Accepts
At most 47. A name is 1 to 512 characters without < > % & \ ? /; a value at most 256.
Subnet Resource IDprovisioner.aks.vnetSubnetId

The full resource ID of your subnet, in the cluster's subscription.

Default
A new VNet.
Network Pluginprovisioner.aks.networkPlugin

Azure runs in overlay mode, set by networkPluginMode below.

Accepts
  • Azure Azure CNI Pods get addresses from Azure's container networking.
  • Kubenet Kubenet Pods get addresses from a range only the cluster uses; Azure is retiring it.
  • None None AKS installs no network plugin; you bring your own.
Default

Azure

provisioner.aks.networkPluginMode

With networkPlugin: Azure only.

Accepts
  • Overlay Overlay Pods get addresses from a private range, not from the virtual network's subnet.
Default

Overlay

Authorized IP Rangesprovisioner.aks.authorizedIPRanges

CIDR blocks allowed to reach the Kubernetes API server.

Accepts
Up to 200 CIDR blocks.
Default
None: any address.
Container registries (ACR)provisioner.aks.acrResourceIds

Registries the cluster pulls from with no secret.

Accepts
Up to 20 registry resource IDs.

If it's refused​

"Azure Subscription ID must be a valid UUID"
Cause
The Subscription ID is not a GUID. The API says "invalid Azure subscription ID".
Fix
Run az account show --query id -o tsv and paste what it prints.
"Must be a full Azure subnet resource ID: /subscriptions/{guid}/resourceGroups/{name}/providers/Microsoft.Network/virtualNetworks/{name}/subnets/{name}"
Cause
Subnet Resource ID is a name, not a resource ID. The API says "invalid vnetSubnetId: must be a full Azure subnet resource ID".
Fix
Run the az network vnet subnet show ... --query id -o tsv command above.
"vnetSubnetId subscription does not match subscriptionId"
Cause
The subnet is in another subscription.
Fix
Use a subnet in the cluster's subscription.
"node group "system": minNode 0 is not supported for the system pool on aks, which must keep at least one node. Scale a user pool to zero instead"
Cause
The first node group has a minimum of 0.
Fix
Set its Minimum nodes to 1 or more.
"AKS system node pool 'system' (first node group) cannot use Spot VMs (Azure enforces this with SystemPoolMustBeRegular)"
Cause
The dry run's System Pool Configuration check: the first node group is Spot.
Fix
Set Pricing to On-Demand for the first node group.
"enableOidcIssuer must be true when enableWorkloadIdentity is enabled"
Cause
The manifest turns the OIDC issuer off while Workload Identity is on.
Fix
Remove enableOidcIssuer: false, or turn Workload Identity off too.
"nodeOsUpgradeChannel must be NodeImage when autoUpgradeChannel=node-image"
Cause
The NodeImage auto-upgrade channel is paired with another node OS channel.
Fix
Set nodeOsUpgradeChannel: NodeImage, or pick another auto-upgrade channel.
"privateCluster is not currently supported for managed AKS clusters; use a registered cluster for private-only access"
Cause
The manifest sets privateCluster: true.
Fix
Remove it, or register a private cluster you run.

Next​