How to transfer files between the pods in Kubernetes?

2/11/2020

I want to transfer my files generated by one of the pod of my application to the Kubernetes cronjob pod. Is there any method to transfer files between the two pods of a cluster?

-- pikubhai
docker
docker-registry
dockerfile
kubernetes

2 Answers

2/11/2020

You can use hostdir if you don't want to persist data. however, you can use PVC and any type of shared volume to store data which can be accessible by both pods cronjobs & pod.

-- Harsh Manvar
Source: StackOverflow

2/11/2020

Create a persistent-volume and mount the same volume to both the containers

-- Shenal Silva
Source: StackOverflow