Configure IP Address Pools Using Eip

This document describes how to configure an Eip object, which functions as an IP address pool for PorterLB both in BGP mode and in Layer 2 mode.

PorterLB assigns IP addresses in Eip objects to LoadBalancer Services in the Kubernetes cluster. After that, PorterLB publishes routes destined for the Service IP addresses over BGP (in BGP mode), ARP (in Layer 2 mode for IPv4), or NDP (in Layer 2 mode for IPv6).


Currently, PorterLB supports only IPv4 and will soon support IPv6.

Configure an Eip Object for PorterLB

You can create an Eip object to provide an IP address pool for PorterLB. The following is an example of the Eip YAML configuration:

kind: Eip
    name: eip-sample-pool
    protocol: layer2
    interface: eth0
    disable: false
    occupied: false
    usage: 1
    poolSize: 10
      "": "default/test-svc"
    ready: true
    v4: true

The fields are described as follows:


  • name: Name of the Eip object.


  • address: One or more IP addresses, which will be used by PorterLB. The value format can be:

    • IP address, for example,
    • IP address/Subnet mask, for example,
    • IP address 1-IP address 2, for example,


    IP segments in different Eip objects cannot overlap. Otherwise, a resource creation error will occur.
  • protocol: Specifies which mode of PorterLB the Eip object is used for. The value can be either layer2 or bgp. If this field is not specified, the default value bgp is used.

  • interface: NIC on which PorterLB listens for ARP or NDP requests. This field is valid only when protocol is set to layer2.


    If the NIC names of the Kubernetes cluster nodes are different, you can set the value to can_reach:IP address (for example, can_reach: so that PorterLB automatically obtains the name of the NIC that can reach the IP address. In this case, you must ensure that the IP address is not used by Kubernetes cluster nodes but can be reached by the cluster nodes.
  • disable: Specifies whether the Eip object is disabled. The value can be:

    • false: PorterLB can assign IP addresses in the Eip object to new LoadBalancer Services.
    • true: PorterLB stops assigning IP addresses in the Eip object to new LoadBalancer Services. Existing Services are not affected.

status: Fields under status specify the status of the Eip object and are automatically configured. When creating an Eip object, you do not need to configure these fields.

  • occupied: Specifies whether IP addresses in the Eip object have been used up.

  • usage: Specifies how many IP addresses in the Eip object have been assigned to Services.

  • used: Specifies the used IP addresses and the Services that use the IP addresses. The Services are displayed in the Namespace/Service name format (for example, default/test-svc).

  • poolSize: Total number of IP addresses in the Eip object.

  • firstIP: First IP address in the Eip object.

  • lastIP: Last IP address in the Eip object.

  • v4: Specifies whether the address family is IPv4. Currently, PorterLB supports only IPv4 and the value can only be true.

  • ready: Specifies whether the Eip-associated program used for BGP/ARP/NDP routes publishing has been initialized. The program is integrated in PorterLB.