<p>Our current CI deployment phase works like this:</p>

<ol>
<li>Build the containers.</li>
<li>Tag the images as <code>"latest"</code> and <code>&lt; commit hash &gt;</code>.</li>
<li>Push images to repository.</li>
<li>Invoke rolling update on appropriate RC(s).</li>
</ol>

<p>This has been working great for RC based deployments, but now that the <code>Deployment</code> object is becoming more stable and an underlying feature, we want to take advantage of this abstraction over our current deployment schemes and development phases.</p>

<p>What I'm having trouble with is finding a sane way to automate the update of a <code>Deployment</code> with the CI workflow. What I've been experimenting with is splitting up the git repo's and doing something like:</p>

<ol>
<li>[App Build] Build the containers.</li>
<li>[App Build] Tag the images as <code>"latest"</code> and <code>&lt; commit hash &gt;</code>.</li>
<li>[App Build] Push images to repository.</li>
<li>[App Build] Invoke build of the app's <code>Deployment</code> repo, passing through the current commit hash.</li>
<li>[Deployment Build] Interpolate manifest file tokens (currently just the passed commit hash e.g. <code>image: app-%%COMMIT_HASH%%</code>)</li>
<li>[Deployment Build] Apply the updated manifest to the appropriate <code>Deployment</code> resource(s).</li>
</ol>

<p>Surely though there's a better way to handle this. It would be great if the <code>Deployment</code> monitored for hash changes of the image's "latest" tag...maybe it already does? I haven't had success with this. Any thoughts or insights on how to better handle the deployment of <code>Deployment</code> would be appreciated :)</p>

<p>The <code>Deployment</code> only monitors for pod template (<code>.spec.template</code>) changes. If the image name didn't change, the <code>Deployment</code> won't do the update. You can trigger the rolling update (with <code>Deployment</code>s) by changing the pod template, for example, label it with commit hash. Also, you'll need to set <code>.spec.template.spec.containers.imagePullPolicy</code> to <code>Always</code> (it's set to <code>Always</code> by default if <code>:latest</code> tag is specified and cannot be update), otherwise the image will be reused. </p>
