Skip to content

Support for multiple networks #18

@karolz-ms

Description

@karolz-ms

Motivation

The purpose of this feature is to allow for modeling of applicatons that span multiple networks. This allows to cleanly solve existing problems with non-uniform networks, and opens up new possibilities for modeling more complex cloud application topologies.

Existing problems include

  1. Handling container networks. We do not have a clean way to model the fact that Executables and Containers need to be addressed differently depending on what network (host vs container) the client vs the server are connected to. In some configurations (vanilla Docker, not "desktop" products) container-to-host communication is not possible at all.

  2. Handling cloud development environment like GH codespaces. The problem with those is that there is a difference between the "application host" where the application workload runs vs "developer hsot" where user browser and some other tools run. Intra-app traffic can use direct "localhost" addressing, but everything coming from developer host needs proxying/tunneling and different addressing. Again, we do not have a clean way to model that.

  3. Services can request binding to pseudo-addresses such as localhost, 0.0.0.0 (IPv4 "all available interfaces") or [::] (IPv6 "all available interfaces"). With Service spec having a single EffectiveAddress property, it does not allow us to properly report what addresses a Service is actually using once it completes network binding using a pseudo-address. Nor is it possible to smoothly handle the situation when the client requests specific port, but only some interfaces have that port available and others don't.

Design Outline

  1. We introduce a new Network DCP primitive that allows us to model networks explicitly.
  2. Endpoints become Network-specific (are associated with one or more networks).
  3. Executables and Containers become attached to one or more Networks.
    • A client (Executable or Container) can only reach a Service if that Service has an Endpoint on the Network the client is connected to.
  4. A new Gateway concept models facility for communication between networks that require addressing changes and/or traffic proxying.
    • Gateway controllers are responsible for setting up proxies and creating (endpoints) Endpoints that represent services that are not directly reachable by clients on different networks.
    • "Setting up proxies" might mean literally running proxy/tunnel software, or might involve detection/leveraging a proxy/tunnel that a developer has pre-configured outside Aspire.
  5. Services that exist before application is started ("external services") can be modeled using existing Service and Endpoint objects.
  6. The existing EffectiveAddress Service spec property is deprecated and replaced with EffectiveAddresses list that holds (address, port) tuples, solving problem 3. In the same work item, the existing AddressAllocationMode should be simplified and stop accepting modes that are identical to setting the Address spec property explicitly to some pseudo-address value (localhost, 0.0.0.0 or [::]). That would leave only Proxyless and likely AllInterfaces with its semantics of "bind to all interfaces but using single IP protocol version, i.e. IPv4 or IPv6).

Additional notes

Aspire will be the first consumer of this feature. We should prototype it together with corresponding Aspire model API and dashboard changes, to ensure that resulting set of APIs makes sense for all Aspire deployment environments.

This feature set involves several breaking changes. It probably makes sense to introduce a new version of the DCP API to accommodate all the changes, with all resources living in a namespace.

Metadata

Metadata

Assignees

Labels

area-orchestratorAffects DCP usage in Microsoft AspireenhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions