# AzureKubernetesEnvironmentResource

- Module: [Aspire.Hosting.Azure.Kubernetes](/reference/api/typescript/aspire.hosting.azure.kubernetes.md)
- Version: `13.3.0-preview.1.26254.5`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire)

## Definition

```typescript
interface AzureKubernetesEnvironmentResource
  extends IAzureResource,
    IComputeEnvironmentResource,
    IResource,
    IResourceWithParameters,
    IAzureComputeEnvironmentResource,
    IAzureNspAssociationTarget {
  addGateway(name: string): KubernetesGatewayResource;
  addIngress(name: string): KubernetesIngressResource;
  addNodePool(
      name: string,
      vmSize?: string,
      minCount?: number,
      maxCount?: number): AksNodePoolResource;
  withContainerRegistry(registry: AzureContainerRegistryResource): AzureKubernetesEnvironmentResource;
  withSubnet(subnet: AzureSubnetResource): AzureKubernetesEnvironmentResource;
  withSystemNodePool(
      vmSize?: string,
      minCount?: number,
      maxCount?: number): AzureKubernetesEnvironmentResource;
  withWorkloadIdentity(enabled?: boolean): AzureKubernetesEnvironmentResource;
}
```

## Methods

- [addGateway](/reference/api/typescript/aspire.hosting.azure.kubernetes/azurekubernetesenvironmentresource/addgateway.md) -- `method` -- Adds a Kubernetes Gateway API Gateway to an AKS environment
    ```typescript
  addGateway(name: string): KubernetesGatewayResource
  ```
- [addIngress](/reference/api/typescript/aspire.hosting.azure.kubernetes/azurekubernetesenvironmentresource/addingress.md) -- `method` -- Adds a Kubernetes Ingress resource to an AKS environment
    ```typescript
  addIngress(name: string): KubernetesIngressResource
  ```
- [addNodePool](/reference/api/typescript/aspire.hosting.azure.kubernetes/azurekubernetesenvironmentresource/addnodepool.md) -- `method` -- Adds a node pool to the AKS cluster
    ```typescript
  addNodePool(name: string, vmSize?: string, minCount?: number, maxCount?: number): AksNodePoolResource
  ```
- [withContainerRegistry](/reference/api/typescript/aspire.hosting.azure.kubernetes/azurekubernetesenvironmentresource/withcontainerregistry.md) -- `method` -- Configures the AKS environment to use a specific container registry
    ```typescript
  withContainerRegistry(registry: AzureContainerRegistryResource): AzureKubernetesEnvironmentResource
  ```
- [withSubnet](/reference/api/typescript/aspire.hosting.azure.kubernetes/azurekubernetesenvironmentresource/withsubnet.md) -- `method` -- Configures the AKS cluster to use a VNet subnet
    ```typescript
  withSubnet(subnet: AzureSubnetResource): AzureKubernetesEnvironmentResource
  ```
- [withSystemNodePool](/reference/api/typescript/aspire.hosting.azure.kubernetes/azurekubernetesenvironmentresource/withsystemnodepool.md) -- `method` -- Replaces the default system node pool with a customized configuration
    ```typescript
  withSystemNodePool(vmSize?: string, minCount?: number, maxCount?: number): AzureKubernetesEnvironmentResource
  ```
- [withWorkloadIdentity](/reference/api/typescript/aspire.hosting.azure.kubernetes/azurekubernetesenvironmentresource/withworkloadidentity.md) -- `method` -- Enables workload identity on the AKS cluster
    ```typescript
  withWorkloadIdentity(enabled?: boolean): AzureKubernetesEnvironmentResource
  ```
