Connection between single page application running on nginx in kuberntes on azure and kong running in data center

We are running single page application on azure kubernetes server. These single page apps are running on nginx pod and initially downloaded to user browser. All our backend services are running on on-prem data center and kong cluster is running on -prem data center as well. Any backend services call from user browser/spa will have to go through kong cluster. We dont want calls to happen directly to the kong cluster. so we want to know what is the best way to integrate kubernetes with the kong cluster. I was thinking we could use external name service in k8 that points to loadbalancer that in turn calls kong nodes or we can use kubernetes services headless and define endpoint that points to kong nodes. Need best practice advise please.

Thanks in advance

We dont want calls to happen directly to the kong cluster.

If not directly to Kong, then what would be deployed infront of Kong that you would like the requests to go through?

I was thinking we could use external name service in k8 that points to loadbalancer that in turn calls kong nodes or we can use kubernetes services headless and define endpoint that points to kong nodes.

That all seems like unnecessary indirection for no purpose?
Could you please elaborate on what exactly is it that you are trying to setup, and then we can dig into implementation details?

We will have F5 loadbalancer that will be in front of kong cluster. All requests will go through loadbalancer then to kong node(s) and then to the upstream services apis. This set up is done in the on-prem data center. Kong cluster is deployed on red hat servers that runs on-premises and not on kubernetes

The plan is to have ui application deployed on the azure kubernetes. The backend api’s are protected by kong as described above. When the ui needs to invoke the backend api it can call it directly through loadbalancer or we can create proxy on kubernetes via external name service that points to loabalancer

Thank you for explaining this, it helped to make up a mental model of what you actually were trying to do.

This makes sense to me and I’d recommend that this is how you would want to set it up.

Thank you sir. we could let single page app call kong directly via loadbalancer but having kubernetes service in the middle would be good in my opinion.