devops84uk
devops84uk

Reputation: 741

Copying files from a kubernetes pod container

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?

Upvotes: 0

Views: 833

Answers (2)

P Ekambaram
P Ekambaram

Reputation: 17621

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

Upvotes: 0

Nurza
Nurza

Reputation: 231

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

Upvotes: 2

Related Questions