what use of record option in kubectl run command?

4/11/2019

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.

-- tamil
kubernetes

1 Answer

4/11/2019

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

https://github.com/kubernetes/kubernetes/issues/40422

-- Garrett F.
Source: StackOverflow