Service Annotations

March 27, 2026 ยท View on GitHub

Overview

Service annotations allow you to customize the behavior of your LoadBalancer services. All Service annotations must be prefixed with: service.beta.kubernetes.io/linode-loadbalancer-

For implementation details, see:

NOTE: The keys and the values in annotations must be strings. In other words, you cannot use numeric, boolean, list or other types for either the keys or the values. Hence, one should double quote them when specifying in annotations to convert them to string.

Available Annotations

Basic Configuration

Annotation (Suffix)ValuesDefaultDescription
throttle0-20 (0 to disable)0Client Connection Throttle, which limits the number of subsequent new connections per second from the same client IP
default-protocoltcp, udp, http, httpstcpThis annotation is used to specify the default protocol for Linode NodeBalancer
default-proxy-protocolnone, v1, v2noneSpecifies whether to use a version of Proxy Protocol on the underlying NodeBalancer
default-algorithmroundrobin, leastconn, source, ring_hashroundrobinThis annotation is used to specify the default algorithm for Linode NodeBalancer
default-stickinessnone, session, table, http_cookie, source_ipsession (for UDP), table (for HTTP/HTTPs)This annotation is used to specify the default stickiness for Linode NodeBalancer
port-*json objectSpecifies port specific NodeBalancer configuration. See Port Configuration
check-typenone, connection, http, http_bodynone for UDP, else connectionThe type of health check to perform against back-ends. See Health Checks
check-pathstringThe URL path to check on each back-end during health checks
check-bodystringText which must be present in the response body to pass the health check
check-intervalint5Duration, in seconds, to wait between health checks
check-timeoutint (1-30)3Duration, in seconds, to wait for a health check to succeed
check-attemptsint (1-30)2Number of health check failures necessary to remove a back-end
check-passiveboolfalseWhen true, 5xx status codes will cause the health check to fail
udp-check-portint80Specifies health check port for UDP nodebalancer
preserveboolfalseWhen true, deleting a LoadBalancer service does not delete the underlying NodeBalancer
nodebalancer-idintThe ID of the NodeBalancer to front the service
hostname-only-ingressboolfalseWhen true, the LoadBalancerStatus will only contain the Hostname
tagsstringA comma separated list of tags to be applied to the NodeBalancer instance
firewall-idintAn existing Cloud Firewall ID to be attached to the NodeBalancer instance. See Firewall Setup
firewall-aclstringThe Firewall rules to be applied to the NodeBalancer. See Firewall Configuration
nodebalancer-typestringThe type of NodeBalancer to create (options: common, premium, premium_40gb). See NodeBalancer Types. Note: NodeBalancer types should always be specified in lowercase.
enable-ipv6-ingressboolfalseWhen true, both IPv4 and IPv6 addresses will be included in the LoadBalancerStatus ingress
enable-ipv6-backendsboolfalseWhen true, NodeBalancer services use node public IPv6 addresses as backend targets. VPC IPv6 backend addresses are not supported.
backend-ipv4-rangestringThe IPv4 range from VPC subnet to be applied to the NodeBalancer backend. See Nodebalancer VPC Configuration
backend-vpc-namestringVPC which is connected to the NodeBalancer backend. See Nodebalancer VPC Configuration
backend-subnet-namestringSubnet within VPC which is connected to the NodeBalancer backend. See Nodebalancer VPC Configuration
backend-subnet-idstringSubnet ID within VPC which is connected to the NodeBalancer backend. See Nodebalancer VPC Configuration
frontend-subnet-idstringSubnet ID for the NodeBalancer frontend VPC configuration. See Nodebalancer VPC Configuration
frontend-vpc-namestringFrontend VPC name for the NodeBalancer frontend VPC configuration. See Nodebalancer VPC Configuration
frontend-subnet-namestringFrontend subnet name for the NodeBalancer frontend VPC configuration. See Nodebalancer VPC Configuration
frontend-ipv4-rangestringOptional IPv4 CIDR range from the frontend subnet. See Nodebalancer VPC Configuration
frontend-ipv6-rangestringOptional IPv6 CIDR range from the frontend subnet. See Nodebalancer VPC Configuration
reserved-ipv4stringAn existing Reserved IPv4 address that wil be used to initialize the NodeBalancer instance. See LoadBalancer Configuration)

Port Specific Configuration

The port-* annotation allows per-port configuration, encoded in JSON. For detailed examples, see LoadBalancer SSL/TLS Setup.

metadata:
  annotations:
    service.beta.kubernetes.io/linode-loadbalancer-port-443: |
      {
        "protocol": "https",
        "tls-secret-name": "my-tls-secret",
        "proxy-protocol": "v2",
        "algorithm": "leastconn",
        "stickiness": "http_cookie"
      }

Available port options:

  • protocol: Protocol for this port (tcp, http, https)
  • tls-secret-name: Name of TLS secret for HTTPS. The secret type should be kubernetes.io/tls
  • proxy-protocol: Proxy protocol version for this port
  • algorithm: Algorithm for this port
  • stickiness: Stickiness for this port
  • udp-check-port: UDP health check port for this port

Deprecated Annotations

Annotation (Suffix)ValuesDefaultDescriptionScheduled Removal
proxy-protocolnone, v1, v2noneSpecifies whether to use a version of Proxy Protocol on the underlying NodeBalancerQ4 2021

Annotation Boolean Values

For annotations with bool value types, the following string values are interpreted as true:

  • "1"
  • "t"
  • "T"
  • "true"
  • "True"
  • "TRUE"

Any other values will be interpreted as false. For more details, see strconv.ParseBool.

Examples

Basic HTTP Service

metadata:
  annotations:
    service.beta.kubernetes.io/linode-loadbalancer-default-protocol: "http"
    service.beta.kubernetes.io/linode-loadbalancer-check-type: "http"
    service.beta.kubernetes.io/linode-loadbalancer-check-path: "/healthz"

HTTPS Service with TLS

metadata:
  annotations:
    service.beta.kubernetes.io/linode-loadbalancer-port-443: |
      {
        "protocol": "https",
        "tls-secret-name": "my-tls-secret"
      }

Firewall Configuration

metadata:
  annotations:
    service.beta.kubernetes.io/linode-loadbalancer-firewall-acl: |
      {
        "allowList": {
          "ipv4": ["192.168.0.0/16"],
          "ipv6": ["2001:db8::/32"]
        }
      }

NodeBalancer Type

Linode supports nodebalancers of different types: common, premium, and premium_40gb. By default, nodebalancers of type common are provisioned. If an account is allowed to provision premium nodebalancers and one wants to use them, it can be achieved by specifying the annotation:

Note: NodeBalancer types should always be specified in lowercase. The controller will automatically convert uppercase values to lowercase for safety.

metadata:
  annotations:
    service.beta.kubernetes.io/linode-loadbalancer-nodebalancer-type: premium

Nodebalancer VPC Configuration

metadata:
  annotations:
    service.beta.kubernetes.io/linode-loadbalancer-backend-ipv4-range: "10.100.0.0/30"
    service.beta.kubernetes.io/linode-loadbalancer-backend-vpc-name: "vpc1"
    service.beta.kubernetes.io/linode-loadbalancer-backend-subnet-name: "subnet1"

Frontend VPC configuration:

metadata:
  annotations:
    service.beta.kubernetes.io/linode-loadbalancer-frontend-subnet-id: "169341"
    # Optional:
    # service.beta.kubernetes.io/linode-loadbalancer-frontend-ipv4-range: "10.0.0.0/24"
    # service.beta.kubernetes.io/linode-loadbalancer-frontend-ipv6-range: "2001:db8::/64"

Service with IPv6 Address

metadata:
  annotations:
    service.beta.kubernetes.io/linode-loadbalancer-enable-ipv6-ingress: "true"

For more examples and detailed configuration options, see:

See also: