Skip to content

How to config containerd log size limit and rotate? #4830

Closed

Description

@hillbun

How to config containerd log size limit and rotate?

similar to docker daemon.json file

    "log-driver": "json-file",
    "log-opts": {
        "max-size": "50m",
        "max-file": "3"
    }

Activity

  1. sober-wang commented on Dec 12, 2020

    @sober-wang

    I think your question is How to config containerd log-driver and limit these container stdout log.
    Because docker have multiple types log-driver .eg: Fluentd , json-file, sys-log. But I'm not found the log-driver config about container stdou or stderr in contianerd config default.

  2. hillbun commented on Dec 13, 2020

    @hillbun
    Author

    @sober-wang

    Do you mean it is unlimited log size?

  3. windniw commented on Dec 13, 2020

    @windniw

    @hillbun yes.
    If you run container with crictl or kubelet, it wiil be logged in json format. But there is no config for logrotate. You could add a cron job on the machine like logrotate -v -f /etc/logrotate.conf to support max-log-size and max-log-file

  4. kevpar commented on Dec 14, 2020

    @kevpar
    Member

    Here's a previous issue on this: #3351

    As was mentioned there: containerd is lower level than Docker, and does not itself provide log plugins or container output log rotation functionality. containerd simply provides plumbing for the orchestrator to receive the container output, so it would be up to the orchestrator (e.g. kubelet) to do the right thing.

  5. cpuguy83 commented on Dec 15, 2020

    @cpuguy83
    Member

    Yes, Kubelet is responsible for handling these logs: kubernetes/kubernetes#59898

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions