# PodEviction：节点处于条件：[DiskPressure]。

- **ID:** `cloud/azure-aks-pod-eviction-disk-pressure`
- **领域:** cloud
- **类别:** resource_error
- **错误码:** `DiskPressure`
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

AKS节点的本地磁盘使用率超过85%阈值，触发kubelet驱逐Pod以释放空间，通常是由于容器日志、镜像或emptyDir卷填满了OS磁盘。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| AKS 1.28 | active | — | — |
| AKS 1.29 | active | — | — |
| Kubernetes 1.27 | active | — | — |
| Azure Linux Node Image 2024 | active | — | — |

## 解决方案

1. ```
   Evict pods gracefully and clean up unused container images on the node: `kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data`, then SSH into node and run `docker system prune -a --force` or `nerdctl system prune -a --force` (depending on container runtime). Uncordon node: `kubectl uncordon <node-name>`.
   ```
2. ```
   Configure log rotation for container logs by setting up a DaemonSet with fluent-bit or filebeat to ship logs and limit local storage, or adjust kubelet config: `--container-log-max-size=10Mi --container-log-max-files=3`.
   ```

## 无效尝试

- **** — Pods are recreated by controllers and the node remains under DiskPressure, causing immediate re-eviction. (95% 失败率)
- **** — New nodes may also fill up quickly if the root cause (e.g., log rotation misconfiguration) is not fixed; existing node remains under pressure. (80% 失败率)
- **** — Restarting kubelet does not free disk space; it only temporarily resets the pressure condition until usage rechecked. (90% 失败率)
