Request from a specific IP pool

When multiple IP addresses are configured to the system, you can request assignment from a specific IP address pool.

Caution

Do not use the private IP of the master node to configure IP address pools, as admin function of the MKE web UI will become inaccessible as a result.

  1. Add the metallb.universe.tf/address-pool annotation to the service with the name of the IP address pool as the annotation value:

    apiVersion: v1
    kind: Service
    metadata:
      name: nginx
      annotations:
        metallb.universe.tf/address-pool: <IP-address-pool-name>
    spec:
      ports:
      - name: http
        port: 80
        protocol: TCP
        targetPort: 80
      selector:
        app: nginx
    type: LoadBalancer
    

    On creation, the service is assigned an external IP address from the indicated IP address pool.

  2. Verify the IP address assignment:

    kubectl get svc
    

    Example output:

    NAME         TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE
    kubernetes   ClusterIP      10.96.0.1      <none>        443/TCP        76m
    nginx        LoadBalancer   10.96.183.55   52.205.10.0   80:35328/TCP   9s
    

See also

MetalLB usage