1

Is there any way to control rolling upgrades? I want my pods to not be brought down until a condition is met, such as a script returning a zero value.

For example, each VM in my cluster contains only one pod. I have a script on each VM monitoring a port range, say 1000 - 2000. When I update the image or change an environment variable in the manifest and a rolling upgrade kicks off, I want Kubernetes to only bring down a pod if my script returns that none of the ports in the range are being used.

bitscuit
  • 976
  • 1
  • 11
  • 26
  • _I want my pods to not be brought down until a condition is met, such as a script returning a zero value_ sounds suspiciously like you don't actually want a _rolling_ update -- you want to just deploy the new Pods and the old ones will exit when they see fit; can you help clarify in what exact way the RC is not behaving as you wish? – mdaniel Feb 02 '18 at 05:31
  • _I have a script on each VM monitoring a port range, say 1000 - 2000._ is also kind of weird; are you using `hostNetworking: true` and exposing the Pods directly on the host? That's the only reason I can think of that would cause the Pods and the host VM to have any relationship – mdaniel Feb 02 '18 at 05:32
  • @MatthewLDaniel Yes, hostNetworking is set to true. I want the rolling update functionality, that is k8s will automatically remove pods and deploy new ones when the image or spec changes, but I need k8s to only remove the pods under a custom condition rather than whenever it decides to. – bitscuit Feb 02 '18 at 15:24

0 Answers0