Get Instant Solutions for Kubernetes, Databases, Docker and more
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.
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.
When this issue occurs, you may notice the following:
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.
The root cause of this issue is typically one of the following:
To resolve the NodeNotReadyDueToDiskPressure issue, follow these steps:
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.
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
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.
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.
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.
(Perfect for DevOps & SREs)
(Perfect for DevOps & SREs)