<p>I have an (AKS) Kubernetes cluster running a couple of pods. Those pods have dynamic persistent volume claims. An example is:</p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mysql-pvc
  namespace: prd
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: custom-azure-disk-retain
  resources:
    requests:
      storage: 50Gi
</code></pre>
<p>The disks are Azure Managed Disks and are backupped (snapshots) with the Azure backup center. In the backup center I can create a disk from a snapshot.</p>
<p>Here is my question: how can I use the new disk in the PVC? Because I don't think I can patch the PV with a new DiskURI.</p>
<p>What I figured out myself is how to use the restored dik directly as a volume. But if I'm not mistaken this does not use a PVC anymore meaning I can not benefit from dynamically resizing the disk.</p>
<p>I'm using kustomize, here is how I can link the restored disk directoy in the deployment's yaml:</p>
<pre><code>- op: remove
  path: &quot;/spec/template/spec/volumes/0/persistentVolumeClaim&quot;
- op: add
  path: &quot;/spec/template/spec/volumes/0/azureDisk&quot;
  value: {kind: Managed, diskName: mysql-restored-disk, diskURI: &lt;THE_URI&gt;}
</code></pre>
<p>Some people will tell me to use <a href="https://velero.io/" rel="nofollow noreferrer">Velero</a> but we're not ready for that yet.</p>

Charlie
<p>You are using dynamic provisioning and then you want to hardcode DiskURIs? With this you also have to bind pods to nodes. This will be a nightmare when you have a disaster recovery case.</p>
<p>To be honest, use Velereo :) Invest the time to get comfortable with it, your MTTR will thank you.</p>
<p>Here is a quick start article with AKS: <a href="https://dzone.com/articles/setup-velero-on-aks" rel="nofollow noreferrer">https://dzone.com/articles/setup-velero-on-aks</a></p>
