> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Node provisioning

> How e6data adds and removes AKS nodes for query clusters, the node labels and taints it needs, and how to choose between AKS Node Auto-Provisioning and e6data's Karpenter.

ReferenceApplies to: CloudPrem on Azure

e6data adds machines when a query cluster resumes and removes them when it suspends. Any node provisioner that meets the requirements below works. The supported ones are AKS Node Auto-Provisioning (NAP) and e6data's Karpenter. AKS node pools with the cluster autoscaler are coming later.

## Requirements

What e6data needs from its nodes:

| Nodes | Labels | Taint |
| - | - | - |
| Engine (planner, queue, executors) | `workspace-name=<ws>` | `workspace-name=<ws>:NoSchedule` |
| Workspace platform (console, query router, metadata services) | `e6data-node-type=platform`, `workspace-name=<ws>` | `e6data-node-type=platform:NoSchedule` |

* arm64 VM sizes, or an x86 release from e6data.
* On-demand capacity for engine nodes: current releases require it.
* Scale from zero: nodes are added when a query cluster resumes and removed after it suspends.
* VM sizes that fit the release's pod sizes ([Sizing and cost](https://docs.e6data.com/platform/deploy/azure-cloudprem/sizing-and-cost.md)).

## Which to choose

| Option | Status | Choose it when | You lose |
| - | - | - | - |
| e6data's Karpenter | Standard | You want faster cluster resume and local NVMe striping | Can't run under node resource group lockdown or on AKS Automatic |
| AKS Node Auto-Provisioning (NAP) | Supported | You want Microsoft-managed scaling, a locked node resource group, or fewer e6data identities | Faster cluster resume; local NVMe striping (`instanceStorePolicy`) |
| AKS node pools with the cluster autoscaler | Coming later: needs an operator release that is not yet available | Your standard is fixed-size node pools | Right-sized machines; you size pools yourself |
| AKS Automatic (always NAP) | Coming later: needs an operator release that is not yet available | Your platform standard is AKS Automatic | Faster cluster resume, warm pools, local NVMe, `az aks stop` |

The Karpenter option in the install steps ([Configure registry, Kubernetes, and networking](https://docs.e6data.com/platform/deploy/azure-cloudprem/configure-registry-kubernetes-networking.md#part-4-engine-node-pool)) installs the upstream AKS Karpenter provider, not e6data's build. e6data's build comes with e6data's managed install, and these docs have no steps to install it yourself: ask e6data if you need faster cluster resume. The install steps have a tab for each option, so the later steps need no edits.

Warm pools work on NAP on a standard AKS cluster: a warm-pool resume took 17 seconds, with no new VM. Warm pools only create Kubernetes objects (a Karpenter NodePool and placeholder pods), and NAP creates the VMs. On NAP, warm pools need the workspace AKSNodeClass you applied in the NAP steps.

## System and workload node pools

Keep system pods and e6data engines on separate nodes.

| Pool | Azure | What runs there |
| - | - | - |
| System | 2 to 4 × `Standard_D2ps_v5` or `Standard_D2ps_v6` (at least 4 vCPU, 16 GiB in total), taint `CriticalAddonsOnly=true:NoSchedule` | Cloud add-ons, Karpenter, CoreDNS, and the e6data operator, cert-manager, KEDA and VPA (they tolerate the system taint). e6data's install creates no operator NodePool |
| Workspace platform | `<ws>-platform-nodepool` or node pool `e6platform` (label and taint `e6data-node-type=platform`) | Console, query router, metadata services |
| Engine | `<ws>-nodepool` (taint `workspace-name=<ws>:NoSchedule`), or one node pool per engine VM size | Planner, queue, executors |

NodePools are per workspace (engine and platform), plus one per warm pool. System and operator overhead, per cluster: about 4 vCPU. Engine and per-workspace machine sizes are in [Sizing and cost](https://docs.e6data.com/platform/deploy/azure-cloudprem/sizing-and-cost.md).

## Steps: Azure with NAP

1. Turn off the cluster autoscaler on every node pool, including the system pool. Keep the system pool at a fixed size.

   ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
   az aks nodepool update -g <RESOURCE_GROUP> --cluster-name <CLUSTER_NAME> -n <SYSTEM_POOL> \
     --disable-cluster-autoscaler
   ```
2. Turn on NAP without default pools (Azure CLI 2.76 or later):

   ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
   az aks update -g <RESOURCE_GROUP> -n <CLUSTER_NAME> \
     --node-provisioning-mode Auto --node-provisioning-default-pools None
   ```
3. Apply the AKSNodeClass and NodePool manifests e6data gives you. Use `apiVersion: karpenter.azure.com/v1beta1` for AKSNodeClass and leave out `instanceStorePolicy`.

   ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
   kubectl apply -f <WORKSPACE_NAME>-nodeclasses-and-nodepools.yaml
   kubectl get aksnodeclass,nodepool.karpenter.sh     # all READY True
   ```
4. Skip the Karpenter identity, roles, bootstrap token and Karpenter install. Keep `karpenter.enabled: true` in the operator values and `karpenterNodePool: <WORKSPACE_NAME>-nodepool` in the workspace. The **Node Auto Provisioning** tabs in the install steps do all of this.
5. Optional: lock the node resource group so only AKS can change VMs there:

   ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
   az aks update -g <RESOURCE_GROUP> -n <CLUSTER> --nrg-lockdown-restriction-level ReadOnly
   ```

> [!WARNING]
>
> With NAP on, you can't stop the cluster (`az aks stop`) and can't change its outbound type later. These are Microsoft limits.

## Steps: Azure node pools with the cluster autoscaler

> [!NOTE]
>
> This option needs an operator release that is not yet available. Use these steps only when e6data tells you your operator release supports it.

1. Create every pool with `--node-count 0`. Without it, Azure starts the pool with 3 VMs even when `--min-count` is 0.

   ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
   az aks nodepool add -g <RESOURCE_GROUP> --cluster-name <CLUSTER_NAME> -n e6platform --mode User \
     --node-vm-size <PLATFORM_VM_SIZE> --node-count 0 --enable-cluster-autoscaler --min-count 0 --max-count 3 \
     --labels workspace-name=<WORKSPACE_NAME> e6data-node-type=platform \
     --node-taints e6data-node-type=platform:NoSchedule
   az aks nodepool add -g <RESOURCE_GROUP> --cluster-name <CLUSTER_NAME> -n e6usage --mode User \
     --node-vm-size <SMALL_VM_SIZE> --node-count 0 --enable-cluster-autoscaler --min-count 0 --max-count 2 \
     --labels workspace-name=<WORKSPACE_NAME> --node-taints workspace-name=<WORKSPACE_NAME>:NoSchedule
   az aks nodepool add -g <RESOURCE_GROUP> --cluster-name <CLUSTER_NAME> -n e6engine --mode User \
     --node-vm-size <ENGINE_VM_SIZE> --node-count 0 --enable-cluster-autoscaler --min-count 0 --max-count <MAX> \
     --zones <ZONES> --labels workspace-name=<WORKSPACE_NAME> --node-taints workspace-name=<WORKSPACE_NAME>:NoSchedule
   ```
2. Skip every Karpenter step and the workspace AKSNodeClass and NodePool.
3. Put cert-manager and the operator on the system pool (`nodeSelector: kubernetes.azure.com/mode: system`, toleration `CriticalAddonsOnly`). Set `karpenter.enabled: false` in the operator values.
4. Workspace: leave `karpenterNodePool` empty, and give the query router and usage stack no Karpenter-label affinity. The **Static node pool** tabs in the install steps set items 3 and 4.
5. Annotate the NamespaceConfig with `e6data.io/node-provisioning=external`.

## Cost impact

* With Karpenter or NAP, machines match each request and are removed after suspend (NAP: about 30 seconds after the node is empty).
* With Cluster Autoscaler or fixed pools, empty nodes stay until the scale-down delay (about 10 minutes by default). Pools sized larger than needed cost more.

## Preflight check

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
az aks show -g <RG> -n <CLUSTER> --query "{nap:nodeProvisioningProfile.mode, lock:nodeResourceGroupProfile.restrictionLevel}" -o yaml
az aks nodepool list -g <RG> --cluster-name <CLUSTER> --query "[].{name:name,autoscale:enableAutoScaling}" -o table
```

Check your vCPU quota covers the machine families your release uses ([Sizing and cost](https://docs.e6data.com/platform/deploy/azure-cloudprem/sizing-and-cost.md)).

## Verify

1. Resume a cluster from the e6data console. New nodes appear (NodeClaims or node-pool scale-up) and the cluster becomes **Running**.
2. Run a query and check it appears in **Query History**.
3. Suspend the cluster. Nodes are removed within the times in [Cost impact](#cost-impact).

## Troubleshooting

| Symptom | Cause | Fix |
| - | - | - |
| Pods `Pending`, "Insufficient cpu" | Machine type too small | Add larger types to the node group or pool |
| Cluster create refused: "New machines can be started" check failed | `e6data.io/node-provisioning=external` annotation missing | Add the annotation |
| `nodeProvisioningProfile.mode cannot be Auto unless all AgentPools have … enableAutoScaling … false` | Cluster autoscaler still on for a pool | NAP step 1 |
| `AKSNodeClass … unknown field "spec.instanceStorePolicy"` | NAP doesn't support it | Remove the field |
| A new Azure node pool starts 3 VMs | Created without `--node-count 0` | Scale to 0, or recreate with `--node-count 0` |
| Cluster start times out with `E6_CLUSTER_NODE_BOOTSTRAP_TIMEOUT` on Spot | No Spot capacity for that size | Allow on-demand in the engine NodePool |
| Turning NAP back on deleted your AKSNodeClasses | NAP re-creates its CRDs when switched from Manual to Auto | Re-apply the AKSNodeClass and NodePool manifests |

## Limitations

* AKS node pools with the cluster autoscaler: Coming later.
* AKS Automatic: Coming later. Warm pools on AKS Automatic: Not supported today.
* Local NVMe striping with NAP or AKS Automatic: Not supported today.

## See also

* [Use an existing AKS cluster](https://docs.e6data.com/platform/deploy/azure-cloudprem/use-existing-cluster.md)
* [Permissions reference](https://docs.e6data.com/platform/deploy/azure-cloudprem/permissions-reference.md)
* [Sizing and cost](https://docs.e6data.com/platform/deploy/azure-cloudprem/sizing-and-cost.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.