<p>Im not clear with the use of --record in kubectl command.</p>

<pre><code>kubectl run nginx image=nginx --port=80 --record
</code></pre>

<p>detailed explanation with an example is much appreciated.</p>

tamil
<p>Using the --record flag when using kubectl annotates the objects created with that command with the command used to create them. When you list/retrieve these objects, the annotations will show up so that objects can be associated with a command.</p>

<p>I should warn you, however, that there is talk of deprecating this flag in the Kubernetes official repository here</p>

<p><a href="https://github.com/kubernetes/kubernetes/pull/20035" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/pull/20035</a></p>

<p>and here</p>

<p><a href="https://github.com/kubernetes/kubernetes/issues/40422" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/40422</a></p>
