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

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?

  • How do you share volumes between Docker containers in an Elastic Beanstalk application?
  • Using ecryptfs inside Docker without --privileged. Appropriate value for --device?
  • Kubernetes Pod fails with CrashLoopBackOff
  • can not push files to remote host
  • Go-CD won't npm install
  • Integration tests for continuous delivery using docker
  • How do you set encrypted Travis env variables in docker?
  • Docker shell 'ls -l' indenting newlines [duplicate]
  • Chef Test Kitchen verify file exists inside Docker container
  • Docker : How to configure Internet -> firewall container -> webserver container
  • Extending docker official postgres image
  • Unable to use variable substitution in docker-compose
  • One Solution collect form web for “kubernetes how to set the maximum size of the log file?”

    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
    }
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.