I'm doing the labs for LESSON 2, TOPIC 2 (config maps). A couple of the tasks as . . .

David Ncl:
I’m doing the labs for LESSON 2, TOPIC 2 (config maps).
A couple of the tasks ask you to “Delete and recreate the POD” - which is easier said than done (or so it seems). The only way I’ve found to do this is to write out the “full” yaml for the pod like this kubectl get pod webapp-color -o yaml > pod.yaml
The hack the pod.yaml file in vi to remove ton of extra data. Then delete the pod, and then run kubectl create -f pod.yaml

Am I missing something obvious or is it as really like this?

Dave McLean:
@David Ncl - Yeah I had the same issue.

You can also do:

k edit pod {}

then edit the yaml that it gives you.

It might tell you that you’re not allowed to edit the pod directly and then save your edited yaml to a tmp file after which you can:

k apply -f /tmp/your-file-ajs76s.yaml --force

This is. marginally less tedious than writing the whole thing out again but tbh by now I’ve got quite quick at just typing the yamls and I feel like it’s helping me get familiar with the structure.