How can i retrieve any directory/file from the completed pod of a particular job in kubernetes? I am trying to store the output file locally from the container.
Kubernetes pods don't maintain state by default. You will need to use persistent volumes for data persistence (PVC/PV).
In order to retrieve files/directories from a completed job, you will have to mount the same persistent volume to another pod after your job is completed in order to retrieve the "output file"
Thanks for the suggestion!! I finally manage to do it by using init-container along with main container... one to run the real functioning i want the job for and another one to let the container sleep and then mounted an empty directory (PVC too can be used ofcourse) and shared with both main container and init-container.