Krishna Kumaran:
Guys, a question. In KK Multi Container lab, one of the task is to add a container to the pod without modifying anything else. So when i add the container data using the edit command, im getting the error
# * spec.containers: Forbidden: pod updates may not add or remove containers"
when I try to save the config. Am i missing something? Below is the screenshot
Vitor Jr.:
You can get the yaml for the pod, delete it, edit the yaml just adding the new pod without changing nothing else. The question is dubious about this, but you’ll get a right answer this way.
Krishna Kumaran:
thanks Vitor.
Krishna Kumaran:
Well i tried editing the config and also via making changes to the yaml file, and also created a new yaml file with the contents in the solution. but im getting the below error.
Krishna Kumaran:
The Pod “app” is present and in the namespace “elastic-stack”. The same has also been mentioned in the yaml
Vitor Jr.:
delete the running pod
Vitor Jr.:
before you apply it
Beejal Shah:
apply will only work if you initially created using same command. Otherwise the annotations will be missing. Delete pod then create using apply
Krishna Kumaran:
just a doubt, wouldnt that be against the question? When it says not to make any changes to the pod, I thought deleting the pod would be against this.
Krishna Kumaran:
ya when i delete the pod and use the yaml, it works but got confused with the question when it said “do not make changes to the pod” so ya, my bad
Krishna Kumaran:
thanks Vitor and Beejal !
Vitor Jr.:
like I said: You can get the yaml for the pod, delete it, edit the yaml just adding the new pod without changing nothing else. The question is dubious about this, but you’ll get a right answer this way.