skip to Main Content

I’m trying to install Jenkins on Kubernetes with its official guide: at Jenkins’s site, Install Jenkins with Helm v3. The environment is Linux/Minikube.

  1. I created namespace Jenkins
  2. Created Persistent Volume with the yaml provided
  3. Created service account
  4. Installed with 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…”

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:        5Gi
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

Pod’s describe:

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

Please, help investigate to this problem. I quess its PVC-related, but can’t catch where exactly the problem is.

UPDATE

Also I tried to add nodeAffinity to my PersistentVolume, with no success. I put minikube here, because I’m developing locally

nodeAffinity:
required:
  nodeSelectorTerms:
  - matchExpressions:
    - key: kubernetes.io/hostname
      operator: In
      values:
      - minikube

Also I added claimRef with name Jenkins. Jenkins Helm installation creates PVC with this name.

   claimRef:
    name: jenkins
    namespace: jenkins

2

Answers


  1. Chosen as BEST ANSWER

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


  2. The yaml of pv at jenkins’s site has nodeSelector like below

      nodeAffinity:
        required:
          nodeSelectorTerms:
          - matchExpressions:
            - key: kubernetes.io/hostname
              operator: In
              values:
              - worker-node01
    

    have you replaced worker-node01 to your nodeName?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search