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

audit log: set default max size #16543

Merged
merged 1 commit into from
May 22, 2023

Conversation

spowelljr
Copy link
Member

I was looking at some of our CI machines and the audit logging was failing:

E0519 17:42:33.138427  334137 logFile.go:53] failed to close the audit log: invalid argument

Then I looked at the size of the file:

-rw-r--r-- 1 perf perf 651M May 19 17:44 /home/perf/.minikube/logs/audit.json

It has over 1.6 million lines of audits:

1621891 /home/perf/.minikube/logs/audit.json

This PR sets the default number of audit lines to 1000 if not explicitly set by the user.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 19, 2023
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 19, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh, spowelljr

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -121,7 +121,11 @@ func LogCommandEnd(id string) error {
}

func getStartIndex(entryCount int) int {
maxEntries := viper.GetInt(config.MaxAuditEntries)
// default to 1000 entries
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm... I wonder what is the best thing to do to if the audilog was already more than that in the files...should delete it ?

Copy link
Member Author

@spowelljr spowelljr May 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will truncate the existing file, so if it's currently 2000 lines, it will truncate it to the last 1000

@medyagh
Copy link
Member

medyagh commented May 20, 2023

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label May 20, 2023
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 16543) |
+----------------+----------+---------------------+
| minikube start | 53.4s    | 52.9s               |
| enable ingress | 28.2s    | 28.1s               |
+----------------+----------+---------------------+

Times for minikube start: 51.9s 53.2s 53.0s 54.3s 54.6s
Times for minikube (PR 16543) start: 51.8s 55.2s 51.1s 52.3s 54.1s

Times for minikube ingress: 27.7s 28.2s 28.2s 28.6s 28.2s
Times for minikube (PR 16543) ingress: 27.7s 28.2s 28.1s 28.6s 28.1s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 16543) |
+----------------+----------+---------------------+
| minikube start | 22.5s    | 23.4s               |
| enable ingress | 20.6s    | 21.0s               |
+----------------+----------+---------------------+

Times for minikube start: 21.5s 23.9s 21.2s 24.5s 21.5s
Times for minikube (PR 16543) start: 21.6s 21.7s 24.0s 25.3s 24.6s

Times for minikube ingress: 20.8s 20.8s 20.8s 20.8s 19.9s
Times for minikube (PR 16543) ingress: 21.3s 20.8s 21.3s 20.8s 20.8s

docker driver with containerd runtime

+-------------------+----------+---------------------+
|      COMMAND      | MINIKUBE | MINIKUBE (PR 16543) |
+-------------------+----------+---------------------+
| minikube start    | 22.3s    | 21.8s               |
| ⚠️  enable ingress | 26.1s    | 31.4s ⚠️             |
+-------------------+----------+---------------------+

Times for minikube (PR 16543) start: 20.8s 23.3s 20.6s 21.1s 23.2s
Times for minikube start: 22.9s 21.2s 22.9s 20.4s 24.2s

Times for minikube ingress: 31.3s 30.3s 19.3s 18.4s 31.3s
Times for minikube (PR 16543) ingress: 31.3s 30.4s 31.4s 30.3s 33.4s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Hyperkit_macOS TestStoppedBinaryUpgrade/Upgrade (gopogh) 5.77 (chart)
QEMU_macOS TestImageBuild/serial/BuildWithBuildArg (gopogh) 27.52 (chart)

To see the flake rates of all tests by environment, click here.

@spowelljr spowelljr merged commit 0426b38 into kubernetes:master May 22, 2023
@spowelljr spowelljr deleted the setMaxEntryDfrault branch May 22, 2023 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants