Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECS Agent dynamic host port assignment #3601

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

chienhanlin
Copy link
Contributor

@chienhanlin chienhanlin commented Mar 4, 2023

Summary

This PR is to merge the feature branch feature/dynamicHostPortAssignment into the dev branch.

Following changes, listing from the oldest to the latest, will be introduced to the dev branch after this PR is merged:

  1. [DHPA] Add GetHostPort() and update unit tests #3570
  2. [DHPA] Upudate dockerPortMap() in task.go with dynamic host port range support - part 1 #3584
  3. [DHPA] Upudate dockerPortMap() in task.go with dynamic host port range support - part 2+ #3589
  4. [DHPA] Upudate dockerPortMap() in task.go with dynamic host port range support - part 2+ #3589
  5. [DHPA] Refactor buildPortMapWithSCIngressConfig() in task.go #3600

Implementation details

Please find details in previous PRs listed in the "Summary" section.

Testing

Please find details in previous PRs listed in the "Summary" section.

New tests cover the changes: yes

Description for the changelog

[Enhancement] Support dynamic host port range assignment for singular ports. The dynamic host port range can be configured with ECS_DYNAMIC_HOST_PORT_RANGE in ecs.config; if there is no user-specified ECS_DYNAMIC_HOST_PORT_RANGE, ECS Agent will assign host ports within the default port range, based on platform and Docker API version, for containers that do not have user-specified host ports in task definitions.

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

1. Add GetHostPort() and update unit tests aws#3570

2. Upudate dockerPortMap() in task.go with dynamic host port range support part 1 aws#3584

3. Upudate dockerPortMap() in task.go with dynamic host port range support part 2 aws#3589

4. Validate the host port/host port range found by ECS Agent before returning it aws#3589

5. Refactor buildPortMapWithSCIngressConfig() in task.go aws#3600
@chienhanlin chienhanlin marked this pull request as ready for review March 4, 2023 00:48
@chienhanlin chienhanlin requested a review from a team as a code owner March 4, 2023 00:48
@chienhanlin chienhanlin merged commit 5cf4103 into aws:dev Mar 6, 2023
@chienhanlin chienhanlin deleted the feature/dynamicHostPortAssignment branch March 6, 2023 21:59
@mye956 mye956 mentioned this pull request Mar 7, 2023
@ubhattacharjya ubhattacharjya mentioned this pull request Mar 13, 2023
chienhanlin added a commit to chienhanlin/amazon-ecs-agent that referenced this pull request Mar 15, 2023
ECS_DYNAMIC_HOST_PORT_RANGE supports both container port range and singular container ports use cases,
starting from ECS Agent version 1.70.0. Details of this change are available in aws#3601.
chienhanlin added a commit to chienhanlin/amazon-ecs-agent that referenced this pull request Mar 15, 2023
ECS_DYNAMIC_HOST_PORT_RANGE supports both container port range and singular container ports use cases,
starting from ECS Agent version 1.70.0. Details of this change are available in aws#3601.
chienhanlin added a commit that referenced this pull request Mar 16, 2023
ECS_DYNAMIC_HOST_PORT_RANGE supports both container port range and singular container ports use cases,
starting from ECS Agent version 1.70.0. Details of this change are available in #3601.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants