<p>In my minikube I'm getting an error <code>persistentvolumeclaim "jenkins-volume-claim" not found</code></p>

<p>I'm installing jenkins using helm with the command below:</p>

<pre><code>helm install --name jenkins -f kubernetes/jenkins-values.yaml stable/jenkins --namespace jenkins-system
</code></pre>

<p>the snippet about <code>Persistence</code> in <code>jenkins-values.yaml</code> is below:</p>

<pre><code>Persistence:
  Enabled: true
  ## A manually managed Persistent Volume and Claim
  ## Requires Persistence.Enabled: true
  ## If defined, PVC must be created manually before volume will be bound
  ExistingClaim: jenkins-volume-claim
</code></pre>

<p>I've created a persistence volume using the command below:</p>

<pre><code>kubectl create -f persistence.yaml
</code></pre>

<p>persistence.yaml looks like this:</p>

<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: jenkins-volume
spec:
  accessModes:
    - ReadWriteOnce
  capacity:
    storage: 5Gi
  hostPath:
    path: /data/jenkins-volume/
</code></pre>

<p><strong>Question</strong></p>

<p>I have persistence volume <code>jenkins-volume</code> created but am still getting error <code>persistentvolumeclaim "jenkins-volume-claim" not found</code>. How can I resolve this?</p>

<p>The error message points to missing <code>PersistentVolumeClaim</code> named <code>jenkins-volume-claim</code>. To create one, execute:</p>

<pre><code>kubectl -n &lt;namespace&gt; create -f - &lt;&lt;EOF
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: jenkins-volume-claim
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Filesystem
  resources:
    requests:
      storage: 5Gi
EOF
</code></pre>

<p>Executing after that <code>kubectl get pv</code> should show the <code>jenkins-volume</code> PV in <code>Bound</code> status (assuming the PV has been created already with capacity of at least 5Gi).</p>

<p>Use selector(s) as described <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#selector" rel="nofollow noreferrer">here</a> to make sure the claim will bind to the desired pre-created PV (persistent volume) in case there are more than one PV available with proper capacity.</p>
