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

The old pod log file is not deleted from the /var/log/pods/ directory #125079

Open
Black-max12138 opened this issue May 23, 2024 · 14 comments
Open
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage.

Comments

@Black-max12138
Copy link

What happened?

In the /var/log/pods/ directory, many old log files are not deleted in a timely manner. As a result, the disk space is used up.
1709001460262

What did you expect to happen?

I think there should be only 1 old log file in this path.

How can we reproduce it (as minimally and precisely as possible)?

I don't know how this happened.

Anything else we need to know?

No response

Kubernetes version

$ kubectl version
# 1.28

Cloud provider

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, ...) and versions (if applicable)

@Black-max12138 Black-max12138 added the kind/bug Categorizes issue or PR as related to a bug. label May 23, 2024
@k8s-ci-robot k8s-ci-robot added needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 23, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@pranav-pandey0804
Copy link

pranav-pandey0804 commented May 23, 2024

/sig node

@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 23, 2024
@pranav-pandey0804
Copy link

/sig storage

@k8s-ci-robot k8s-ci-robot added the sig/storage Categorizes an issue or PR as relevant to SIG Storage. label May 23, 2024
@pranav-pandey0804
Copy link

/remove-sig node

@k8s-ci-robot k8s-ci-robot removed the sig/node Categorizes an issue or PR as relevant to SIG Node. label May 23, 2024
@pranav-pandey0804
Copy link

hi @Black-max12138 , thanks for reporting the issue,
could you verify if the containerLogMaxSize and containerLogMaxFiles settings are correctly configured or not?

@pranav-pandey0804
Copy link

If these settings are not configured correctly then kubelet may not delete the old log files efficiently because these setting dictate the maximum size each log file can reach before being rotated and the max log files that can be retained !

@pranav-pandey0804
Copy link

you can also refer to this page for more details !

@Black-max12138
Copy link
Author

hi @Black-max12138 , thanks for reporting the issue, could you verify if the containerLogMaxSize and containerLogMaxFiles settings are correctly configured or not?

containerLogMaxSize and containerLogMaxFiles are using default values

@Black-max12138
Copy link
Author

If these settings are not configured correctly then kubelet may not delete the old log files efficiently because these setting dictate the maximum size each log file can reach before being rotated and the max log files that can be retained !

So what is the possibility of this happening if the parameters are set correctly?

@tamilselvan1102
Copy link

Generally once the POD is terminated & a new instance is started, the log files associated with the old pod get deleted.

@jsafrane
Copy link
Member

AFAIK container logs are managed by sig-node, not by sig-storage
/sig node
/remove-sig node

@k8s-ci-robot k8s-ci-robot added the sig/node Categorizes an issue or PR as relevant to SIG Node. label May 23, 2024
@k8s-ci-robot
Copy link
Contributor

@jsafrane: Those labels are not set on the issue: sig/node

In response to this:

AFAIK container logs are managed by sig-node, not by sig-storage
/sig node
/remove-sig node

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@tamilselvan1102
Copy link

hi @Black-max12138 , thanks for reporting the issue, could you verify if the containerLogMaxSize and containerLogMaxFiles settings are correctly configured or not?

By default, Kubernetes truncates the pod’s container log if it reaches 10 MB.
if you want to change the file size, you can set through containerLogMaxSize parameter in the kubelet configuration.
These parameters are not related to delete/persist the log file.

@SergeyKanzhelev SergeyKanzhelev added this to Triage in SIG Node Bugs May 29, 2024
@haircommander
Copy link
Contributor

/assign @harche

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage.
Projects
Development

No branches or pull requests

7 participants