You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
0 commit comments