Reputation: 1
Question: When we deploy the service with k8s, using a blue-green deployment, will the last request made (to the old container) be cut off during container switching? The old container may have been taken offline and the process inside killed before the request came back.
Can anyone help with this question? That's one thing I didn't think through
Tell me what you think. I think the flow of requests will be cut off But I don't know if that's true
Upvotes: 0
Views: 130
Reputation: 158705
This sequence is described in a Termination of Pods section in the Kubernetes documentation.
Your application process is sent SIGTERM
to trigger an orderly shutdown, and simultaneously removed as an endpoint from its Service. At that point the application can do whatever it needs to, including handling running requests, but it will not receive new requests. If the process does not exit on its own (normally within 30 seconds) then the cluster will use SIGKILL
to forcibly end the process.
This means it's up to your application or framework to handle the shutdown signal. If it handles the signal and requests are executed promptly, then requests will not be interrupted. If it does not handle the signal and just exits, or if it takes excessively long to handle individual requests, then requests could be interrupted.
Upvotes: 0