Debug Your Infrastructure

Get Instant Solutions for Kubernetes, Databases, Docker and more

AWS CloudWatch
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Pod Stuck in CrashLoopBackOff
Database connection timeout
Docker Container won't Start
Kubernetes ingress not working
Redis connection refused
CI/CD pipeline failing

K3s NodeNotReadyDueToDiskPressure

A node is not ready due to disk pressure, affecting pod scheduling.

Understanding K3s

K3s is a lightweight Kubernetes distribution designed for resource-constrained environments and edge computing. It simplifies the deployment and management of Kubernetes clusters by reducing the overhead and complexity associated with traditional Kubernetes installations. K3s is particularly popular for IoT and CI/CD environments due to its minimal resource requirements and ease of use.

Identifying the Symptom

One common issue encountered in K3s is the NodeNotReadyDueToDiskPressure condition. This symptom manifests when a node in the cluster is marked as 'NotReady' due to insufficient disk space. This can prevent new pods from being scheduled on the affected node, potentially impacting application availability and performance.

Observing the Error

When this issue occurs, you may notice the following:

  • The node status is reported as 'NotReady' in the cluster.
  • Pods may be stuck in a 'Pending' state due to scheduling constraints.
  • Logs may show warnings or errors related to disk pressure.

Explaining the Issue

The NodeNotReadyDueToDiskPressure condition is triggered when the available disk space on a node falls below a certain threshold. Kubernetes monitors resource usage on nodes, and when disk space is critically low, it marks the node as 'NotReady' to prevent further scheduling of pods. This is a protective measure to ensure that existing workloads are not disrupted by running out of disk space.

Root Cause Analysis

The root cause of this issue is typically one of the following:

  • Excessive log files or temporary data consuming disk space.
  • Large container images or persistent volumes occupying disk capacity.
  • Improper disk cleanup or maintenance routines.

Steps to Resolve the Issue

To resolve the NodeNotReadyDueToDiskPressure issue, follow these steps:

Step 1: Check Disk Usage

Log into the affected node and check the current disk usage:

df -h

Identify the partitions with high usage and determine what is consuming the space.

Step 2: Free Up Disk Space

Remove unnecessary files and logs. For example, clear old log files:

sudo journalctl --vacuum-time=2d

Consider removing unused Docker images and containers:

docker system prune -a

Step 3: Increase Disk Capacity

If freeing up space is not sufficient, consider increasing the disk capacity of the node. This may involve resizing the disk in your cloud provider or adding additional storage.

Step 4: Verify Node Status

After addressing the disk space issue, verify that the node status returns to 'Ready':

kubectl get nodes

The node should now be listed as 'Ready', and pods should be able to schedule successfully.

Further Reading and Resources

For more information on managing disk pressure in Kubernetes, refer to the official Kubernetes documentation. Additionally, explore K3s documentation for specific guidance on managing K3s clusters.

Master 

K3s

 debugging in Minutes

— Grab the Ultimate Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Real-world configs/examples
Handy troubleshooting shortcuts
Your email is safe with us. No spam, ever.

Thankyou for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

K3s

Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Your email is safe thing.

Thankyou for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

MORE ISSUES

Deep Sea Tech Inc. — Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid