crc-org / snc

Single Node Cluster creation scripts for OpenShift 4.x as used by CodeReady Containers
https://crc.dev
Apache License 2.0
100 stars 49 forks source link

Add kubelet config file to update containerLogMaxSize and containerLogMaxFiles setting #866

Open praveenkumar opened 3 months ago

praveenkumar commented 3 months ago

By default log size is set to 50Mi and number of log file is set to 5 but for local developement we might not need those setting where disk space is also critical. In this PR we are changing it to 5Mi and 2 respectivily.

During the testing (generation of 4.15.3 bundle) I can see reduction of ~ 200 MB to final bundle size.

openshift-ci[bot] commented 3 months ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from praveenkumar. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/crc-org/snc/blob/release-4.15/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
cfergeau commented 3 months ago

Is there a way to delete these logs after we've done the install?

praveenkumar commented 3 months ago

Is there a way to delete these logs after we've done the install?

It is not only we delete after done with install but also have same setting for end users which might don't know why the disk is taking that much space (if default is 50MiB which means every container can able to put that much logs before rotate).

praveenkumar commented 3 months ago

/retest

openshift-ci[bot] commented 3 months ago

@praveenkumar: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-microshift 7f89a9d34068cae28636a3cb6e90d12da6d63e43 link true /test e2e-microshift
ci/prow/e2e-snc 7f89a9d34068cae28636a3cb6e90d12da6d63e43 link true /test e2e-snc

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
cfergeau commented 3 months ago

but also have same setting for end users which might don't know why the disk is taking that much space (if default is 50MiB which means every container can able to put that much logs before rotate).

Hard to tell how many logs users will expect/need to debug their apps. Once the bundle is downloaded, in my opinion disk space is less of a problem. Is 5MiB / 2 log files something which is recommended somewhere?

praveenkumar commented 3 months ago

but also have same setting for end users which might don't know why the disk is taking that much space (if default is 50MiB which means every container can able to put that much logs before rotate).

Is 5MiB / 2 log files something which is recommended somewhere?

No, It is not someone recommended, default for k8s is 10MiB and 5 logs file. This is just provide user a better disk management when using CRC (since it is development use case).

cfergeau commented 3 months ago

This is just provide user a better disk management when using CRC (since it is development use case).

For a development use case, you want logs.

praveenkumar commented 3 months ago

This is just provide user a better disk management when using CRC (since it is development use case).

For a development use case, you want logs.

We are not removing the logs just reducing size of the file. The question here is what would be right size one which provided by openshift 50MiB or one which we think should be good enough to get all the details.

cfergeau commented 3 months ago

This is just provide user a better disk management when using CRC (since it is development use case).

For a development use case, you want logs.

We are not removing the logs just reducing size of the file. The question here is what would be right size one which provided by openshift 50MiB or one which we think should be good enough to get all the details.

I honestly have no idea what a good size would be, which is why I'd favour sticking with the defaults, and only deleting all logs before bundle generation.