<p>When I am running the below command to record the change cause -</p>
<pre><code>kubectl set image deployment.v1.apps/deploy1 nginx=nginx:1.16.0 --record 
</code></pre>
<p>Then it is recording the change cause but showing that --record has been deprecated.</p>
<pre><code>Flag --record has been deprecated, --record will be removed in the future
deployment.apps/deploy1 image updated
</code></pre>
<p>And when I run the command <code>kubectl set image deployment.v1.apps/deploy1 nginx=nginx:1.16.0</code> without --record then it is not recording the change cause.</p>
<p>So my question is if the <code>--record</code> has been deprecated and with be removed in the future then what is easy alternative of that to record change? ( I mean to record the command using which I have done rollout ).</p>
<p>Thanks in advance.</p>

Arghya Roy
<p>Not sure if it's deprecated or will be fully.</p>
<p>You can use the <strong><a href="https://jamesdefabia.github.io/docs/user-guide/kubectl/kubectl_annotate/" rel="noreferrer">annotate</a></strong> to manage the history same way.</p>
<ol>
<li><p><strong>Create the deployment</strong></p>
<p>kubectl create deployment nginx --image=nginx:1.16.0 --replicas 1</p>
</li>
<li><p><strong>check the history</strong></p>
<p>kubectl rollout history deployment nginx</p>
</li>
<li><p><strong>update the image on deployment</strong></p>
<p>kubectl set image deployment nginx nginx=nginx:latest</p>
</li>
<li><p><strong>Annotate the deployment now and create the history</strong></p>
<p>kubectl annotate deployment nginx kubernetes.io/change-cause=&quot;version change to 1.16.0 to latest&quot; --overwrite=true</p>
</li>
<li><p><strong><strong>Check the history</strong></strong></p>
<p>kubectl rollout history deployment nginx</p>
</li>
</ol>
