<p>I have a Backend service which is deployed to Kubernetes.
Whenever I want to deploy I build my docker image, push it to the google docker registry with a tag (e.g. <code>1.1.0</code>) and update my deployment yaml.</p>

<p>However, updating this file and creating another commit is a PITA. Especially because I have a production and a staging environment (actually 2 namespaces)
I recently found out about ConfigMaps in Kubernetes.</p>

<p>So I would like to know if it is possible to store a value in a ConfigMap with the image tag and use it? I haven't found a way so far.</p>

<p>Are there any good alternatives so I don't have to store the information about the current release in git? What's the best practice here? Using <code>latest</code> tag I guess isn't.</p>

<p>I want to let my CI do the deployment whenever I push to master or development (I use gitlab CI), so any approach that is easy to do on the command line without a lot of <code>sed</code> would be appreciated.</p>

<p>A straightforward solution is to trigger a rolling update of your deployment by using <code>kubectl set image</code>:</p>

<pre><code>kubectl set image deployment/foobar &lt;container_name&gt;=&lt;new_image:new_tag&gt;
</code></pre>

<p>and you can use your git commit id as image tag.</p>
