Support for setting PIDs limit for ECS tasks #3923
Merged
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.
Summary
Note: This PR merges the feature branch to dev, see PR to feature branch for previous review: #3790
Adds a new agent configuration variable:
ECS_TASK_PIDS_LIMIT
This variable defaults to being unset, which results in the current behavior of no PID limit being set at the task level.
If the user sets this to a value 1 or more, then agent will set the pids.max pid limit cgroup parameter to the provided value, for the task-level cgroup for all ECS tasks that are launched on this container instance. Note that this limit is applied for the whole task, not per-container.
addresses aws/containers-roadmap#354 for the EC2 launch type.
Implementation details
Testing
Functionality was verified manually and unit tests were added in this PR. Functional tests will be added before merging to dev branch.
New tests cover the changes: yes
Description for the changelog
Enhancement: ECS_TASK_PIDS_LIMIT for setting the task-level PIDs limit.
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.