Sobes.tech
Middle+

How to update the application so that only one new pod is raised, and the process stops until manual intervention?

sobes.tech AI

Answer from AI

To update an application in Kubernetes so that only one new pod is created and the process stops until manual intervention, you can use the update strategy with the parameters maxUnavailable and maxSurge in Deployment.

For example, set:

strategy:
  type: RollingUpdate
  rollingUpdate:
    maxSurge: 1
    maxUnavailable: 0

This allows up to one extra pod to be created beyond the desired number, without killing the old ones.

To stop the update process after one new pod is launched, you can manually pause the Deployment:

kubectl rollout pause deployment/<deployment-name>

After that, the update will not continue until you execute:

kubectl rollout resume deployment/<deployment-name>

The sequence of actions is:

  1. Start the update with the desired parameters.
  2. After one new pod appears — execute kubectl rollout pause.
  3. Check the status and intervene manually if necessary.

This allows controlling the update process and avoiding the simultaneous creation of multiple new pods.