Rolling update using kube-client


#1

I’m struggling to find an example of performing a rolling update of a kubernetes deployment using client-go. Currently I scale to 0 and then back to 1 but that causes downtime.

I wonder if there is a way to trigger a rolling update. I have nothing to change in the deployment itself. All I need is to restart a pod so that it consumes an updated ConfigMap.

I have not found a direct way to initiate a rolling update rather than editing a deployment. But this does not work for me.


#2

It currently is not possible, and has been a long standing issue. There are some work arounds like hashing the configmap and adding it as a label or using ionotify to re-read the file, but no true native method of doing it.


#3

What Bob says is the right approach. However, note that you can do quick ugly hacks, like delete all pods with a label, they will be restarted and the new cm read, etc.