<p>I recently encountered an issue where something (which I was not able to identify) deleted a PVC and the corresponding PV in my k8s cluster. The data can be recovered but I have two questions:</p>
<ol>
<li>Is there some hack to prevent the PVC from being deleted accidentally if someone issues a wrong command which deletes it?</li>
<li>Is it possible to check what command caused the deletion of the PVC via some logs?</li>
</ol>

<p>For question 1, you can set the Reclaim Policy to <code>Retain</code>. This means that the PV and PVC can be deleted but the underlying storage volume will stick around forever (or until you delete it in whatever the underlying system is).</p>
<p>For 2, yes if you have audit logging turned on. <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/audit/#audit-backends" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/debug-application-cluster/audit/#audit-backends</a>. Otherwise not really.</p>
