Skip to content

Service Annotations

MikroLB supports the following Service annotations:

AnnotationDescription
mikrolb.de/load-balancer-enabledIf set to false, the load balancer will be disabled for this service, but address(es) will still be allocated.
mikrolb.de/load-balancer-ipsRequest specific LoadBalancer IP address(es). An arbitrary number of IPv4 and IPv6 addresses are supported.
mikrolb.de/load-balancer-poolsRequest one IP address from every pool specified.
mikrolb.de/snat-enabledIf set to false, the SNAT will be disabled for this service, but address(es) will still be allocated.
mikrolb.de/snat-ipsRequest these IP address(es) for SNAT. Only one IPv4 and one IPv6 address are supported. Use the special value use-lb-ips to use the allocated load balancer IP address(es) for SNAT.

Example

yaml
apiVersion: v1
kind: Service
metadata:
  name: demo
  annotations:
    mikrolb.de/load-balancer-pools: external-v4,external-v6
spec:
  type: LoadBalancer
  loadBalancerClass: mikrolb.de/controller
  ipFamilyPolicy: RequireDualStack
  selector:
    app: demo
  ports:
    - port: 80
      targetPort: 8080