-1

I created a deployment yaml file then applied it. I executed:

   ‘kubectl exec -it POD bin/bash’

Inside the container, I did apt install for manythings. Now if I applied the deployment again, I will loose all the changes that I did on the pod. How can I reflect the changes that I did on the pod to the deployment? And if I deleted a pod, how would a new one would be created with the same previous pod?

Jonas
  • 121,568
  • 97
  • 310
  • 388
iyad
  • 3
  • 2
  • Please provide some minimal reproducible code so we can work through your problem- and provide some more clarity for ‘manythings’. thanks. – Montresor Nov 28 '20 at 22:43

1 Answers1

1

The persistent solution would be to create a new Dockerfile for your image or extend your existing Dockerfile with the commands that you executed. Each command could be inserted into your Dockerfile with a RUN statement. You could also combine the commands into a single RUN statement, if possible. To find your executed commands, you can use the history command

Tobias Thieron
  • 281
  • 1
  • 9
  • I did this, now am facing another error, when I created the deployment, the pod status is: ImagePullBackOff. Something to keep in mind, that the docker file is run successfully with no issues. – iyad Nov 29 '20 at 17:06
  • `ImagePullBackOff` means that kubernetes can't find your image. To debug this error, please look at [this question](https://stackoverflow.com/questions/34848422/how-to-debug-imagepullbackoff) – Tobias Thieron Nov 30 '20 at 10:29
  • If this answer answers your question, please set it as the accepted answer. – Tobias Thieron Nov 30 '20 at 10:31