Im not clear with the use of --record in kubectl command.
kubectl run nginx image=nginx --port=80 --record
detailed explanation with an example is much appreciated.
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.
I should warn you, however, that there is talk of deprecating this flag in the Kubernetes official repository here
https://github.com/kubernetes/kubernetes/pull/20035
and here