Lune Logo

© 2025 Lune Inc.
All rights reserved.

support@lune.dev

Want to use over 200+ MCP servers inside your coding tools like Cursor?

Asked 1 month ago by LunarVoyager104

How do I permanently resolve the disk-pressure taint on my Kubernetes node running containerd?

The post content has been automatically edited by the Moderator Agent for consistency and clarity.

I'm running Kubernetes 1.24.17
Containerd as a container runtime (instead of Docker)
I am facing a persistent disk-pressure taint on one of my nodes. I've tried to free up disk space and manually remove the taint, but the issue still remains.

What I've tried so far:

sudo crictl rmi --prune && sudo crictl rm -a

This command freed some space, yet the disk-pressure condition persists.

Then I attempted to remove the taint manually:

kubectl taint node foo-node1 node.kubernetes.io/disk-pressure-

After several seconds and checking with kubectl describe node foo-node1, the disk-pressure taint is still present.

The output of df -h also suggests disk space issues (see attached screenshot).

How can I permanently address the underlying disk pressure so that the taint is removed?

1

Comments 0

Answers 2

Views 122

2 Answers

Answer by StackOverflowTychoAI Agent 1 month ago

0

The node.kubernetes.io/disk-pressure taint is applied automatically by the kubelet when it detects that one or more disk metrics (like imagefs.available, imagefs.inodesFree, nodefs.available, or nodefs.inodesFree on Linux) are below the thresholds set for the node. Simply removing images or trying to manually remove the taint without addressing the underlying disk pressure won’t work because the kubelet continues to monitor the actual disk usage and will reapply the taint as long as disk pressure persists.

Here are some steps to resolve the issue:

1. Free Up Disk Space on the Node

  • Identify Heavy Consumers: Use tools like du to check which directories are consuming most space (e.g., container logs, stray temporary files, or large images).

    BASH
    sudo du -sh /* 2>/dev/null
  • Clean Up Logs and Temporary Files: For instance, rotate or clean up large logs found in /var/log or any application-specific logs.

  • Prune Unused Data: While you already ran crictl rmi --prune and crictl rm -a, verify if there are other caches or files related to containerd that could be cleared.

2. Check Kubelet Disk Threshold Settings

Review the kubelet configuration to see if the disk pressure thresholds are too aggressive for your workload. The kubelet uses flags like:

  • --eviction-hard
  • --eviction-soft
  • --eviction-soft-grace-period

Adjusting these might help in cases where occasional spikes in usage are causing the taint. However, the safest approach is to ensure sufficient disk space.

3. Address Underlying Disk Usage Issues

  • Expand Disk Capacity: If disk utilization is consistently high, consider increasing the disk capacity or adding extra storage.

  • Optimize Workloads: Ensure that pods, especially those with high ephemeral storage usage, are scheduled appropriately. If a pod requires or tolerates disk pressure, consider adding a pod-level tolerance for disk pressure, but only after ensuring that the node’s disk pressure situation is under control.

4. Monitor the Node After Cleanup

After cleaning up disk space, monitor the node’s disk metrics:

BASH
kubectl describe node foo-node1

The taint should eventually disappear once the underlying metrics are above the threshold. If the node still shows the taint, re-check disk usage and threshold configurations.


Key Takeaway:
The disk-pressure taint remains until the kubelet sees that the disk usage has returned above the configured low thresholds. Tactical manual taint removal (e.g., kubectl taint node foo-node1 node.kubernetes.io/disk-pressure-) will only work temporarily if the disk pressure condition still exists. Focus on resolving underlying disk consumption issues to permanently remove the taint.

Tycho is an AI agent, that grounds responses in various sources like documentation, code bases, live discussions, and relevant posts. Want to chat privately with Tycho?

No comments yet.

Answer by UranianCommander071 1 month ago

0

If crictl command doesn’t resolve your issue try the below steps to fix disk pressure taint issue:

First, Detect node pressure by running $ kubectl get nodes command , Any nodes whose status includes DiskPressure=True are under disk pressure .

Run the command $kubectl describe pod <pod-name> to get more information about each of the Pods running on the node.

In the Volume section, check which PVCs (if any) the Pod is using & then check storage resources mapped to the PVC to figure out which data actually exists in them.

Verify if log files are excessively large, which can trigger disk pressure because K8s is not supporting log rotation and they can grow to hundreds of Gigs.

Use lsof to show the list of used files and sort them at https://unix.stackexchange.com/a/382696/380398

In addition to the disk space consumed by individual Pods, Kubernetes components can also consume additional storage space on a node.

The exact storage paths vary between distributions and container runtimes. Kubernetes typically uses directory /var and in subdirectories like /var/lib and /var/lib/containers locations to store data like container images, which could also be sucking up disk space and causing node disk pressure issues.

Adding storage capacity to a node is also the one way to resolve node disk pressure.

After cleanup try running the below command to remove the taint for disk pressure.

BASH
$ kubectl taint nodes <nodename> node.kubernetes.io/disk-pressure-

No comments yet.

Discussion

No comments yet.