After some intense google and SO search i couldn't find any document that mentions both rolling update and set image, and can stress the difference between the two.
Can anyone shed light? When would I rather use either of those?
EDIT: It's worth mentioning that i'm already working with deployments (rather than replication controller directly) and that I'm using yaml configuration files. It would also be nice to know if there's a way to perform any of those using configuration files rather than direct commands.
In older k8s versions the ReplicationController
was the only resource to manage a group of replicated pods. To update the pods of a ReplicationController
you use kubectl rolling-update
.
Later, k8s introduced the Deployment
which manages ReplicaSet
resources. The Deployment
could be updated via kubectl set image
.
Working with Deployment
resources (as you already do) is the preferred way. I guess the ReplicationController
and its rolling-update
command are mainly still there for backward compatibility.
UPDATE: As mentioned in the comments:
To update a Deployment
I used kubectl patch
as it could also change things like adding new env vars whereas kubectl set image
is rather limited and can only change the image version. Also note, that patch
can be applied to all k8s resources and is not restricted to be used with a Deployment
.
Later, I shifted my deployment processes to use helm - a really neat and k8s native package management tool. Can highly recommend to have a look at it.