How to update a set of pods running in kubernetes? -
what preferred way of updating set of pods (e.g. after making code changes & pushing underlying docker image docker hub) controlled replication controller in kubernetes cluster?
i can see 2 ways:
- deleting & re-creating replication controller manually
- using kubectl rolling-update
with rolling-update have change replication controller name. since i'm storing replication controller definition in yaml file , not generating manually, having change file push out code update seems bring bad habits alternating between 2 names replication controller (e.g. controllera , controllerb) avoid name conflict.
what better way?
you should use kubectl rolling-update
. added feature "simple rolling update" update image in replication controller without renaming it. it's last example shown in kubectl rolling-update
output:
// update pods of frontend changing image, , keeping old name $ kubectl rolling-update frontend --image=image:v2
this command supports recovery -- if cancel update , restart later, resume left off. though creates new replication controller behind scenes, @ end of update new replication controller takes name of old replication controller appears pure update rather switching entirely new replication controller.
Comments
Post a Comment