<p>How to set the maximum size of the log file? Or enable log rotation. 
In the documentation I have not found anything about this.</p>

<p>Or it is necessary to write a script for this?</p>

<p>I don't think kubernetes provides log rotation feature now. You can put logrotate configuration in your host machine. Something like this one:</p>

<pre><code>/var/lib/docker/containers/*/*.log {
  rotate 7
  daily
  size=10M
  compress
  missingok
  delaycompress
  copytruncate
}
</code></pre>
