kubernates replace deployment sometimes doesn't work, rollout error

12/11/2017

We have a kubernetes deployment and on version release we build a new image and run:

kubectl replace -f deployment.yml

This is always the same deployment file except for the name of the image it uses. It usually works, but every once in a while it doesn't update the pod, Running describe on the deployment reveals there's no new replica set:

OldReplicaSets: appname-675551529 (1/1 replicas created)
NewReplicaSet:  <none>

and viewing rollout status Returns the following:

Waiting for deployment spec update to be observed...
Waiting for deployment spec update to be observed...
error: watch closed before Until timeout
-- L.S
kubernetes

1 Answer

3/27/2018

Did you tried to just Editing/Add the new Image to your Existing ReplicaSet ?

kubectl edit rs YourOldReplicaSetName
-- EngSabry
Source: StackOverflow