kubectl logs service-search-manager-1012230234-5q8p5 --tail 10 -f
·········
failed to watch file "/var/log/pods/eaa6acfa-a851-11e9-a1f5-dec96e6313f1/service-search-manager_0.log": no space left on device
此处一定要添加-f,否则不会提示no space
在出现上述错误的节点上对任意文件执行tail命令
tail -n 100 file.txt -f
······
tail: inotify resources exhausted
tail: inotify cannot be used, reverting to polling
添加-f
查询问题的原因是:
某个运行时间长的容器占用的过多,将长时间未重启的容器停掉后,正常
通过for foo in /proc/*/fd/*; do readlink -f $foo; done | grep inotify | sort | uniq -c | sort -nr
只查询到了很少的消耗,猜测是上述命令只能查询到node的,而容器占用的inotify是查询不到的