<p>I have a small kubernetes cluster with AWX running.<br />
I would like to make some changes, the PV is a filesystem on one of the nodes.<br />
Is it possible to migrate it to a different PV, like NFS?</p>
<p>Also, I would like to change the CPU and memory limits. But I guess I will have to redeploy it.</p>
<p>Should I try to migrate the PV or delete everything and recreate it?</p>
<p>Thanks</p>

radicaled
<p>Assuming that you have dynamic provisioning enabled I advice you to use <a href="https://github.com/utkuozdemir/pv-migrate" rel="nofollow noreferrer">pv-migrate</a>.</p>
<p>This is a cli tool/kubectl plugin to easily migrate the contents of one Kubernetes  <code>PersistentVolume</code>  to another.</p>
<p>Common use cases:</p>
<ol>
<li>You have a database with a bound 30 GB <code>PersistentVolumeClaim</code>. It occurred 30 GB was not enough and you filled all the disk space rather quickly. And sadly your <code>StorageClass</code>/provisioner doesn't support  <a href="https://kubernetes.io/blog/2018/07/12/resizing-persistent-volumes-using-kubernetes/" rel="nofollow noreferrer">volume expansion</a>. Now you need to create a new PVC of 100 GB and somehow copy all the data to the new volume, as-is, with its permissions and so on.</li>
<li>You need to move a <code>PersistentVolumeClaim</code> from one namespace to another.</li>
</ol>
<p>To migrate contents of <code>PersistentVolumeClaim</code> pvc-a in namespace name-space-a to the <code>PersistentVolumeClaim</code> pvc-b in namespace name-space-b, use the following command:</p>
<pre><code>$ kubectl pv-migrate \
  --source-namespace name-space-a \
  --source pvc-a \
  --dest-namespace name-space-b \
  --dest pvc-b
</code></pre>
<p>Take also a look at: <a href="https://kubernetes.io/docs/tasks/administer-cluster/change-pv-reclaim-policy/" rel="nofollow noreferrer">change-pv-reclaim-policy</a>, <a href="https://kubernetes.io/blog/2018/07/12/resizing-persistent-volumes-using-kubernetes/" rel="nofollow noreferrer">resizing-persistent-volumes-using-kubernetes</a>.</p>
