Hi Everyone.
I have created a deployment which has the same labels in matchLabels and pod labels section. But getting an error that I am not sure how to solve that. Can anyone please help me?
student-node ~ ➜ kubectl replace -f bd.yaml
error: error parsing bd.yaml: error converting YAML to JSON: yaml: line 32: did not find expected key
It will help you to enable line numbers in vi so you can more easily find these errors
In normal mode (the same mode you use to save and exit), enter this
:set nu
However I can see the issue is down to indentation. spec
needs to be at the same indentation as metadata
, however you have indented it one space too far
Also the values of your labels should be indented 2 spaces, not one.
See this as well.