Termination requires coordinating traffic withdrawal, application shutdown and a bounded grace period. In-flight requests need an explicit completion policy.
Before you start
You should understand Pods, Deployments and Services. Read desired configuration separately from observed cluster state. Use a development cluster when trying changes, and inspect events and status rather than assuming that an accepted manifest means the workload is ready to serve traffic.
The practical goal is to reason through this situation: An app stops new work and drains existing requests before exiting. Read the walkthrough first, then try the interview exercise before opening its answer. The important part is explaining the decision and its consequences, rather than remembering a definition alone.
Step-by-step walkthrough
Step 1: Withdraw new work
Coordinate readiness removal and traffic propagation with application shutdown.
Step 2: Drain active operations
Complete owned requests within the permitted grace period.
Step 3: Use a real deadline
A sleep hook alone does not prove connections are drained.
Worked scenario
An app stops new work and drains existing requests before exiting.
A rollout sends termination while a long request is active. The application stops admitting new work but lets that request finish within its deadline. Traffic systems may take time to observe withdrawal, so design and test the complete sequence rather than assuming the first signal immediately stops every request.
Common mistake
A long sleep hook without actual draining can delay termination while losing requests.
Verify the behavior
Send continuous traffic during replacement and inspect failures, completion and forced termination.
Interview exercise
Test graceful replacement.
Answer and reasoning
Send continuous traffic during a rollout and verify readiness removal, request completion and deadline behavior.
Continue learning
Compare the scenario with the Kubernetes interview questions and test your understanding with the Kubernetes MCQs. For terminology and implementation details, consult the reference material.