microsoft / mindaro

Bridge to Kubernetes - for Visual Studio and Visual Studio Code
MIT License
307 stars 106 forks source link

Host file entries not resolvable due to FQDN #150

Open draese opened 3 years ago

draese commented 3 years ago

Describe the bug

Every service that I proxy out to my local development machine gets an entry into the /etc/hosts (on my macos machine) but the entry is always fully qualified:

Here an example:

Added by Bridge To Kubernetes

127.1.1.3 kafka-test.kafka.svc.cluster.local 127.1.1.2 productpage.default.svc.cluster.local

Most of my deployments would reference a service w/o the "svc.cluster.local" qualifier, here for example kafka-test or kafka-test.kafka (where kafka is the namespace). Using this local short form, services are not resolved as my development machine (macos) doesn't belong to the svc.cluster.local domain. Just like for the debugged services, additional unqualified entries should be added to the host file.

To Reproduce Proxy a cluster service to local development machine via KubernetesLocalProcessConfig.yaml.

pragyamehta commented 3 years ago

Hi @draese Thanks for opening this issue! I have opened a bug to investigate this on our end and will get back to you soon!

pragyamehta commented 3 years ago

Hi @draese Can you update to the latest version of VSCode extension and try again? We just released today morning and we added the support for headless services for non-isolated scenarios. If you still face this issue, please send over the latest cli, library and endpoint manager logs from $TMPDIR/Bridge To Kubernetes

draese commented 3 years ago

Tried with latest (to me) available v1.0.120210401:

If I try to resolve "kafka-test-headless.kafka, it is not resolvable. I have to use the FQDN with the svc.cluster.local suffic. The host file still contains only the FQDN entry: 127.1.1.14 kafka-test-headless.kafka.svc.cluster.local

It would need to change to 127.1.1.14 kafka-test-headless.kafka.svc.cluster.local kafka-test-headless.kafka.svc.cluster kafka-test-headless.kafka.svc kafka-test-headless.kafka to resolve also using only the svcname.namespace format.

amsoedal commented 3 years ago

Hi @draese, I just wanted to confirm that the headless service is in a different namespace from the service you're currently debugging?

draese commented 3 years ago

Hi @amsoedal, yes - these are in different namespaces (service in namespace kafka, client in namespace events. (I am aware, that I could be more creative about my naming here ;-) )

amsoedal commented 3 years ago

@draese OK cool thanks :) I'll need to fix this. Will update the thread once I have an ETA

zivfuture commented 2 years ago

@amsoedal hi, I have the same issue, any update? thanks!