Annotations - AWS Load Balancer Controller (original) (raw)

Service annotations

Annotations

Warning

These annotations are specific to the kubernetes service resources reconciled by the AWS Load Balancer Controller. Although the list was initially derived from the k8s in-tree kube-controller-manager, this documentation is not an accurate reference for the services reconciled by the in-tree controller.

EKS Auto Mode users

If you are using EKS Auto Mode, please see theEKS Auto Mode documentationfor key differences between the load balancing capability of EKS Auto Mode and the open source load balancer controller.

Name Type Default Notes
service.beta.kubernetes.io/load-balancer-source-ranges stringList
service.beta.kubernetes.io/aws-load-balancer-security-group-prefix-lists stringList
service.beta.kubernetes.io/aws-load-balancer-type string
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type string default instance in case of LoadBalancerClass
service.beta.kubernetes.io/aws-load-balancer-name string
service.beta.kubernetes.io/aws-load-balancer-internal boolean false deprecated, in favor of aws-load-balancer-scheme
service.beta.kubernetes.io/aws-load-balancer-scheme string internal
service.beta.kubernetes.io/aws-load-balancer-proxy-protocol string Set to "*" to enable
service.beta.kubernetes.io/aws-load-balancer-proxy-protocol-per-target-group string If specified,configures proxy protocol for the target groups corresponding to the ports mentioned and disables for the rest. For example, if you have services deployed on ports "80, 443 and 22", the annotation value "80, 443" will enable proxy protocol for ports 80 and 443 only, and disable for port 22. This annotation is overriden by "service.beta.kubernetes.io/aws-load-balancer-proxy-protocol"
service.beta.kubernetes.io/aws-load-balancer-ip-address-type string ipv4 ipv4 | dualstack
service.beta.kubernetes.io/aws-load-balancer-access-log-enabled boolean false deprecated, in favor of aws-load-balancer-attributes
service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name string deprecated, in favor of aws-load-balancer-attributes
service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix string deprecated, in favor of aws-load-balancer-attributes
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled boolean false deprecated, in favor of aws-load-balancer-attributes
service.beta.kubernetes.io/aws-load-balancer-ssl-cert stringList
service.beta.kubernetes.io/aws-load-balancer-ssl-ports stringList
service.beta.kubernetes.io/aws-load-balancer-ssl-negotiation-policy string ELBSecurityPolicy-2016-08
service.beta.kubernetes.io/aws-load-balancer-backend-protocol string
service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags stringMap
service.beta.kubernetes.io/aws-load-balancer-healthcheck-protocol string TCP
service.beta.kubernetes.io/aws-load-balancer-healthcheck-port integer | traffic-port named-service-port traffic-port
service.beta.kubernetes.io/aws-load-balancer-healthcheck-path string "/" for HTTP(S) protocols
service.beta.kubernetes.io/aws-load-balancer-healthcheck-healthy-threshold integer 3
service.beta.kubernetes.io/aws-load-balancer-healthcheck-unhealthy-threshold integer 3
service.beta.kubernetes.io/aws-load-balancer-healthcheck-timeout integer 10
service.beta.kubernetes.io/aws-load-balancer-healthcheck-interval integer 10
service.beta.kubernetes.io/aws-load-balancer-healthcheck-success-codes string 200-399
service.beta.kubernetes.io/aws-load-balancer-eip-allocations stringList internet-facing lb only. Length must match the number of subnets
service.beta.kubernetes.io/aws-load-balancer-private-ipv4-addresses stringList internal lb only. Length must match the number of subnets
service.beta.kubernetes.io/aws-load-balancer-ipv6-addresses stringList dualstack lb only. Length must match the number of subnets
service.beta.kubernetes.io/aws-load-balancer-target-group-attributes stringMap
service.beta.kubernetes.io/aws-load-balancer-subnets stringList
service.beta.kubernetes.io/aws-load-balancer-alpn-policy string
service.beta.kubernetes.io/aws-load-balancer-target-node-labels stringMap
service.beta.kubernetes.io/aws-load-balancer-attributes stringMap
service.beta.kubernetes.io/aws-load-balancer-security-groups stringList
service.beta.kubernetes.io/aws-load-balancer-manage-backend-security-group-rules boolean true If service.beta.kubernetes.io/aws-load-balancer-security-groups is specified, this must also be explicitly specified otherwise it defaults to false.
service.beta.kubernetes.io/aws-load-balancer-inbound-sg-rules-on-private-link-traffic string
service.beta.kubernetes.io/aws-load-balancer-listener-attributes.${Protocol}-${Port} stringMap
service.beta.kubernetes.io/aws-load-balancer-multi-cluster-target-group boolean false If specified, the controller will only operate on targets that exist within the cluster, ignoring targets from other sources.
service.beta.kubernetes.io/aws-load-balancer-enable-prefix-for-ipv6-source-nat string off Optional annotation. dualstack lb only. Allowed values - on and off
service.beta.kubernetes.io/aws-load-balancer-source-nat-ipv6-prefixes stringList Optional annotation. dualstack lb only. This annotation is only applicable when user has to set the service.beta.kubernetes.io/aws-load-balancer-enable-prefix-for-ipv6-source-nat to "on". Length must match the number of subnets
service.beta.kubernetes.io/aws-load-balancer-minimum-load-balancer-capacity stringMap
service.beta.kubernetes.io/aws-load-balancer-enable-icmp-for-path-mtu-discovery string If specified, a security group rule is added to the managed security group to allow explicit ICMP traffic for Path MTU discovery for IPv4 and dual-stack VPCs. Creates a rule for each source range if service.beta.kubernetes.io/load-balancer-source-ranges is present.
service.beta.kubernetes.io/aws-load-balancer-enable-tcp-udp-listener boolean false If specified, the controller will attempt to try TCP_UDP Listeners when the service defines a TCP and UDP port on the same port number.
service.beta.kubernetes.io/aws-load-balancer-disable-nlb-sg boolean false If specified, the controller will not create or manage Security Groups for the service.
service.beta.kubernetes.io/aws-load-balancer-quic-enabled-ports stringList If specified, the controller will upgrade each port specified from UDP to QUIC or TCP_UDP to TCP_QUIC.
service.beta.kubernetes.io/aws-load-balancer-actions.${Protocol}-${Port} stringMap If specified, the controller will add the specified action on the listener denoted by the port.

Traffic Routing

Traffic Routing can be controlled with following annotations:

Example
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: instance

Traffic Listening

Traffic Listening can be controlled with following annotations:

Support UDP-based services over IPv6

You can configure dualstack NLB to support UDP-based services over IPv6 via the following annotations:

Resource attributes

NLB resource attributes can be controlled via the following annotations:

The AWS Load Balancer Controller automatically applies following tags to the AWS resources it creates (NLB/TargetGroups/Listener/ListenerRule):

In addition, you can use annotations to specify additional tags

Health Check

Health check on target groups can be configured with following annotations:

TLS

You can configure TLS support via the following annotations:

Access control

Load balancer access can be controlled via following annotations:

Capacity Unit Reservation

Load balancer capacity unit reservation can be configured via following annotations:

Legacy Cloud Provider

The AWS Load Balancer Controller manages Kubernetes Services in a compatible way with the AWS cloud provider's legacy service controller.