Drain is an operational procedure used when stopping or detaching a server or worker. It stops accepting new work and lets only the processing already in progress finish.
For an HTTP server, drain means stopping new requests from entering and then waiting for existing connections or in-flight requests. In Kubernetes, the term often appears in the flow where readiness is dropped to remove the instance from endpoints before moving on to graceful shutdown.
Typical use cases
- Just before a server restart or rolling update
- Before stopping a queue worker
- When removing a node behind a load balancer
Notes
Drain is not an immediate stop. It is a phase for backing out without disrupting work that is already running. Its goal is different from forced termination.
hsb.horse