# AddNodePool

- Module: [Aspire.Hosting.Azure.Kubernetes](/reference/api/go/aspire.hosting.azure.kubernetes.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: [`AzureKubernetesEnvironmentResource`](/reference/api/go/aspire.hosting.azure.kubernetes/azurekubernetesenvironmentresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Adds a node pool to the AKS cluster using a configuration callback.

## Remarks

The callback receives the node pool configuration with default VM size and node counts.
Configuration remains mutable and is validated during infrastructure generation.
Omitting the OS SKU leaves AKS to choose its default.
The returned resource can be used to schedule workloads on this pool.

## Definition

```go
func (AzureKubernetesEnvironmentResource) AddNodePool(
    name string,
    configure func(obj *AksNodePoolConfig),
) AksNodePoolResource
```

## Parameters

- `name` (`string`) -- The name of the node pool.
- `configure` (`func(obj *AksNodePoolConfig)`) -- A callback to configure VM size, autoscaling, and OS SKU.

## Returns

[`AksNodePoolResource`](/reference/api/go/aspire.hosting.azure.kubernetes/aksnodepoolresource.md) -- The resource builder for the new node pool.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`AzureKubernetesEnvironmentResource`](/reference/api/go/aspire.hosting.azure.kubernetes/azurekubernetesenvironmentresource.md)
