I have a backup job that runs on a cron schedule. Each time the job is run a Kubernetes pod is created, puts backup data into a bound PVC, and completes. I need to be able to manually copy data out of the PVC and put it somewhere else after the job has finished (when the pod is in the completed state).
At this point, the PVC is still listed as Bound, but the pod is listed as Completed. So trying to run kubectl cp my-pod:/ data/
returns an error that kubectl is unable to exec inside a completed pod, and trying to log into the pod with kubectl exec -it my-pod -- bash
similarly returns the same error.
Is there a way to access the PVC data directly after the pod completes?