<p>I have a kubernetes cluster, and I am wondering how (best practice) to update containers.  I know the idea is to tear down the old containers and put up new ones, but is there a one-liner I can use, do I have to remove the replication controller or pod(s) and then spin up new ones (pods or replicaiton controllers)?  With this I am using a self hosted private library that I know I have to build from the Dockerfile and the push to anyway, this I can automate with gulp (or any other build tool), can I automate kubernetes update/tear down and up?</p>

<p>Kubectl can automate the process of rolling updates for you. Check out the docs here:
<a href="https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/kubectl_rolling-update.md" rel="nofollow">https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/kubectl_rolling-update.md</a></p>

<p>A rolling update of an existing replication controller <code>foo</code> running Docker image <code>bar:1.0</code> to image <code>bar:2.0</code> can be as simple as running
<code>kubectl rolling-update foo --image=bar:2.0</code>.</p>
