<p>I have a running Kubernetes cluster consists of 3 nodes and one mater running on a VPS server, each node and master has its own public IP and floating IP also assigned to it and all these IPs are different from other</p>
<p>I am trying to configure metallb as a load balancer for my Kubernetes cluster but I don't know how can I set the metalLb IPs to range in the configuration file</p>
<p>here are the IPs examples of my servers</p>
<ul>
<li>115.203.150.255</li>
<li>94.217.238.58</li>
<li>46.12.5.65</li>
<li>76.47.79.44</li>
</ul>
<p>as you can see here, each IP is different so how can I set the Ip ranges in metallb config map?</p>
<p>Here an example of a config map</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  namespace: metallb-system
  name: config
data:
  config: |
    address-pools:
    - name: default
      protocol: layer2
      addresses:
      - PUBLIC_IP-PUBLIC_IP    
</code></pre>

<p>In the Metallb documentation there is a mention you can use certain IPs <code>metallb.universe.tf/address-pool</code>. See <a href="https://metallb.universe.tf/usage/#requesting-specific-ips" rel="nofollow noreferrer">here</a></p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: nginx
  annotations:
    metallb.universe.tf/address-pool: production-public-ips
spec:
  ports:
  - port: 80
    targetPort: 80
  selector:
    app: nginx
  type: LoadBalancer
</code></pre>
<p>The <code>production-public-ips</code> must be configured as showed <a href="https://metallb.universe.tf/usage/example/" rel="nofollow noreferrer">here</a>.</p>
<p>To <a href="https://metallb.universe.tf/configuration/#layer-2-configuration" rel="nofollow noreferrer">configure MetalLB</a>, you should create a configmap with your ips. Since you don't have the range, you can set <code>/32</code> as subnet for your ips, like the example below.</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  namespace: metallb-system
  name: config
data:
  config: |
    address-pools:
    - name: production-public-ips
      protocol: layer2
      addresses:
      - 115.203.150.255/32
      - 94.217.238.58/32
      - 46.12.5.65/32
      - 76.47.79.44/32
</code></pre>
<p>It should work for your scenario.</p>
