Kubernetes Node Disk Pressure

Alex Bezrukov
3 min readFeb 26, 2023

--

Kubernetes is an open-source container orchestration platform that manages the deployment, scaling, and maintenance of containerized applications. It allows developers to deploy their applications in a consistent and efficient manner. However, like any distributed system, it is not immune to problems.

One of the common issues that can arise in a Kubernetes cluster is Node Disk Pressure. In this blog post, we will explore what Node Disk Pressure is, why it happens, and how to fix it.

What is Node Disk Pressure?

Node Disk Pressure occurs when a node in a Kubernetes cluster runs out of disk space. This can happen for several reasons, including:

  • Application logs and data are stored on the node’s local disk instead of a network-attached storage (NAS).
  • The node is running too many pods that generate a high volume of data.
  • The node is running pods with misconfigured resource limits, causing them to use more disk space than they should.
  • The node is running pods with misconfigured storage requests, causing them to request more storage than is available on the node.

When a node is under Disk Pressure, Kubernetes will start evicting pods to free up disk space. If this continues to happen, the node may become unresponsive or even crash.

How to Detect Node Disk Pressure:

Kubernetes provides several tools to monitor the health and performance of a cluster. To detect Node Disk Pressure, you can use the following:

  • Kubernetes Dashboard: The Kubernetes Dashboard provides a graphical interface to view the status of a cluster. It includes metrics such as CPU usage, memory usage, and disk usage.
  • Kubernetes Events: Kubernetes generates events for various actions that occur within the cluster. You can use these events to monitor for Node Disk Pressure.
  • Prometheus: Prometheus is an open-source monitoring system that can be used to collect and analyze metrics from Kubernetes.

How to Fix Node Disk Pressure:

If you detect Node Disk Pressure in your Kubernetes cluster, there are several steps you can take to fix it:

  1. Increase Storage: The most straightforward solution to Node Disk Pressure is to increase the storage capacity of the node. You can do this by adding additional disks to the node or expanding the existing disks.
  2. Remove Unused Data: If there are large amounts of unused data on the node, you can remove it to free up disk space. This can include old logs, temporary files, or unused images.
  3. Reduce Resource Limits: If pods are using more disk space than they should, you can reduce their resource limits. This will prevent them from using more storage than necessary.
  4. Use Network-Attached Storage (NAS): Instead of storing application data and logs on the local disk, you can use a network-attached storage (NAS). This will allow you to store data and logs on a separate storage device, freeing up disk space on the node.

Conclusion:

Node Disk Pressure can cause significant problems in a Kubernetes cluster. However, by monitoring for it and taking steps to fix it, you can prevent it from causing downtime or even cluster failure. Remember to regularly monitor your cluster for Disk Pressure, and take steps to mitigate it before it becomes a severe problem.

--

--