How does kubernetes get the imagefs.available and nodefs.available eviction signals?
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Kubernetes is a robust container orchestration platform that automates the deployment, scaling, and management of containerized applications. For efficient resource management, Kubernetes implements a mechanism to evict pods from nodes to manage resource exhaustion. One critical aspect of this is handling storage resources, which is done using eviction signals like `imagefs.available` and `nodefs.available`.
Understanding the Eviction Mechanism
The eviction process in Kubernetes relies on monitoring resource availability and deciding when to take action to recover from resource starvation. This is crucial to ensure that the workloads remain healthy and the node stays operational. Kubernetes uses eviction signals to trigger the eviction of pods. Two of the key eviction signals related to storage are:
- `imagefs.available`: This indicates the available storage space for storing container images on the node.
- `nodefs.available`: This represents the available storage space on the root filesystem of the node, which is used by the operating system and daemon processes along with Kubernetes.
How Kubernetes Monitors Storage
Kubernetes leverages the Kubelet, a key component that runs on each node, to monitor the node's resource usage continuously. The Kubelet is responsible for communicating with the container runtime and retrieving metrics related to available storage. For storage monitoring, this involves:
- Configuring Thresholds: Admins can set soft and hard thresholds on eviction signals. A "soft" eviction threshold allows for a grace period before evicting, while a "hard" threshold triggers immediate eviction when crossed.
- Polling Interval: The Kubelet polls the node's storage usage at regular intervals. By default, this is every 10 seconds.
- Calculating Storage Usage:
- For `imagefs.available`, the Kubelet will query the container runtime to get metrics on available space on the storage medium holding the container images.
- For `nodefs.available`, it polls the root filesystem's available space using standard system tools and interfaces.
- `imagefs.available`: 15% hard threshold and 20% soft threshold with a grace period of 1 minute.
- `nodefs.available`: 10% hard threshold and 15% soft threshold with a grace period of 2 minutes.
Related reading
- how does kubernetes guarantee reliability of kube proxy and kubelet?
- How does Kubernetes' scheduler work?
- How does one add a node or nodes to an existing YugaByte DB CE cluster?
- How does the GKE metadata server work in Workload Identity
- How health check of Kubernetes work with Istio?
- How I create new namespace in Kubernetes
- How if I interact with different kubernetes clusters in different terminals sessions with out having to switch contexts all the the time?
- How is Docker Swarm different than Kubernetes?

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.