Kubernetes Node Disk Pressure Threshold Adjustment (evictionHard)

When node disk usage exceeds a certain threshold, the Disk Pressure condition is triggered and pods are evicted.
Default hard thresholds (Linux-based):

  • memory.available < 100Mi
  • nodefs.available < 10%
  • imagefs.available < 15%
  • nodefs.inodesFree < 5%

In other words, by default, DiskPressure occurs when root (nodefs) reaches 90% usage and imagefs reaches 85% usage.


Adjustment

evictionHard:
  imagefs.available: 5%
  memory.available: 100Mi
  nodefs.available: 5%
  nodefs.inodesFree: 5%
  • Adjusted: All disk-related thresholds (nodefs.available, imagefs.available, nodefs.inodesFree).
  • Unchanged: memory.available remains at the default 100Mi.

Result (usage basis):

  • nodefs.available: 10% free → 5% free → threshold shifted from 90% usage to 95% usage
  • imagefs.available: 15% free → 5% free → threshold shifted from 85% usage to 95% usage
  • nodefs.inodesFree: remains the same (5%)
  • memory.available: remains the same (100Mi)

Threshold Key Descriptions

  • nodefs.available: Free space threshold of the root filesystem
  • imagefs.available: Free space threshold of the container image filesystem
  • nodefs.inodesFree: Free inode ratio threshold
  • memory.available: Free memory threshold on the node

📌 Summary: Disk usage can now reach up to 95% before DiskPressure is triggered.
→ Greatly reduces the free-space safety buffer compared to the defaults.
⚠️ Risk: Increases the chance of logging failures, updates failing, or temporary file write errors when disks fill up.


Modify kubelet Config

  1. Locate kubelet config file
ps -ef | grep kubelet

Check the path after the --config option (e.g., /etc/kubernetes/kubelet-config.yaml).

  1. Edit the file
vi /etc/kubernetes/kubelet-config.yaml

Add or update the following block:

evictionHard:
  imagefs.available: "5%"
  memory.available: "100Mi"
  nodefs.available: "5%"
  nodefs.inodesFree: "5%"

Restart kubelet

systemctl restart kubelet

Verify

kubectl describe node <node-name> | grep -A5 Conditions

Conclusion

  • Default: DiskPressure at 90% nodefs usage / 85% imagefs usage
  • After adjustment: DiskPressure delayed until 95% usage for both nodefs and imagefs
  • Apply by modifying kubelet config and restarting kubelet
ⓒ 2025 엉뚱한 녀석의 블로그 [quirky guy's Blog]. 본문 및 이미지를 무단 복제·배포할 수 없습니다. 공유 시 반드시 원문 링크를 명시해 주세요.
ⓒ 2025 엉뚱한 녀석의 블로그 [quirky guy's Blog]. All rights reserved. Unauthorized copying or redistribution of the text and images is prohibited. When sharing, please include the original source link.

🛠 마지막 수정일: 2025.09.18