<p>I've seen:</p>

<pre><code>kubectl set image deployment/nginx-deployment nginx=nginx:1.16.1 --record
</code></pre>

<p>What is <code>--record</code> doing here? I've tried a deployment with it and without it + scaling/image replacing (set image) + checking rollout status etc but I dont see any difference.</p>

<p>I'm probably missing something here.</p>

DenCowboy
<p>It'll record your changes for a given deployment.</p>

<pre><code>kubectl rollout history deployment.v1.apps/nginx-deployment
deployment.apps/nginx-deployment 
REVISION  CHANGE-CAUSE
1         &lt;none&gt;
2         kubectl set image deployment/nginx-deployment nginx=nginx:1.16.1 --record=true
</code></pre>

<p>Later you can rollback using revision number if needed. </p>

<blockquote>
  <p>Note: You can specify the --record flag to write the command executed
  in the resource annotation kubernetes.io/change-cause. The recorded
  change is useful for future introspection. For example, to see the
  commands executed in each Deployment revision.</p>
</blockquote>

<p>Refer <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">here</a></p>
