When creating a pod definition yaml from a running pod, ex: "kubectl get pod myp . . .

Jason:
When creating a pod definition yaml from a running pod, ex: “kubectl get pod mypod -o yaml > mypod.yaml” it adds all of the data from the running pod in the yaml. However when watching the solution videos for some of the practice tests, the extra data from the running pods are not included in the yaml. I think I am concerned because I don’t want to waste a bunch of time clearing up the data in the definition files to create new pods. Does anyone have suggestions on how to properly create definition files from pods? Am I doing something wrong? Is the cleanup even necessary ?

unnivkn:
Hi Jason… In fact I don’t remove any extra data while I am working with any running object. We should know, for a particular task where to update the data. For eg: if any change needed inside a container, once I open the .yaml file, I used to search for the keyword “image” & update near to it. Also if you delete some data with out knowing its importance make you trouble while you do “kubectl apply”. However if you need to cleanup some extra data, you can use this command: kubectl get po nginx -o yaml | grep -v ‘f:’ > pod.yaml