Unable to install Jenkins to Kubernetes with the official guide

I’m trying to install Jenkins on Kubernetes with the official guide: [at Jenkin’s site][1], Install Jenkins with Helm v3. The environment: minukube on Ubuntu.

  1. I created namespace jenkins
  2. Created Persistent Volume:
apiVersion: v1
kind: PersistentVolume
metadata:
  name: jenkins-pv
  namespace: jenkins
spec:
  storageClassName: jenkins-pv
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 20Gi
  persistentVolumeReclaimPolicy: Retain
  hostPath:
    path: /data/jenkins-volume/

---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: jenkins-pv
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
  1. Created service account
  2. Installed with Jenkins with Helm helm install jenkins -n jenkins -f jenkins-values.yaml jenkinsci/jenkins, where values are official too
    I only alerted Jenkins values as it was recommended in the instruction (added values below):
storageClass: jenkins-pv
...
serviceAccount:
  create: false

The issue: Jenkins pod never starts.
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…”

Pod:

rage@ubuntu-virtual:~$ kubectl describe pod jenkins-0 -n jenkins
Name:             jenkins-0
Namespace:        jenkins
Priority:         0
Service Account:  jenkins
Node:             <none>
Annotations:      checksum/config: c72ccb23c5ece5a66b48a7e67a820c370fba9a27fc2e59be7866fada3541dfb7
Status:           Pending
IP:               
IPs:              <none>
Controlled By:    StatefulSet/jenkins

...
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..

PV is created:

rage@ubuntu-virtual:~$ kubectl describe pv jenkins -n jenkins
Name:            jenkins-pv
Labels:          <none>
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:        20Gi
Node Affinity:   <none>
Message:         
Source:
    Type:          HostPath (bare host directory volume)
    Path:          /data/jenkins-volume/
    HostPathType:  
Events:            <none>

PVC says: “WaitForPodScheduled”

$ 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

Please, help investigate to this problem.

Hello @dec0de and welcome to this community :wave:

I don’t know much yet about Jenkins and Kubernetes, the official guide may be outdated. :person_shrugging:
@ssbostan has a few GitHub repo about Jenkins and Docker/Kubernetes, you could maybe have a look: GitHub - ssbostan/jenkins-stack-kubernetes: Scripts and manifests to deploy complete Jenkins on Kubernetes .

Thank you.

Finally resolved the issue.
Got actual Jenkins volume claim, which was deployed with Helm-chart:

kubectl get pvc jenkins -n jenkins -o yaml

It stated:

      resources:
      requests:
      storage: 8Gi

And during the rollout process I decreased my volume to size of 5Gi. Thats why PVC request was not satisfied.
Very strange, that there wasn’t any particular notice from Kubernetes about it when I did ‘describe’ command for PVC/pod.

So I adjusted values.yaml provided with Jenkins Helm chart to acquire lesser size:

  storageClass: jenkins-pv
  annotations: {}
  labels: {}
  accessMode: "ReadWriteOnce"
  size: "5Gi"

Now it works as intended. So there is no glitches in official documentation related to this case. It works.

1 Like

I’m happy for you! :clap:
Thank you very much for your feedback. :+1: