<p>I have purchased 3 VPS and have IP address like</p>
<pre><code>   172.168.1.146
   72.168.43.245
   98.156.56.123
</code></pre>
<p>I have got an ingress controller</p>
<p>I have installed metallb which loadbalances traffic and sends it to any of the IP address.</p>
<p>Now how do I provide a static IP to my kubernetes cluster endpoint?</p>
<p>Should I purchase a virtual IP and configure it to metallb? If so how?</p>
<p>or</p>
<p>Should I configure keepalived in all the above nodes and configure a virtual IP. In this case can I configure the same virtual IP to all the nodes? Will there not be an IP conflict? If one of the node dies will the virtual IP be automatically assigned to another node which is alive? If so what would be the usual duration of automatically assigning the IP address to another node which is alive?</p>

jeril
<p>MetalLB is currently in beta. Read about the Project <a href="https://metallb.universe.tf/concepts/maturity/" rel="nofollow noreferrer">maturity</a> and make sure you inform yourself by reading the official documentation thoroughly.</p>
<p>MetalLB can be deployed either with a simple Kubernetes manifest or with Helm. The rest of this example assumes MetalLB was deployed following the <a href="https://metallb.universe.tf/installation/" rel="nofollow noreferrer">Installation</a> instructions.
MetalLB requires a pool of IP addresses in order to be able to take ownership of the ingress-nginx Service. This pool can be defined in a ConfigMap named config located in the same namespace as the MetalLB controller. This pool of IPs must be dedicated to MetalLB's use, you can't reuse the Kubernetes node IPs or IPs handed out by a DHCP server.</p>
<p>Given the following 3-node Kubernetes cluster (the external IP is added as an example</p>
<pre><code>$ kubectl get node
NAME     STATUS   ROLES    EXTERNAL-IP
host-1   Ready    master   203.0.113.1
host-2   Ready    node     203.0.113.2
host-3   Ready    node     203.0.113.3
</code></pre>
<p>After creating the following ConfigMap, MetalLB takes ownership of one of the IP addresses in the pool and updates the loadBalancer IP field of the ingress-nginx Service accordingly.</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  namespace: metallb-system
  name: config
data:
  config: |
    address-pools:
    - name: default
      protocol: layer2
      addresses:
      - 203.0.113.10-203.0.113.15
</code></pre>
