Hi, a beginner question 🙂 When I -oyaml a file, the file l . . .

pgnn:
Hi, a beginner question :slightly_smiling_face:
When I -oyaml a file, the file looks like this.
With f:
f:
f: etc.
Is there a way to get the short version of that, without the additional fields? Thanks

Igor Eulálio:
if the resource is already created, get -o yaml operation will retrieve the actual state of the resource, all i know is that isn’t possible to retrieve only a few fields… otherwise is possible to generate a file from a command with --dry-run flag, but if you just need to change an existing resource, its better to get the complete state and loss a few seconds searching the properties that you wanna change

pgnn:
ok, thing for me is, during exam the many entries will irritate me because so many lines. When I create sth imperative, I would like to see a lean yaml :smile:

pgnn:
I think I got it, simply use dry-run=client, well basic one… :slightly_smiling_face:

unnivkn:
Hi @pgnn fyr:

kubectl get po -n production -o yaml | egrep -v ‘f:|k:|.:’

kubectl -> 1.21.xx on words you have this option:

–to hide managed fields
kubectl get po nginx --show-managed-fields=false -oyaml

–to show managed fields
kubectl get po nginx --show-managed-fields=true -oyaml