gefyrahq / gefyra

Blazingly-fast :rocket:, rock-solid, local application development :arrow_right: with Kubernetes.
https://gefyra.dev
Apache License 2.0
692 stars 28 forks source link

Support resolution of DNS matching a container in cluster #513

Closed Bengreen closed 7 months ago

Bengreen commented 11 months ago

What is the new feature about?

when I use gefyra the DNS resolution solves for the current namespace but does not have the additional domains enabling resolution on services in other namespaces.

When testing if I provide the name as a FQDN then this work so it means the DNS resolution is working but the domains to search are missing.

Upon inspection of the /etc/resolv.conf file I see the following

search dev.svc.cluster.local
nameserver 127.0.0.11
options ndots:0

When I try to check a service in dev2 NS then it will fail eg.

curl http://minio.dev2

When I look at a typical container in the cluster it is missing the following search domains: svc.cluster.local cluster.local k8s

I manually updated /etc/resolv.conf to the following:

search dev.svc.cluster.local svc.cluster.local cluster.local k8s
nameserver 127.0.0.11
options ndots:0

After making the above update the curl now works

Why would such a feature be important to you?

yes it makes the gefyra container match a natural k8s pod with dns resolution across namespaces.

Anything else we need to know?

No response

Bengreen commented 11 months ago

PR proposed in #514

Schille commented 11 months ago

Hi @Bengreen Thank you for your suggestion and your contribution. I will have a look and let you know.