k8gb-io / k8gb

A cloud native Kubernetes Global Balancer
https://www.k8gb.io
Apache License 2.0
877 stars 93 forks source link

Reverse proxy support? #1275

Open neilmfrench opened 1 year ago

neilmfrench commented 1 year ago

Hi, I'm prototyping this with our reverse proxy. However, I'm running into an issue where coredns (exposed) is returning the internal IP of reverse proxy entrypoint, whereas I'd like it to return an external IP so we can have our main DNS delegate to it. Is this currently possible?

Thanks for your help!

ytsarev commented 1 year ago

Hi @neilmfrench , can you elaborate more about the specifics of your setup? What kind of ingress controller do you use and how is it integrated with reverse proxy?

neilmfrench commented 1 year ago

Hi @neilmfrench , can you elaborate more about the specifics of your setup? What kind of ingress controller do you use and how is it integrated with reverse proxy?

Sure, I am using Traefik (other cluster uses nginx, but testing on cluster with Traefik first). Life of a request flows like this

request -> Cloudflare proxy -> external IP (189.XX.XX.XX)-> internal load balancer for Traefik (172.16.XX.XX) -> cluster nodes (not exposed)

I need coredns to respond with the external IP rather than the internal load balancer IP it currently responds with:

Status:
  Healthy Records:
    .....................
      172.16.20.30

I tried creating my own DNSEndpoint with the correct external IP as the target, but it didn't seem to get picked up.

neilmfrench commented 11 months ago

I think the simplest solution would be to allow the reading of the "real" external IP from an annotation on the ingress if it exists, rather than relying only on status.loadBalancer.ingress. Health checks would still use the internal IP, but for building out the local targets list it would use whatever IP the annotation has.

ytsarev commented 11 months ago

@neilmfrench, thanks a lot for the suggestions! That sounds reasonable and should be relatively straightforward to add. We will put it into the roadmap 👍

Aksine commented 3 months ago

Hello, is there any update on fixing this issue ?

ytsarev commented 3 months ago

Hi, we haven't implemented it yet. I will make sure we will discuss it on the next community meeting. Thanks for bringing it up

Aksine commented 2 months ago

Thank you for your prompt response, i'm looking forward this feature implemented !!