# AzureKubernetesLoadBalancerResource

- Kind: `class`
- Package: [Aspire.Hosting.Azure.Kubernetes](/reference/api/csharp/aspire.hosting.azure.kubernetes.md)
- Version: `13.4.0-preview.1.26281.18`
- Namespace: `Aspire.Hosting.Azure.Kubernetes`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesLoadBalancerResource.cs)
- Inherits: `Resource`
- Implements: `IResource`, `IResourceWithParent`, `IResourceWithParent<AzureKubernetesEnvironmentResource>`

Represents a single Azure Application Gateway for Containers (AGC) `ApplicationLoadBalancer` Kubernetes custom resource ( `alb.networking.azure.io/v1`) bound to a delegated subnet.

## Definition

```csharp
namespace Aspire.Hosting.Azure.Kubernetes;

public sealed class AzureKubernetesLoadBalancerResource
    : Aspire.Hosting.ApplicationModel.Resource,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithParent,
      Aspire.Hosting.ApplicationModel.IResourceWithParent<Aspire.Hosting.Azure.Kubernetes.AzureKubernetesEnvironmentResource>
{
    // ...
}
```

## Remarks

Each AGC `ApplicationLoadBalancer` is capped at 5 frontends, so larger applications create multiple load balancer resources via repeated calls to [AzureKubernetesEnvironmentExtensions.AddLoadBalancer(IResourceBuilder<AzureKubernetesEnvironmentResource>, string, IResourceBuilder<AzureSubnetResource>)](/reference/api/csharp/aspire.hosting.azure.kubernetes/azurekubernetesenvironmentextensions/methods.md#addloadbalancer-iresourcebuilder-azurekubernetesenvironmentresource-string-iresourcebuilder-azuresubnetresource) and associate gateways/ingresses with a specific load balancer using [AzureKubernetesIngressExtensions.WithLoadBalancer(IResourceBuilder<KubernetesGatewayResource>, IResourceBuilder<AzureKubernetesLoadBalancerResource>)](/reference/api/csharp/aspire.hosting.azure.kubernetes/azurekubernetesingressextensions/methods.md#withloadbalancer-iresourcebuilder-kubernetesgatewayresource-iresourcebuilder-azurekubernetesloadbalancerresource).

The resource registers a per-LB `apply-alb-crd-{name}` pipeline step that runs after AKS credentials are fetched and before Helm chart preparation. The step polls the cluster for the `azure-alb-external` GatewayClass (installed by the AGC ALB controller add-on), then `kubectl apply` s the `ApplicationLoadBalancer` custom resource pointing at the supplied subnet.

## Properties

- [Parent](/reference/api/csharp/aspire.hosting.azure.kubernetes/azurekubernetesloadbalancerresource/properties.md#parent) : [AzureKubernetesEnvironmentResource](/reference/api/csharp/aspire.hosting.azure.kubernetes/azurekubernetesenvironmentresource.md) `get`
