Anurag Gautam:
q - when i run below command, i get lots of extra cluster information.? I think the --export works in my local but not in the lab. Believe thats depricated already, What could be an alternative?
kubectl get pods <pod_name> -o yaml
kubectl get pods <pod_name> --export -o yaml
this command errors out as --export is not recognised as valid param
Pranay:
Yes Anurag - it has been deprecated in 1.18 and removed in 1.19 - see this PR : https://github.com/kubernetes/kubernetes/pull/88649
You will have to do (as you have already hinted in your post)
kubectl get pods <pod_name> -o yaml
And remove metadata.managedFields
and status
fields from YAML and use it for future reuse .
From exam perceptive sometime you can getaway by not removing above two fields - for example if they ask you to add resource request/limit to existing pod - you can export yaml add/update/modify needed additional fields . Then just do kubectl replace --force --grace-period=0 -f <manifest.yaml>
that should just do it . This is just to save time during exam . In real life cleanup above mention two fields just keep your files tidy .
Anurag Gautam:
Thanks @Pranay