Skip to content

Make k8s-log logging driver compatible with logging forwarding tools #20199

@outcoldman

Description

@outcoldman

Feature request description

Current issue with the podman and conman that they create just one logging file for each container. And when it reaches maxsize - the file gets truncated and start writing from the beginning. (Not 100% sure if it truncates or replaces, just saw one of the issues where person confirmed that it truncates).
Now think if fluentd or similar tool is constantly reading this file, what is going to happen. Forwarding tools (readers) are always can be behind on reading, just because some customers can write 100MB/s in 10 minutes, and their Log Aggregation tools can be lagging in accepting that much data. Especially if they have patterns where there is burst of data for an hour, and after that everything is calming down, so the log forwarding tools can catch up on logs.
In case of truncating - this can cause a significant issue, where reader can be close to the end of the file, and when file truncates, can just lose data.
Replacing the file is slightly better option, but still does not give much benefits. Think about upgrading container with fluentd (or just a simple restart). If the new file getting created before the fluentd restart, and fluentd would not finish the file before the restart, the data in this file will be lost again.

Suggest potential solution

Similar to k8s/openshift/docker - there is should be a maxsize and maxfile options. So you can tell container runtime to keep 5 rotated files and each should be within the size of 100MB. In that case logging forwarding tools can keep the reference based on the inode/idev which file is which, and continue forwarding logs based on the location in the specific file.

Have you considered any alternatives?

journald is definitely an option, but with my experience with high amount of logs (10MB/s) we saw with some customers that journald can be corrupted. I have not seen that often, but have seen it enough.

Additional context

Let me know if you have any additional questions. I feel like it could be a very common request. I see some of our customers have decided to switch to podman in production instead of using docker, and they don't want to switch to Kubernetes/OpenShift, so this seems like a feature where Podman customers will benefit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    jetsam"...cargo that is cast overboard to lighten the load in time of distress"kind/featureCategorizes issue or PR as related to a new feature.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions