I have purchased 3 VPS and have IP address like
172.168.1.146
72.168.43.245
98.156.56.123
I have got an ingress controller
I have installed metallb which loadbalances traffic and sends it to any of the IP address.
Now how do I provide a static IP to my kubernetes cluster endpoint?
Should I purchase a virtual IP and configure it to metallb? If so how?
or
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?
MetalLB is currently in beta. Read about the Project maturity and make sure you inform yourself by reading the official documentation thoroughly.
MetalLB can be deployed either with a simple Kubernetes manifest or with Helm. The rest of this example assumes MetalLB was deployed following the Installation 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.
Given the following 3-node Kubernetes cluster (the external IP is added as an example
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.