Kubernetes in production. Problems with a working pod

10/4/2018

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.

Thanks!

-- Sermanes
kubernetes

1 Answer

10/4/2018

If something is dropping your sessions it would be a bug. Generally speaking, if you have a 'Service' that forwards to multiple backend replicas when you do an update it happens one replica at a time. Something like this:

  • New pod created.
  • Wait for the new pod to be ready and serviceable.
  • Put the new pod in the Service pool.
  • Remove the old pod from the Service pool
  • Drain old pod. Don't take any more incoming connections and wait for connections to close.
  • Take down the old pod.
-- Rico
Source: StackOverflow