I am trying to add resource request and limit on an existing deployment. when I do kubectl edit deployment deployment_name_here
, edit the yaml and save and exit, it give me this : Edit cancelled, no changes made.
but when I edit the yaml,that I used to create that deployment and add the resource details, and do kubectl apply -f deployment.yaml
it works.
Why this is happening? Is there any way I can do it directly using kubectl edit ...
Things like this are most likely caused by it opening an editor that forks off instead of staying.
That means you'll want to set $EDITOR to an editor that does wait. E.g. nano, vim or emacs should work.