Jenkins X builds fail with "The node was low on resource: [DiskPressure]."

5/16/2019

My Jenkins X installation, mid-project, is now becoming very unstable. (Mainly) Jenkins pods are failing to start due to disk pressure.

Commonly, many pods are failing with

The node was low on resource: [DiskPressure].

or

0/4 nodes are available: 1 Insufficient cpu, 1 node(s) had disk pressure, 2 node(s) had no available volume zone. Unable to mount volumes for pod "jenkins-x-chartmuseum-blah": timeout expired waiting for volumes to attach or mount for pod "jx"/"jenkins-x-chartmuseum-blah". list of unmounted volumes=[storage-volume]. list of unattached volumes=[storage-volume default-token-blah] Multi-Attach error for volume "pvc-blah" Volume is already exclusively attached to one node and can't be attached to another

This may have become more pronounced with more preview builds for projects with npm and the massive node-modules directories it generates. I'm also not sure if Jenkins is cleaning up after itself.

Rebooting the nodes helps, but not for very long.

-- mooncat69
jenkins--x
kubernetes

1 Answer

6/17/2019

Let's approach this from the Kubernetes side. There are few things you could do to fix this:

  1. As mentioned by @Vasily check what is causing disk pressure on nodes. You may also need to check logs from:
    • kubeclt logs: kube-scheduler events logs
    • journalctl -u kubelet: kubelet logs
    • /var/log/kube-scheduler.log

More about why those logs below.

  1. Check your Eviction Thresholds. Adjust Kubelet and Kube-Scheduler configuration if needed. See what is happening with both of them (logs mentioned earlier might be useful now). More info can be found here

  2. Check if you got a correctly running Horizontal Pod Autoscaler: kubectl get hpa You can use standard kubectl commands to setup and manage your HPA.

  3. Finally, the volume related errors that you receive indicates that we might have problem with PVC and/or PV. Make sure you have your volume in the same zone as node. If you want to mount the volume to a specific container make sure it is not exclusively attached to another one. More info can be found here and here

I did not test it myself because more info is needed in order to reproduce the whole scenario but I hope that above suggestion will be useful.

Please let me know if that helped.

-- OhHiMark
Source: StackOverflow