Wrong output -o yaml

Hi Kodekloud,

Everytime when I open the yaml files, after executing the following commands:

  • kubectl get pod example -o yaml > example.yaml
  • kubectl get deployment anotherexample -o yaml > anotherexample.yaml

the format given in the yaml file gets corrupt! Can you guys please help me out ?

Thanks a lot,

Best regards,

Deldar

Hello, @deldar
Can you share the image or show me the yaml file what corrupt data you are getting?

Hi @player001, I have just uploaded the image in the new discussion :smile:

It’s not a corrupt data. It’s a system generated managed fields.

Hi, than please explain why I receive the following error ?

I have followed the same instructions provided in this video:
https://www.udemy.com/course/certified-kubernetes-administrator-with-practice-tests/learn/lecture/21738774#notes

LAB question 6: Set Node Affinity to the deployment to place the PODs on node01 only

can you paste your yaml file here? You can check the issue in the line number 46. Must be proper align.

First attempt uploading images:

  • It only accepts one image

Second attempt uploading the screenshots as a pdf file:

  • Sorry, new users can not upload attachments.

After a second attempt, I get this error:

I have not changed anything in the format.

Check the alignments and fields should be in the correct place.

I will give it another try, placing the Node Affinity rule on another place. I will give you an update ! :smiley:

Image quality is not good. Can you please share only that line number image before and after.

Now I receive this error:

The line number “120” is starting with app: blue (in the template section). The cursor is at line 120…

What do you mean by after ? After executing kubectle apply -f on the yaml file ? If thats the case… Nothing has changed in the yaml file.

I can see that your affinity field and containers field is not in line.

1 Like

Great service! Thanks a lot. It works fine!!! :sweat_smile: