skip to Main Content

I have a 3-node OKE cluster setup in Oracle cloud.

I deployed an nginx ingress controller in the cluster.
I’m mapping the FQDN test.myapp.com to the EXTERNAL_IP of that nginx ingress controller service.

Whenever I re-install the ingress controller during the time of testing, it gets different EXTERNAL_IP and I have to map the FQDN again to that new IP.

So it will be better if I can specify a static loadBalancer IP during the time of nginx ingress controller installation. Like this:

nginx-ingress:
  controller:
    service:
      loadBalancerIP: "125.23.119.23"

How can I achieve this in Oracle cloud (with OKE)?

2

Answers


  1. Chosen as BEST ANSWER

    Oracle cloud Infrastructure(OCI) supports creating LoadBalancer services in kubernetes clusters, and allows setting the LoadBalancerIP parameter too.

    But first, you have to create a Reserved Public IP address in OCI, and then specify that IP address as LoadBalancerIP of your service.

    You can do it as :

    • Go to OCI console :
      Networking -> IP management -> Reserved Public IPs.
      Click on Reserve Public IP Address
      Provide a name, and select source Oracle if that is the only public IP pool you have (default).
      Click on the Reserve button to get a reserved public IP address.

    • In OCI console, look at :
      Networking -> IP management -> Reserved Public IPs
      ( You can see a Reserved Public IP there, but not attached to any VNIC)
      Networking -> Load Balancers
      ( No Loadbalancers are listed with the IP address that we reserved )

    • Create a LoadBalancer type service in kubernetes cluster using kubectl with LoadbalancerIP provided with value of our Reserved IP Address.

    • Check kubectl get svc, and you can see that the Reserved Public IP address is assigned to the service.

    • In OCI console, look at :
      Networking -> IP management -> Reserved Public IPs
      ( You can see a public IP address reserved, attached to a VNIC for an LB)
      Networking -> Load Balancers
      ( A layer-4 Loadbalancer is added automatically with the IP address that we reserved )

    That means, when you create a Reserved Public IP, you are just reserving it for future use. A layer-4 load balancer is created and associated with that IP address only when a LoadBalancer type service is created with this Reserved IP address.

    If you delete that LoadBalancer type service, the layer-4 loadbalancer also gets deleted. But the Reserved public IP still remains there. You can assign that IP address to another service next time.

    These documentations have explanations regarding this topic :


  2. Please ensure you install nginx ingress controller using helm chart https://kubernetes.github.io/ingress-nginx/deploy/#using-helm

    Please make sure that your Ingress Controller runs as a DaemonSet only on the Infra Nodes of your Openshift Cluster using helm chart values.

    Then create an Oracle Cloud Load Balancer to point to the NodePort of the Infra Nodes on which Ingress Controller Service is listening on.

    This is the way that OpenShift Router works.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search