Azure / dev-spaces

Azure Dev Spaces is retired, please use Bridge to Kubernetes.
MIT License
136 stars 307 forks source link

AZDS Connect - access to services from other namespaces #223

Open skwasiborski opened 4 years ago

skwasiborski commented 4 years ago

It seems that when using AZDS Connect local process has only access to services from the same namespace and to kubernetes.default service. It would be beneficial if the local process would have access to all services in remote cluster. We use namespaces more or less as application boundary so cross namespace calls are not so rare.

For example this is C:\Windows\System32\Drivers\etc\hosts from my debug session that was performed on cluster with dozens of services (you can see that only services from namespace voting-dev + kubernetes.default are added):

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#       127.0.0.1       localhost
#       ::1             localhost

# Added by Docker for Windows
10.34.64.208 host.docker.internal
10.34.64.208 gateway.docker.internal
# End of section
# Added by Azure DevSpaces
127.1.1.72 kubernetes.default.svc.cluster.local
127.1.1.72 kubernetes.default
127.1.1.72 kubernetes
127.1.1.71 voting-app.voting-dev.svc.cluster.local
127.1.1.71 voting-app.voting-dev
127.1.1.71 voting-app
127.1.1.70 voting-api.voting-dev.svc.cluster.local
127.1.1.70 voting-api.voting-dev
127.1.1.70 voting-api
# End of section
skwasiborski commented 4 years ago

I found that one can workaround this limitation by adding azds-local.env file to root dir of your project with following content:

DOCS_SERVICE_HOST=${services.docs.docs-prod}

where docs is the name of the service one wants ta access and docs-prod is the namespace.

I understand that this is a new product but it would be nice if there would be some docs for the azds-local.env file

xinyanmsft commented 4 years ago

thanks for the feedback. Currently the documentation for azds-local.env file is at the end of https://docs.microsoft.com/en-us/azure/dev-spaces/how-to/connect. Can you explain a little what kind of documentation do you want? A 'how-it-works' deeper dive, or more of 'how-to-' style? thanks!

skwasiborski commented 4 years ago

At this stage it would be great to just have all the possible options described or even an example file with all options used. At least for me it was not clear that I can use services.mysvc.namespace syntax.

xinyanmsft commented 4 years ago

thank you, we will take this feedback and improve our documentation.