In the modern cloud-native landscape, Application Load Balancers (ALBs) are the standard entry point for high-traffic web applications. However, when an underlying infrastructure event occurs—such as a sudden spike in disk usage or a network partition—the Kubernetes control plane must gracefully remove unresponsive nodes from the cluster to maintain service integrity. A common failure mode encountered by junior engineers and experienced practitioners alike is the “Node Drain Failure,” where pods remain stuck in Terminating or Pending states despite the node being marked for removal. This guide focuses specifically on troubleshooting eviction policies and disk pressure issues within an Amazon EKS environment, providing actionable steps to resolve these bottlenecks.
Understanding Node Eviction Mechanics in EKS
Before diving into fixes, it is crucial to understand how Kubernetes manages node health. The kubelet agent running on each worker node monitors local resources. If a specific threshold is exceeded—such as disk usage hitting 85%—the system triggers an eviction. This process involves draining the node: moving pods off the machine and terminating them if they cannot be rescheduled elsewhere.
In AWS EKS, this behavior is heavily influenced by the kubelet configuration and the underlying operating system (often Amazon Linux 2 or Ubuntu). A frequent point of failure arises when the eviction policy is misconfigured or when the storage class lacks proper reclaim policies, causing the disk pressure to persist indefinitely. This prevents the API server from updating the node status, leading to a “stuck” state where kubectl get nodes shows the node as NotReady, but the underlying VM is still running.
Diagnosing Disk Pressure and Eviction Logs
The first step in troubleshooting is identifying whether disk pressure is indeed the root cause. You must verify if the kubelet has detected low disk space and attempted to evict pods without success.
To check for disk pressure on a specific node, run the following command:
kubectl describe node <node-name> | grep -A 5 "DiskPressure"
If this returns DiskPressure=True, the node is under resource constraints. Next, inspect the kubelet logs to see if eviction attempts are failing silently or due to permission errors.
journalctl -u kubelet -f --no-pager | grep "eviction"
Expected Output:
You might see messages indicating that a pod cannot be evicted because it is not ready, or that the filesystem is read-only:
Failed to evict pod <pod-id>: rpc error: code = Unavailable desc = connection error.
This often indicates that the node’s file system has mounted as read-only due to excessive usage, preventing the kubelet from deleting files required for cleanup.
Resolving Read-Only Filesystem and Storage Issues
A critical scenario occurs when the root partition (/) reaches capacity. The Linux kernel automatically remounts the filesystem as read-only to prevent further corruption. In this state, even if you manually delete a pod via kubectl, the kubelet cannot write the necessary termination logs or move files to /var/lib/kubelet/pods/<pod-id>/evicted.
Step 1: Clean Up Stale Pods
Identify pods that are in a terminating state but have not been cleaned up:
kubectl get pods --field-selector=status.phase=Terminating -o wide
If the node is truly failing, you may need to force delete these resources (use with caution):
kubectl delete pod <pod-name> -n <namespace> --grace-period=0 --force
Step 2: Fix Disk Space and Permissions
Once the node has sufficient space, you must ensure the kubelet can write again. On Amazon Linux, check if /var or /var/lib is full. Clear out temporary files:
df -h /
rm -rf /tmp/*
If the filesystem was remounted read-only, it may need to be remounted as read-write after freeing space. However, in EKS managed nodes, this often requires an instance reboot or a specific fix via the AWS Console if the underlying EC2 instance OS is corrupted beyond simple commands.
Configuring Eviction Thresholds for Stability
To prevent future occurrences where disk pressure causes total node failure, you should adjust the eviction thresholds. These settings are applied to every kubelet in the cluster.
Step 3: Apply Custom Eviction Volumes
You can configure the kubelet to evict pods earlier or handle specific volumes differently. Create a ConfigMap and apply it via DaemonSet or edit the Kubelet configuration directly if you have access to the node’s user data script (User Data).
For EKS, using the AWS Systems Manager (SSM) or CloudWatch Events is often preferred for managed nodes, but direct editing of /etc/kubernetes/kubelet.conf or equivalent paths in your User Data script allows setting:
evictionHard:
imagefs.available: 15%
nodefs.available: 10%
nodefs.inodesFree: 5%
Illustrative Configuration:
By lowering the threshold, you ensure that pods are evicted before the system enters a read-only state. This gives the cluster time to reschedule workloads on healthy nodes.
Integrating Monitoring and Alerting
Proactive monitoring is essential for catching disk pressure issues before they cause drain failures. You should set up CloudWatch alarms or use Prometheus/Grafana to track kubelet_disk_pressure.
Step 4: Create a CloudWatch Alarm
- Navigate to the AWS Console > CloudWatch > Alarms.
- Create a new alarm based on the metric
KubeletDiskPressure. - Set the threshold to trigger when values exceed 80%.
- Configure an SNS topic notification to alert your team immediately.
Verification Step:
When the alarm triggers, verify that the node status changes from Ready to NotReady in the EKS dashboard. This confirms that the monitoring pipeline is correctly detecting the issue before it escalates to a full drain failure.
Common Mistakes and Best Practices for Labs and Production
When working in lab environments or production clusters, several mistakes frequently lead to persistent node drain failures:
* Ignoring Storage Class Reclaim Policies: If your storage class uses Delete but the underlying volume driver is misconfigured, data may not be released, keeping disk usage high. Always verify that volumeBindingMode and reclaim policies align with your lifecycle needs.
* Skipping IAM Role Verification: The kubelet requires specific IAM permissions to manage node metadata. If the instance profile lacks necessary permissions, eviction operations fail silently. Ensure the EKS Node IAM role has elasticloadbalancing:DescribeLoadBalancers if using ALBs for health checks.
* Assuming Automatic Recovery: Do not assume a node will self-heal after a disk cleanup. If the kubelet process is hung or the OS is corrupted, manual intervention (rebooting the instance) is necessary.
Student Practice Task:
Set up a local EKS cluster using eksctl or the AWS CloudShell. Intentionally fill the / partition with dummy files to simulate disk pressure. Observe the pod eviction sequence in the logs. Then, modify the eviction thresholds and verify that pods are evicted at a lower usage percentage. This exercise reinforces the concepts of resource management and policy configuration.
Conclusion
Node drain failures on EKS are often symptoms of deeper issues like disk pressure, read-only filesystems, or misconfigured eviction policies. By systematically checking kubelet logs, managing storage capacity, adjusting eviction thresholds, and implementing robust monitoring, engineers can maintain cluster stability. Remember that terms, availability, and specific IAM rules depend on your specific AWS region, VPC configuration, and the version of the EKS control plane you are running. Always consult the official AWS EKS documentation for the most current policy limits and security best practices before applying changes to a production environment.
Educational-use notice: This tutorial is for learning and controlled lab use only. Test carefully, use backups, and obtain authorization before making changes. Do not run unfamiliar commands on production systems. We accept no responsibility for misuse, damage, data loss, or production issues.

