LoadBalancerArgs

data class LoadBalancerArgs(val allowServicePlacement: Output<Boolean>? = null, val loadBalancerName: Output<String>? = null, val name: Output<String>? = null, val nodeSelector: Output<LabelSelectorArgs>? = null, val primaryAgentPoolName: Output<String>? = null, val resourceGroupName: Output<String>? = null, val resourceName: Output<String>? = null, val serviceLabelSelector: Output<LabelSelectorArgs>? = null, val serviceNamespaceSelector: Output<LabelSelectorArgs>? = null) : ConvertibleToJava<LoadBalancerArgs>

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. 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/v2"
"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}

Constructors

Link copied to clipboard
constructor(allowServicePlacement: Output<Boolean>? = null, loadBalancerName: Output<String>? = null, name: Output<String>? = null, nodeSelector: Output<LabelSelectorArgs>? = null, primaryAgentPoolName: Output<String>? = null, resourceGroupName: Output<String>? = null, resourceName: Output<String>? = null, serviceLabelSelector: Output<LabelSelectorArgs>? = null, serviceNamespaceSelector: Output<LabelSelectorArgs>? = null)

Properties

Link copied to clipboard
val allowServicePlacement: Output<Boolean>? = null

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.

Link copied to clipboard
val loadBalancerName: Output<String>? = null

The name of the load balancer.

Link copied to clipboard
val name: Output<String>? = null

Name of the public load balancer. There will be an internal load balancer created if needed, and the name will be <name>-internal. The internal lb shares the same configurations as the external one. The internal lbs are not needed to be included in LoadBalancer list. There must be a name of kubernetes in the list.

Link copied to clipboard
val nodeSelector: Output<LabelSelectorArgs>? = null

Nodes that match this selector will be possible members of this load balancer.

Link copied to clipboard
val primaryAgentPoolName: Output<String>? = null

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.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group. The name is case insensitive.

Link copied to clipboard
val resourceName: Output<String>? = null

The name of the managed cluster resource.

Link copied to clipboard

Only services that must match this selector can be placed on this load balancer.

Link copied to clipboard

Services created in namespaces that match the selector can be placed on this load balancer.

Functions

Link copied to clipboard
open override fun toJava(): LoadBalancerArgs