Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v1.26] changes for cri-dockerd #98

Merged
merged 1 commit into from
Aug 25, 2023
Merged

Conversation

kinarashah
Copy link
Member

Issue: rancher/rancher#39819
Internal dockershim never supported rotating logs for docker, see https://github.com/kubernetes/kubernetes/blob/v1.23.15/pkg/kubelet/kubelet.go#L643.

With introduction of CRI, it was expected for runtimes to add their own support and kubelet relies on runtimeService for the actual log. See https://github.com/kubernetes/kubernetes/blob/84e1fc493a47446df2e155e70fca768d2653a398/pkg/kubelet/logs/container_log_manager.go#L252.

Because internal dockershim didn't support this feature, cri-dockerd doesn't have support for it either. It logs error that is seen constantly in logs: https://github.com/Mirantis/cri-dockerd/blob/master/core/logs.go#L47 Mirantis/cri-dockerd#35 (comment)

Workaround:
As mentioned in rancher/rancher#39819 (comment), rely on docker's max-size flag to perform log rotation.
Note that it is required for this flag to be <= kubelet's container-log-max-size because it controls how often kubelet's rotateLogs is called. https://github.com/kubernetes/kubernetes/blob/v1.26.7/pkg/kubelet/logs/container_log_manager.go#L263

Solution:
Use stub log manager for cri-dockerd runtime to maintain the internal dockershim's behavior. This will ensure the behavior remains same <v1.24 and users can configure docker daemon's capabilities to rotate logs.

@YohannHammad
Copy link

Useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants