Fix install awx-task > init-database container if it needs to be stopped by kubernetes #1986
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
If the database setup is in some way wrong, the
wait-for-migrations
command inside theinit-database
container runs infinitely and can't be stopped by kubernetes. The "PID 1" problem.ISSUE TYPE
ADDITIONAL INFORMATION
The
wait-for-migrations
command needs to be started bydump-init
command. Thedump-init
command is the default ENTRYPOINT of the used container image. See: https://github.com/ansible/awx/blob/devel/tools/ansible/roles/dockerfile/templates/Dockerfile.j2#L321command:
overwrites the ENTRYPOINT,args:
append to the ENTRYPOINTOtherwise the
init-database
can't be stopped by kubernetes because the PID 1 ignores all SIGTERM / SIGKILL signals.