1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-07 00:48:01 +01:00
Files
openshift-docs/modules/deployments-graceful-termination.adoc
2019-05-13 13:57:48 +10:00

24 lines
1.1 KiB
Plaintext

// Module included in the following assemblies:
//
// * applications/deployments/route-based-deployment-strategies.adoc
[id="deployments-graceful-termination_{context}"]
= Graceful termination
{product-title} and Kubernetes give application instances time to shut down
before removing them from load balancing rotations. However, applications must
ensure they cleanly terminate user connections as well before they exit.
On shutdown, {product-title} sends a `TERM` signal to the processes in the
container. Application code, on receiving `SIGTERM`, stop accepting new
connections. This ensures that load balancers route traffic to other active
instances. The application code then waits until all open connections are closed
(or gracefully terminate individual connections at the next opportunity) before
exiting.
After the graceful termination period expires, a process that has not exited is
sent the `KILL` signal, which immediately ends the process. The
`terminationGracePeriodSeconds` attribute of a Pod or Pod template controls the
graceful termination period (default 30 seconds) and may be customized per
application as necessary.