Share via


Microsoft.ContainerService managedClusters/loadBalancers 2024-03-02-preview

Bicep resource definition

The managedClusters/loadBalancers resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.ContainerService/managedClusters/loadBalancers resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.ContainerService/managedClusters/loadBalancers@2024-03-02-preview' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    allowServicePlacement: bool
    name: 'string'
    nodeSelector: {
      matchExpressions: [
        {
          key: 'string'
          operator: 'string'
          values: [
            'string'
          ]
        }
      ]
      matchLabels: [
        'string'
      ]
    }
    primaryAgentPoolName: 'string'
    serviceLabelSelector: {
      matchExpressions: [
        {
          key: 'string'
          operator: 'string'
          values: [
            'string'
          ]
        }
      ]
      matchLabels: [
        'string'
      ]
    }
    serviceNamespaceSelector: {
      matchExpressions: [
        {
          key: 'string'
          operator: 'string'
          values: [
            'string'
          ]
        }
      ]
      matchLabels: [
        'string'
      ]
    }
  }
}

Property Values

Microsoft.ContainerService/managedClusters/loadBalancers

Name Description Value
name The resource name string

Constraints:
Min length = 1
Max length = 12
Pattern = ^[a-z][a-z0-9]{0,11}$ (required)
parent In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.

For more information, see Child resource outside parent resource.
Symbolic name for resource of type: managedClusters
properties The properties of the load balancer. LoadBalancerProperties

LabelSelector

Name Description Value
matchExpressions matchExpressions is a list of label selector requirements. The requirements are ANDed. LabelSelectorRequirement[]
matchLabels matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is key, the operator is In, and the values array contains only value. The requirements are ANDed. string[]

LabelSelectorRequirement

Name Description Value
key key is the label key that the selector applies to. string
operator operator represents a key's relationship to a set of values. Valid operators are In and NotIn 'DoesNotExist'
'Exists'
'In'
'NotIn'
values values is an array of string values, the values array must be non-empty. string[]

LoadBalancerProperties

Name Description Value
allowServicePlacement 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. bool
name 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. string (required)
nodeSelector Nodes that match this selector will be possible members of this load balancer. LabelSelector
primaryAgentPoolName 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. string (required)
serviceLabelSelector Only services that must match this selector can be placed on this load balancer. LabelSelector
serviceNamespaceSelector Services created in namespaces that match the selector can be placed on this load balancer. LabelSelector

ARM template resource definition

The managedClusters/loadBalancers resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.ContainerService/managedClusters/loadBalancers resource, add the following JSON to your template.

{
  "type": "Microsoft.ContainerService/managedClusters/loadBalancers",
  "apiVersion": "2024-03-02-preview",
  "name": "string",
  "properties": {
    "allowServicePlacement": "bool",
    "name": "string",
    "nodeSelector": {
      "matchExpressions": [
        {
          "key": "string",
          "operator": "string",
          "values": [ "string" ]
        }
      ],
      "matchLabels": [ "string" ]
    },
    "primaryAgentPoolName": "string",
    "serviceLabelSelector": {
      "matchExpressions": [
        {
          "key": "string",
          "operator": "string",
          "values": [ "string" ]
        }
      ],
      "matchLabels": [ "string" ]
    },
    "serviceNamespaceSelector": {
      "matchExpressions": [
        {
          "key": "string",
          "operator": "string",
          "values": [ "string" ]
        }
      ],
      "matchLabels": [ "string" ]
    }
  }
}

Property Values

Microsoft.ContainerService/managedClusters/loadBalancers

Name Description Value
apiVersion The api version '2024-03-02-preview'
name The resource name string

Constraints:
Min length = 1
Max length = 12
Pattern = ^[a-z][a-z0-9]{0,11}$ (required)
properties The properties of the load balancer. LoadBalancerProperties
type The resource type 'Microsoft.ContainerService/managedClusters/loadBalancers'

LabelSelector

Name Description Value
matchExpressions matchExpressions is a list of label selector requirements. The requirements are ANDed. LabelSelectorRequirement[]
matchLabels matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is key, the operator is In, and the values array contains only value. The requirements are ANDed. string[]

LabelSelectorRequirement

Name Description Value
key key is the label key that the selector applies to. string
operator operator represents a key's relationship to a set of values. Valid operators are In and NotIn 'DoesNotExist'
'Exists'
'In'
'NotIn'
values values is an array of string values, the values array must be non-empty. string[]

LoadBalancerProperties

Name Description Value
allowServicePlacement 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. bool
name 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. string (required)
nodeSelector Nodes that match this selector will be possible members of this load balancer. LabelSelector
primaryAgentPoolName 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. string (required)
serviceLabelSelector Only services that must match this selector can be placed on this load balancer. LabelSelector
serviceNamespaceSelector Services created in namespaces that match the selector can be placed on this load balancer. LabelSelector

Usage Examples

Terraform (AzAPI provider) resource definition

The managedClusters/loadBalancers resource type can be deployed with operations that target:

  • Resource groups

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.ContainerService/managedClusters/loadBalancers resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.ContainerService/managedClusters/loadBalancers@2024-03-02-preview"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      allowServicePlacement = bool
      name = "string"
      nodeSelector = {
        matchExpressions = [
          {
            key = "string"
            operator = "string"
            values = [
              "string"
            ]
          }
        ]
        matchLabels = [
          "string"
        ]
      }
      primaryAgentPoolName = "string"
      serviceLabelSelector = {
        matchExpressions = [
          {
            key = "string"
            operator = "string"
            values = [
              "string"
            ]
          }
        ]
        matchLabels = [
          "string"
        ]
      }
      serviceNamespaceSelector = {
        matchExpressions = [
          {
            key = "string"
            operator = "string"
            values = [
              "string"
            ]
          }
        ]
        matchLabels = [
          "string"
        ]
      }
    }
  }
}

Property Values

Microsoft.ContainerService/managedClusters/loadBalancers

Name Description Value
name The resource name string

Constraints:
Min length = 1
Max length = 12
Pattern = ^[a-z][a-z0-9]{0,11}$ (required)
parent_id The ID of the resource that is the parent for this resource. ID for resource of type: managedClusters
properties The properties of the load balancer. LoadBalancerProperties
type The resource type "Microsoft.ContainerService/managedClusters/loadBalancers@2024-03-02-preview"

LabelSelector

Name Description Value
matchExpressions matchExpressions is a list of label selector requirements. The requirements are ANDed. LabelSelectorRequirement[]
matchLabels matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is key, the operator is In, and the values array contains only value. The requirements are ANDed. string[]

LabelSelectorRequirement

Name Description Value
key key is the label key that the selector applies to. string
operator operator represents a key's relationship to a set of values. Valid operators are In and NotIn 'DoesNotExist'
'Exists'
'In'
'NotIn'
values values is an array of string values, the values array must be non-empty. string[]

LoadBalancerProperties

Name Description Value
allowServicePlacement 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. bool
name 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. string (required)
nodeSelector Nodes that match this selector will be possible members of this load balancer. LabelSelector
primaryAgentPoolName 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. string (required)
serviceLabelSelector Only services that must match this selector can be placed on this load balancer. LabelSelector
serviceNamespaceSelector Services created in namespaces that match the selector can be placed on this load balancer. LabelSelector