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?

  • Mount current directory as volume in Docker on Windows 10
  • How to migrate an existing service docker?
  • Cannot authenticate to Docker in Elastic Beanstalk through S3
  • Laravel Docker cannot execute PostgreSQL pg_restore
  • Why does boot2docker ip fail?
  • How to inspect a docker image in docker hub?
  • Bamboo Mesos Marathon
  • celery pdb running inside docker container with changing listening port
  • Error while run Sphinx search service
  • What are conceptual and practical differences between containers (i.e. docker) and encapsulated packages (i.e. flatpack, snap)?
  • Copy multiple directories with one command
  • What is the relation between docker0 and eth0?
  • 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.