kubernetes how to set the maximum size of the log file?

8/18/2016

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?

-- batazor
coreos
docker
kubernetes
logging
rotation

1 Answer

12/23/2016

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
}
-- Derek Chen
Source: StackOverflow