<p>Currently, I'm updating the version of an image to be deployed using the <code>set image</code> command:</p>

<pre><code>$ kubectl set image deployments myapp myapp=caarlos0/myapp:v2
</code></pre>

<p>And then I watch the changes with <code>rollout status</code>:</p>

<pre><code>$ kubectl rollout status deployments myapp
</code></pre>

<p>The problems I found while doing it this way are:</p>

<ul>
<li><p>some times, it seems that a deployment is not triggered at all, and when I call <code>rollout status</code>, I get errors like this:</p>

<pre><code>$ kubectl rollout status deployments myapp
Waiting for deployment spec update to be observed...
error: timed out waiting for the condition
</code></pre></li>
<li><p>The <code>rollout history</code> command show the <code>CHANGE-CAUSE</code> as <code>&lt;none&gt;</code>, and I can't find a way of making it show anything useful in there.</p></li>
</ul>

<p>So, am I doing something wrong (or not in the best way)? How can I improve this workflow?</p>

<p>You're doing the right thing. Within the <a href="https://kubernetes.io/docs/user-guide/deployments/#updating-a-deployment" rel="noreferrer">Updating a deployment</a> documentation you'll find this:</p>

<blockquote>
  <p>Note: a Deployment’s rollout is triggered if and only if the Deployment’s pod template (i.e. <code>.spec.template</code>) is changed, e.g. updating labels or container images of the template. Other updates, such as scaling the Deployment, will not trigger a rollout.</p>
</blockquote>

<p>So running <code>$ kubectl set image deployments/app &lt;image&gt;</code> will only trigger a rollout if <code>&lt;image&gt;</code> is not already configured for your containers.</p>

<p>The change cause can be used to record the command which was used to trigger the rollout by appending the <code>--record</code> flag to your commands (see <a href="https://kubernetes.io/docs/user-guide/deployments/#checking-rollout-history-of-a-deployment" rel="noreferrer">Checking rollout history</a>).</p>
