Allow disabling proxy for persistent lifetime container endpoints#7232
Merged
davidfowl merged 11 commits intomicrosoft:mainfrom Jan 28, 2025
Merged
Allow disabling proxy for persistent lifetime container endpoints#7232davidfowl merged 11 commits intomicrosoft:mainfrom
davidfowl merged 11 commits intomicrosoft:mainfrom
Conversation
danegsta
commented
Jan 24, 2025
davidfowl
reviewed
Jan 24, 2025
Contributor
|
@JamesNK moved stuff around 😄 |
davidfowl
reviewed
Jan 24, 2025
f55adeb to
9e040d5
Compare
… timing of when some events fire.
danegsta
commented
Jan 25, 2025
danegsta
commented
Jan 25, 2025
danegsta
commented
Jan 25, 2025
danegsta
commented
Jan 25, 2025
danegsta
commented
Jan 25, 2025
Member
Author
|
/AzurePipelines run |
|
Pull request contains merge conflicts. |
3 tasks
davidfowl
approved these changes
Jan 28, 2025
Contributor
|
@danegsta good discussion and tradeoffs 😄. Can you make sure we document and update the relevant issue in 9.1? |
This was referenced Jan 28, 2025
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The endpoint port assignment for persistent lifetime containers can be confusing due to Aspire creating proxied endpoints for all resources by default. This means that the ports reported for persistent containers in the Aspire dashboard are only valid while the App Host is running and the only way to access persistent containers while the App Host is not running is to inspect them and figure out what random port the container endpoint was exposed on.
This PR adds a new opt-in (and experimental) resource builder API
.WithEndpointProxySupport(false)that can disable all proxies for the endpoints of a given container resource. In the long run we'd like to make this the new default behavior for persistent containers, but there is additional service discovery work that will need to happen before we can safely make proxy-less persistent containers the default behavior.The main thing to be aware of when applying
.WithEndpointProxySupport(false)to a container resource is that by default Aspire will attempt to use the (internal container) target port as the host port to expose the service. This significantly increases the risk of port conflicts or other issues allocating ports with the default behavior endpoint behavior. It's recommended that any resources being run with endpoint proxies disabled has explicit (unique) host ports set for all its endpoints.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?breaking-changetemplate):doc-ideatemplate):