<p>I have a PersistentVolumeClaim in Kubernetes cluster. I would like to delete and recreate it, in my development environment to, in this way, sort of reset some services that use it. </p>

<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: kafka-disk1
spec:
  accessModes:
  - ReadWriteOnce
  storageClassName: managed-premium
  resources:
    requests:
      storage: 1Gi
</code></pre>

<p>What is the best way to accomplish this?</p>

<p>Sorry for this noob question!</p>

Greg Bala
<ul>
<li><p>the imperative way:</p>

<p><code>$ kubectl delete pvc kafka-disk1</code></p></li>
<li><p>the declarative way:</p>

<p>you can label your resources , and then do <code>kubectl apply -f</code> with prune option , and label , so when you delete the yaml from the manifest directory , kubectl will contact the api server and compare the resources on the file and in the cluster , and the missing resource in the files will be deleted</p></li>
</ul>
