<p>I'm new to k8s. I want to specify my own change cause with rollouts. I know I can use the --record:</p>

<pre><code>kubectl set image deployment/tomcat-deployment tomcat=tomcat:9.0.1 --record
</code></pre>

<p>But I'd like to specify my own change cause (e.g. "Update to Tomcat 9.0.1"</p>

<p>I tried this:</p>

<p><code>kubectl annotate deployment tomcat-deployment kubernetes.io/change-cause='Tomcat9.0.1</code>'</p>

<p>but it changes the change cause the whole kubectl annotate command above</p>

<p>is there a way to do this?</p>

<p>Thanks</p>

<p>Mark</p>

mark1234
<p>There is no K8s tool to help you do this. If you want to add annotations to keep the track of what you are doing to can do it through patches as follows:</p>

<pre><code>kubectl patch RESOURCE RESOURCE_NAME  --patch '{"metadata": {"annotations": {"my-annotation-key": "my-annotation-value"}}}'
</code></pre>

<p>So, if you would want to add an annotation to a deployment, you would do:</p>

<pre><code>kubectl patch deployment tomcat-deployment --patch '{"metadata": {"annotations": {"tomcat-deployment kubernetes.io/change-cause": "Tomcat9.0.1"}}}'
</code></pre>

<p>Now, I don't think this is a good approach. I personally would never do this. The best way may be would be to have a CI/CD implemented (jenkins, ansible) and keep the track through commits.</p>
