Remove rsyslogd, syslog-ng and logrotate
Our personal/test clusters often run out of disk space (at least over the 80% limit which k8s considers as disk pressure and start trying to evict pods).
My cluster had 3.4G of logs in /var/log
:
root@oas:~# ls -alSh /var/log | head
total 3.4G
-rw-r----- 1 root adm 2.5G May 10 00:00 user.log.1
-rw-r----- 1 root adm 189M May 10 00:00 messages.1
-rw-r----- 1 root adm 128M May 3 00:02 user.log.2.gz
-rw-rw---- 1 root utmp 105M Apr 30 23:59 btmp.1
-rw-r----- 1 root adm 89M May 11 11:03 user.log
-rw-r----- 1 root adm 62M May 11 00:00 syslog.1
-rw-rw---- 1 root utmp 45M May 11 11:03 btmp
-rw-r----- 1 root adm 40M May 11 11:03 messages
-rw-r----- 1 root adm 37M May 8 00:00 syslog.4.gz
I propose to
- remove
rsyslogd
andlogrotate
and *only` use systemd-journald for logging, since it has great support for limiting it storage - Enable journald persistence and limit storage size to ~0.5gb.
- Don't write to
/var/log/OpenAppStack/rke.log
but to journald instead, usingsystemd-cat
.
Edited by Varac