I cant use the "kubectl edit <pod> <name>

Hi people,
I’m studying for the CKAD and I’m having issues when I have to use the:
kubectl edit
It opens a VI terminal, I went to the INSERT MODE, I do what I have to do, press ESC :wq or :wq!
But when i hit ENTER, the VI programa send me back to the same document, if I hit :wq again, it will close and save, but if I reopen the EDIT, it’s like I never made a single input in the YAML file.

I tried changing to NANO, but had the same result, I can’t use the EDIT in my exercises.
Any sugestions?

pods are essentially immutable, so you can’t use kubectl edit to modify them except in very small ways. So to modify a pod, you need to:

  • Save away its YAML with kubectl get pod PNAME -o yaml
  • Modify the saved YAML.
  • Delete the existing pod and use k create -f or k apply -f to create a new pod using the modified YAML.

Thank you master!
I’ll test it right away