Deepak Ladwa:
Tej_Singh_Rana:
Hello, @Sandeep Panchal
If you have updated in the definition yaml file then please delete the existing pod then recreate again otherwise run the command kubectl replace
. This command will delete the pod and will recreate again from updated definition file.
$ kubectl replace -f file-name.yaml --force
Sandeep Panchal:
I did not use a yaml file to create pod. I created pod with command kubectl run pod redis --image:redis123
Sandeep Panchal:
After that I did edit pod and replaced redis123 by redid - How can I run pod with correct image ? @Tej_Singh_Rana
Tej_Singh_Rana:
That’s enough, it will automatically recreate again with new image.
Sandeep Panchal:
OK, Thanks.
Sandeep Panchal:
What filename i use ?
Tej_Singh_Rana:
filename?
Sandeep Panchal:
kubectl replace -f file-name.yaml --force
Sandeep Panchal:
I am not using a yaml file.
Tej_Singh_Rana:
It could be anything, I gave an example.
Sandeep Panchal:
OK, Thanks
Sandeep Panchal:
will try in few mins
Tej_Singh_Rana:
I thought you stored in a file and trying to update.
Sandeep Panchal:
This is what i did
Sandeep Panchal:
controlplane $ kubectl run redis --image=redis123
pod/redis created
Sandeep Panchal:
after that i did “kubectl edit pod redis” and updated image to redis from redis123
Sandeep Panchal:
now I need to apply this config on pod to update the image
Tej_Singh_Rana:
> after that i did “kubectl edit pod redis” and updated image to redis from redis123
above step is sufficient to update the image