-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Configure proxy container for graceful termination. (#425)
Add the following configuration to the workload pods so that the proxy can gracefully exit when the main container is done. Configure the proxy container to exit 0 when it is terminated. Send a SIGTERM to the proxy container. We want the proxy to exit with code 0, indicating a clean termination. Without this change the proxy container would exit with exit code 140 (meaning terminated), which would cause kubernetes to report the pod as "exited in an error state." Configure a workload lifecycle handler so that kubernetes calls GET /quitquitquit before terminating the proxy container. This should give the proxy container the chance to exit gracefully before kubernetes sends a SIGTERM to the proxy process. Always enable the /quitquitquit proxy api. Always set the CSQL_QUIT_URLS environment variable to a space-separated list of proxy quitquitquit urls. This way, when the main workload container is ready to exit, it can on workload pods. When a job or cronjob's main process is done, that container can iterate over ``` echo Starting job # execute the job process run_job # Tell proxy containers to shut down gracefully for url in $CSQL_QUIT_URLS ; do wget --post-data '' $url done ``` Fixes #361
- Loading branch information
Showing
3 changed files
with
168 additions
and
15 deletions.
There are no files selected for viewing
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
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
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