<p>I'm trying to install Jenkins on Kubernetes with its official guide: <a href="https://www.jenkins.io/doc/book/installing/kubernetes/" rel="nofollow noreferrer">at Jenkins's site</a>, <strong>Install Jenkins with Helm v3</strong>. The environment is Linux/Minikube.</p>
<ol>
<li>I created namespace Jenkins</li>
<li>Created Persistent Volume with <a href="https://raw.githubusercontent.com/jenkins-infra/jenkins.io/master/content/doc/tutorials/kubernetes/installing-jenkins-on-kubernetes/jenkins-volume.yaml" rel="nofollow noreferrer">the yaml provided</a></li>
<li>Created <a href="https://raw.githubusercontent.com/jenkins-infra/jenkins.io/master/content/doc/tutorials/kubernetes/installing-jenkins-on-kubernetes/jenkins-sa.yaml" rel="nofollow noreferrer">service account</a></li>
<li>Installed with <code>helm install jenkins -n jenkins -f jenkins-values.yaml jenkinsci/jenkins</code> where values are official too
I only alerted Jenkins values as it was recommended in the instruction (added values below):</li>
</ol>
<pre><code>storageClass: jenkins-pv
...
serviceAccount:
  create: false
</code></pre>
<p><strong>The issue:</strong> Jenkins pod never starts.
<em>It says: “0/1 nodes are available: 1 node(s) didn’t find available persistent volumes to bind. preemption: 0/1 nodes are available: 1 Preemption is not helpful for scheduling…”</em></p>
<p><strong>PV</strong> is created:</p>
<pre><code>rage@ubuntu-virtual:~$ kubectl describe pv jenkins -n jenkins
Name:            jenkins-pv
Labels:          &lt;none&gt;
Annotations:     pv.kubernetes.io/bound-by-controller: yes
Finalizers:      [kubernetes.io/pv-protection]
StorageClass:    jenkins-pv
Status:          Released
Claim:           default/jenkins
Reclaim Policy:  Retain
Access Modes:    RWO
VolumeMode:      Filesystem
Capacity:        5Gi
Node Affinity:   &lt;none&gt;
Message:         
Source:
    Type:          HostPath (bare host directory volume)
    Path:          /data/jenkins-volume/
    HostPathType:  
Events:            &lt;none&gt;
</code></pre>
<p><strong>PVC</strong> says: “WaitForPodScheduled”</p>
<pre><code>$ kubectl describe pvc jenkins -n jenkins
Name:          jenkins
Namespace:     jenkins
StorageClass:  jenkins-pv
Status:        Pending
Volume:        
Labels:        app.kubernetes.io/component=jenkins-controller
               app.kubernetes.io/instance=jenkins
               app.kubernetes.io/managed-by=Helm
               app.kubernetes.io/name=jenkins
               helm.sh/chart=jenkins-4.3.23
Annotations:   meta.helm.sh/release-name: jenkins
               meta.helm.sh/release-namespace: jenkins
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
Used By:       jenkins-0
Events:
  Type    Reason               Age                   From                         Message
  ----    ------               ----                  ----                         -------
  Normal  WaitForPodScheduled  38m (x481 over 160m)  persistentvolume-controller  waiting for pod jenkins-0 to be scheduled
  Normal  WaitForPodScheduled  28m (x26 over 34m)    persistentvolume-controller  waiting for pod jenkins-0 to be scheduled
  Normal  WaitForPodScheduled  2m35s (x81 over 22m)  persistentvolume-controller  waiting for pod jenkins-0 to be scheduled
</code></pre>
<p>Pod's describe:</p>
<pre><code>Events:
  Type     Reason            Age   From               Message
  ----     ------            ----  ----               -------
  Warning  FailedScheduling  37s   default-scheduler  0/1 nodes are available: 1 node(s) didn't find available persistent volumes to bind. preemption: 0/1 nodes are available: 1 Preemption is not helpful for scheduling..
</code></pre>
<p>Please, help investigate to this problem. I quess its PVC-related, but can't catch where exactly the problem is.</p>
<p><strong>UPDATE</strong></p>
<p>Also I tried to add nodeAffinity to my PersistentVolume, with no success. I put <strong>minikube</strong> here, because I'm developing locally</p>
<pre><code>nodeAffinity:
required:
  nodeSelectorTerms:
  - matchExpressions:
    - key: kubernetes.io/hostname
      operator: In
      values:
      - minikube
</code></pre>
<p>Also I added claimRef with name Jenkins. Jenkins Helm installation creates PVC with this name.</p>
<pre><code>   claimRef:
    name: jenkins
    namespace: jenkins
</code></pre>

Dec0de
<p>Finally resolved the issue.
Got actual Jenkins volume claim, which was deployed with Helm-chart:</p>
<blockquote>
<p>kubectl get pvc jenkins -n jenkins -o yaml</p>
</blockquote>
<p>It stated:</p>
<pre><code>      resources:
      requests:
      storage: 8Gi
</code></pre>
<p>And my volume size was lesser: 5Gi. Thats why PVC request was not satisfied.
Very strange, that there wasn't any particular notice from Kubernetes about it when I did '<strong>describe</strong>' command for PVC/pod.</p>
<p>So I adjusted values.yaml, provided with Jenkins Helm chart to acquire lesser size:</p>
<pre><code>  storageClass: jenkins-pv
  annotations: {}
  labels: {}
  accessMode: &quot;ReadWriteOnce&quot;
  size: &quot;5Gi&quot;
</code></pre>
<p>Now it works as intended. So there is no glitches in the official documentation related to this case.</p>
