Ryan
Ryan

Reputation: 4414

Service Fabric Containers - Cannot Access Service within Cluster

I have a Windows Container deployed locally on my development VM that just contains a simple MVC app to test functionality. I can deploy it fine and I get the Uri for the service at http://localhost:30001/ which works fine when I navigate to that URL from my host but I cannot access it when I'm within my VM that has the container.

Laptop (Can access URL from here)

^

Windows Server 2016 VM (cannot access from here)

^

Container with manually packaged MVC app using the microsoft/aspnet image

After I've deployed the SF application I can access the MVC app via the assigned ip and port from Docker (via using docker inspect) also, I've specified that port 8745 within my AppManifest.xml

When I spin up one of the example applications such as the Alphabet example I'm able to access the endpoint within the VM. Is there something to do with Containers that doesn't allow this? This is a big problem when making a Gateway Stateless service as the partition resolver give me the URL that isn't accessible within the cluster.

EDIT: Forgot to mention that my firewall is also disabled inside my development VM.

Upvotes: 1

Views: 798

Answers (1)

LoekD
LoekD

Reputation: 11470

I think you're hitting this issue. You can't access containers running on localhost unless you use the Container ip address.

With the current release, you can't use http://localhost to browse your site from the container host. This is because of a known behavior in WinNAT, and will be resolved in future. Until that is addressed, you need to use the IP address of the container.

Upvotes: 1

Related Questions