Christian Moore:
Can someone explain this please? I get this response almost every time when trying to edit a manifest file. Also, sometimes it saves as a temp file to a different location.
Alistair Mackay:
Hi @Christian Moore,
First, is the pod still running when you issue the edit command? If it has exited, you can’t edit it in place.
Second, there are not actually many fields you can edit in a running pod. Most are immutable.
Christian Moore:
Got it. Yes the pod it still in the running state. My thought was that the pod would update itself with the new changes. I was attempting to add a security context to the pod.
Alistair Mackay:
General tip for the exam. If you are asked to make a change to a running pod, export it with
kubectl get pods ... -o yaml > pod.yaml
Edit that, delete the running pod, then recreate with
kubectl apply -f pod.yaml
Christian Moore:
okay, got it. Thanks for the tip.