How to set the maximum size of the log file? Or enable log rotation. In the documentation I have not found anything about this.
Or it is necessary to write a script for this?
I don't think kubernetes provides log rotation feature now. You can put logrotate configuration in your host machine. Something like this one:
/var/lib/docker/containers/*/*.log {
rotate 7
daily
size=10M
compress
missingok
delaycompress
copytruncate
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With