Can i use ingress controllers to configure existing Load Balancer provisioned for Kubernetes Bare Metal

600 Views Asked by At

We have seen on cloud that installing an ingress controller, automatically provisions a LoadBalancer and ingress rules configure Load Balancer itself.

We have used k8s-hard-way to establish a k8s cluster on bare metal

Here on a bare Metal K8s, we have already provisioned a LoadBalancer as described in this section

Can we use Ingress controllers like Kong / HAProxy/ Nginx to configure this existing Load Balancer via Ingress rules? If Not, what should be the way?

1

There are 1 best solutions below

6
On

So generally when Nginx ingress controller or any other controller like Kong got installed to K8s it creates the service type LoadBalancer.

You can create or modify the service that got created by default and map your LoadBalancer IP to the service.

apiVersion: v1
kind: Service
spec:
  ...
  type: LoadBalancer
  loadBalancerIP: 192.168.0.01

Now your controller service is pointing to the LB IP and your service is exposed to the internet.

Map LB IP to hostname in DNS and you are good to use it.