DevOps|k8s 驱逐 磁盘空间不足

线上环境运行一段时候后,发现pod被驱逐,磁盘空间不足,暂时先将默认的资源限制调低,然后再排查服务问题

https://kubernetes.io/zh/docs/concepts/scheduling-eviction/node-pressure-eviction/#hard-eviction-thresholds

https://www.cnblogs.com/Dev0ps/p/12133531.html

https://www.cnblogs.com/v-fan/p/15020517.html

具体操作:
vim /var/lib/kubelet/kubeadm-flags.env

添加:
--eviction-soft=memory.available<6%,nodefs.available<2%,imagefs.available<2% --eviction-soft-grace-period=memory.available=2m,nodefs.available=2m,imagefs.available=2m --eviction-max-pod-grace-period=30 --eviction-hard=memory.available<256Mi,nodefs.available<1Gi,imagefs.available<1Gi --eviction-minimum-reclaim=memory.available=128Mi,nodefs.available=256Mi,imagefs.available=256Mi --eviction-pressure-transition-period=30s

【DevOps|k8s 驱逐 磁盘空间不足】重启:
# systemctl stop kubelet # systemctl daemon-reload # systemctl start kubelet

    推荐阅读