Copying files from a kubernetes pod container

1/25/2019

Is there a recommended way of copying files from a pod periodically. I have a pod with an empty storage and no persistence volume. So wanted to periodically copy some log files from the pod containers to a nfs share. I can run a cronjob and invoke kubectl copy but wondering if there is a better way of doing this?

-- devops84uk
docker
kubernetes

2 Answers

1/27/2019

Run a cronjob as a scheduled job to copy the files to target location

-- P Ekambaram
Source: StackOverflow

1/25/2019

I think the better way for your case is to mount the NFS volume on your Pod to directly write the logs on it : https://kubernetes.io/docs/concepts/storage/volumes/#nfs

-- Nurza
Source: StackOverflow