Skip to main content

Kubernetes in production. Problems with a working pod [Resolved]

I have a question with kubernetes when deploying a new version.

My yaml configuration of Kubernetes has the RollingUpdate strategy. The problem comes when it comes to changing versions this way. If I have a php-fpm that is performing an action, does that action get lost? In case it is just changing that pod to the new version.

My main question is if kubernetes with this strategy takes into consideration if the pod is being used and if so, if it waits until he finishes what it has to do and changes it.


Question Credit: Sermanes
Question Reference
Asked October 10, 2018
Posted Under: Network
1 Answers

To expand on what @Fady said above, for those that still may be curious.

By calling the PreStop container hook you can close all loose ends before the container is terminated. From the documentation "PreStop: This hook is called immediately before a container is terminated." [1]

The PreStop hook can execute a specific command(s) or executes an HTTP request against an endpoint on the container. Additionally, the standard grace period is 30 seconds. You can, however, pass a custom time by appending --grace-period=<seconds>. [2]



credit: Michael A
Answered October 10, 2018
Your Answer