-
Notifications
You must be signed in to change notification settings - Fork 616
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
Add ecs-agent container healthcheck localhost ip override env var #2834
Merged
Conversation
This file contains 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
sparrc
reviewed
Mar 18, 2021
sparrc
reviewed
Mar 18, 2021
there are some existing unit tests for the healtcheck, does it make sense to add a test or two for this? https://github.com/aws/amazon-ecs-agent/blob/90ccb1d4313eb853691465197d324cd76404b1cc/agent/app/healthcheck_test.go |
fierlion
force-pushed
the
fierlion/healthcheck_override
branch
from
March 18, 2021 20:03
8df1a05
to
439923c
Compare
chienhanlin
reviewed
Mar 18, 2021
angelcar
reviewed
Mar 18, 2021
sparrc
previously approved these changes
Mar 18, 2021
fierlion
force-pushed
the
fierlion/healthcheck_override
branch
from
March 18, 2021 22:01
439923c
to
1230b58
Compare
angelcar
previously approved these changes
Mar 18, 2021
sparrc
reviewed
Mar 18, 2021
fierlion
force-pushed
the
fierlion/healthcheck_override
branch
from
March 19, 2021 16:37
1230b58
to
9187b8d
Compare
sparrc
approved these changes
Mar 19, 2021
angelcar
approved these changes
Mar 19, 2021
sparrc
pushed a commit
to sparrc/amazon-ecs-agent
that referenced
this pull request
Mar 26, 2021
fierlion
added a commit
to fierlion/amazon-ecs-agent
that referenced
this pull request
Apr 28, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This change allows IP configuration for the ecs-agent container's docker healthcheck localhost IP to address a specific case where the customer has overridden the
localhost
ip explicitly.Implementation details
Currently, as the agent container is launched in host network mode, when the localhost inside the scratch-based agent container does not resolve to that the same IP, the agent container healthcheck will always return 'unhealthy'.
This change allows the localhost IP to be explicitly set to either the host localhost ip (usually 127.0.0.1) or otherwise based on DNS resolution requirements.
Testing
I built the agent and tested the following manually:
start agent the environment variable unset -- agent container became healthy
set ECS_AGENT_HEALTHCHECK_HOST=localhost -- agent container became healthy
set ECS_AGENT_HEALTHCHECK_HOST=127.0.0.1 -- agent container became healthy
set ECS_AGENT_HEALTHCHECK_HOST=80.80.80.80 -- agent container became unhealthy.
New tests cover the changes: no
Description for the changelog
Add configurable agent healthcheck localhost ip env var.
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.