Can .spec.replicas count can be exceeded for a deployment

10/7/2016

Just wanted to double check if there is a situation where the actual number of serving replicas can exceed the number defined in .spec.replicas for a deployment.

-- Evgeny Minkevich
google-kubernetes-engine
kubernetes

1 Answer

10/7/2016

Based on your strategy, while the rollout is in progress, you can have more pods than number of replicas.

.spec.strategy.rollingUpdate.maxSurge controls how many extra pods may be spun up during the deployment.

http://kubernetes.io/docs/user-guide/deployments/#strategy

Once the rollout is complete, the desired and current number of replicas will match.

-- manojlds
Source: StackOverflow