Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

AddLoadBalancer

Method
📦 Aspire.Hosting.Azure.Kubernetes v17.0.0
func (AzureKubernetesEnvironmentResource) AddLoadBalancer(
name string,
subnet AzureSubnetResource,
) AzureKubernetesLoadBalancerResource

Signature

methodAddLoadBalancerbuilder
Adds an Azure Application Gateway for Containers (AGC) ApplicationLoadBalancer to this AKS environment, bound to the supplied delegated subnet. Returns a resource builder that can be passed to gateway.WithLoadBalancer(lb) / ingress.WithLoadBalancer(lb) to route traffic through this load balancer.
AddLoadBalancer(
name string,
subnet AzureSubnetResource,
) AzureKubernetesLoadBalancerResource
namestringThe name of the load balancer resource. Used to derive the in-cluster ApplicationLoadBalancer name (alb-{name}) referenced by gateway/ingress annotations.
subnetAzureSubnetResourceA subnet that will be associated with the AGC ALB. The subnet is automatically delegated to Microsoft.ServiceNetworking/trafficControllers; this is required by AGC and is idempotent across multiple AddLoadBalancer calls against the same subnet.
AzureKubernetesLoadBalancerResource

The resource builder.

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

Applies to

This method applies to the following types: