Load Balancer
The configurations regarding multiple standard load balancers. If not supplied, single load balancer mode will be used. Multiple standard load balancers mode will be used if at lease one configuration is supplied. There has to be a configuration named kubernetes
. Uses Azure REST API version 2024-10-02-preview. In version 2.x of the Azure Native provider, it used API version 2024-03-02-preview. Other available API versions: 2024-03-02-preview, 2024-04-02-preview, 2024-05-02-preview, 2024-06-02-preview, 2024-07-02-preview, 2024-09-02-preview, 2025-01-02-preview, 2025-02-02-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native containerservice [ApiVersion]
. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.
Example Usage
Create or update a Load Balancer
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var loadBalancer = new AzureNative.ContainerService.LoadBalancer("loadBalancer", new()
{
AllowServicePlacement = true,
LoadBalancerName = "kubernetes",
Name = "kubernetes",
PrimaryAgentPoolName = "agentpool1",
ResourceGroupName = "rg1",
ResourceName = "clustername1",
});
});
package main
import (
containerservice "github.com/pulumi/pulumi-azure-native-sdk/containerservice/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := containerservice.NewLoadBalancer(ctx, "loadBalancer", &containerservice.LoadBalancerArgs{
AllowServicePlacement: pulumi.Bool(true),
LoadBalancerName: pulumi.String("kubernetes"),
Name: pulumi.String("kubernetes"),
PrimaryAgentPoolName: pulumi.String("agentpool1"),
ResourceGroupName: pulumi.String("rg1"),
ResourceName: pulumi.String("clustername1"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerservice.LoadBalancer;
import com.pulumi.azurenative.containerservice.LoadBalancerArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var loadBalancer = new LoadBalancer("loadBalancer", LoadBalancerArgs.builder()
.allowServicePlacement(true)
.loadBalancerName("kubernetes")
.name("kubernetes")
.primaryAgentPoolName("agentpool1")
.resourceGroupName("rg1")
.resourceName("clustername1")
.build());
}
}
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:containerservice:LoadBalancer kubernetes /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}
Properties
Whether to automatically place services on the load balancer. If not supplied, the default value is true. If set to false manually, both of the external and the internal load balancer will not be selected for services unless they explicitly target it.
The Azure API version of the resource.
Nodes that match this selector will be possible members of this load balancer.
Required field. A string value that must specify the ID of an existing agent pool. All nodes in the given pool will always be added to this load balancer. This agent pool must have at least one node and minCount>=1 for autoscaling operations. An agent pool can only be the primary pool for a single load balancer.
The current provisioning state.
Only services that must match this selector can be placed on this load balancer.
Services created in namespaces that match the selector can be placed on this load balancer.
Azure Resource Manager metadata containing createdBy and modifiedBy information.