<p>I have a job, which I want to run regularly in Kubernetes 1.19.3 (DigitalOcean).</p>
<p>For this job, I need to take a snapshot of a PVC and do stuff to it. I know how can I run a job and mount a volume to the pod it runs, but I have a hard time finding out how to take that snapshot at the beginning of this job.</p>
<p>Is there any way to do it?</p>

<p>The tool of choice to take PV snapshots in K8s is <a href="https://kubernetes.io/docs/concepts/storage/volume-snapshots/" rel="nofollow noreferrer">VolumeSnapshots</a>.</p>
<p>The trouble with them is that they don't come  yet) with functionality for periodic triggering. So, you would have to create them from a K8s CronJob. However, doing so is not terribly straight forward, since your CronJob Pod would need to have a K8s client installed and require access to the K8s API Server with RBAC.</p>
<p>There are a couple of options to get there, reaching from writing your own image from scratch to using open-source solutions based on the clients from this project <a href="https://github.com/kubernetes-client" rel="nofollow noreferrer">k8s client libraries</a>.</p>
<p>Seeing that dynamic K8s manifest applying is somewhat badly supported by K8s, I actually started an open source project myself, that you could use for this purpose: <a href="https://github.com/fritzduchardt/k8scrud" rel="nofollow noreferrer">K8sCrud</a>.</p>
