kubectl rolling-update having a downtime of few seconds

7/20/2015

I'm using Google Container Engine with a cluster using Kubernetes 0.20.2.

In this cluster, I have 1 replication controller (2 replicas) and 1 service with a spec type defined to LoadBalancer (basic setup).

Everything is working fine here; Then I want to roll update to a different image using the kubectl command:

kubectl rolling-update my-rc \
  --image=gcr.io/project/gcloudId:my-image-updated \
  --update-period=0m

About what I understood, running this command should take care of having a zero-downtime. Unfortunately, I have been doing some test using the curl command in a loop, and I still have a downtime of a few seconds. Any ideas why this is happening?

-- Etienne Tremel
gcloud
google-kubernetes-engine
kubernetes

1 Answer

7/20/2015

The --update-period flag tells Kubernetes how long to wait between each pod that it's rolling an update to. With the update period set to 0, Kubernetes will update all pods at once, causing a short period of unavailability while the new pods start up. You should set --update-period to be at least as long as it takes each of your pods to initialize. The default value (1 minute) should be fine for almost all cases if you don't want to have to think about it.

-- Alex Robinson
Source: StackOverflow