kubernetes 集羣在查看日誌
kubectl logs -f <pod>
報錯
failed to watch file "/var/log/pods/xxxx/xxxxxx.log": no space left on deviceroot
可能是節點 out of inotify watches **節點** **node** **不是master** **是pod運行的物理節點**
可以使用命令查看情況
sysctl fs.inotify.max_user_watches
默認是
fs.inotify.max_user_watches = 8192
可以嘗試將數值改大
vi /etc/sysctl.conf
在文件中添加或者修改成自己想要的值,一般直接翻倍,一直到沒有問題不報錯了
fs.inotify.max_user_watches = 2097152
修改完後執行命令,讀取修改後的值
/sbin/sysctl -p
再次查看就沒有錯了
kubectl logs -f <pod>