Ingress resolves to backend Pod's ip

Cluster information:

Kubernetes version: Client Version: v1.19.7
Server Version: v1.19.16
Cloud being used: (put bare-metal if not on a public cloud) Rancher
Installation method: Terraform
Host OS: control plane Centos7, worker nodes Centos 8
CNI and version: flannel 0.15.1
CRI and version: docker 20.10.6

One of our kuberenetes cluster (Opensearch) , nslookup of Ingress (Dashboard url) resolves to all the backend Pod’s ip. But we want to avoid that and it should resolves a single ip not any pod’s ip. In current set up , we are using ingressClassName: “nginx”.

Do we need to use any customize nginx set up and any redirection.

Could anyone please help . Ingress resolves to all the backend nodes ip but we want to implement in such a way that it would display single a ip.

This is entirely dependent on the environment you run in and
controller you use. Do you have a programmable load-balancer that can
offer a VIP to your network?

Sorry @thockin not sure what you mean by programmable load balancer. I am using ingress-nginx-controller.

Below is my current set up

  ingress:
    ingressClassName: "nginx"
    enabled: true
    annotations: {}
    hosts:
      - host: dashboards-test.kishore.backend.qat.green.com
        paths:
          - path: /
            backend:
              serviceName: dashboards-test
              servicePort: 5601
    tls:
      - secretName: dashboards-test-ingress-tls
        hosts:
          - dashboards-test.kishore.backend.qat.green.com

and ingress resolves to backend nodes ip.

Do we need to use custom ingress controller and MetalLb… or any redirection using reverse proxy?

You have clients SOMEWHERE, right?

Those clients do a name lookup and get back an IP.

They send a packet to that IP.

Where does that IP actually go in your setup? For example, in Google Cloud it goes to a cloud load-balancer, which has been programmed with all of the backend IPs.

ingress-nginx, by default, can’t assume a Google Cloud LB or an AWS LB, so it does what it can - node IPs.

I am not an ingress-nginx expert, but you need to be able to answer this before you can try to change how it works by default.