Skip to content

Add --disable-coredns-log flag #20992

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

Merged
merged 1 commit into from
Jul 30, 2025

Conversation

sugymt
Copy link
Contributor

@sugymt sugymt commented Jun 29, 2025

fixes #19757

Adds the --disable-coredns-log option to cluster startup. When enabled, this option removes the log plugin from the CoreDNS ConfigMap, preventing query logs from being output to the Pod logs.


before (default)

docker@minikube:~$ sudo ls -alh /var/lib/docker/containers/cae72a53aeead8e6cdc48846c46c3703eece0960e25e2119b40ce3453c9db585/cae72a53aeead8e6cdc48846c46c3703eece0960e25e2119b40ce
3453c9db585-json.log
-rw-r----- 1 root root 263K Jun 29 17:39 /var/lib/docker/containers/cae72a53aeead8e6cdc48846c46c3703eece0960e25e2119b40ce3453c9db585/cae72a53aeead8e6cdc48846c46c3703eece0960e25e2119b40ce3453c9db585-json.log
docker@minikube:~$ sudo head -n 10 /var/lib/docker/containers/cae72a53aeead8e6cdc48846c46c3703eece0960e25e2119b40ce3453c9db585/cae72a53aeead8e6cdc48846c46c3703eece0960e25e2119b4
0ce3453c9db585-json.log
{"log":".:53\n","stream":"stdout","time":"2025-06-29T17:37:16.911204731Z"}
{"log":"[INFO] plugin/reload: Running configuration SHA512 = 05e3eaddc414b2d71a69b2e2bc6f2681fc1f4d04bcdd3acc1a41457bb7db518208b95ddfc4c9fffedc59c25a8faf458be1af4915a4a3c0d6777cb7a346bc5d86\n","stream":"stdout","time":"2025-06-29T17:37:16.911254738Z"}
{"log":"CoreDNS-1.9.3\n","stream":"stdout","time":"2025-06-29T17:37:16.911263032Z"}
{"log":"linux/amd64, go1.18.2, 45b0a11\n","stream":"stdout","time":"2025-06-29T17:37:16.911265472Z"}
{"log":"[INFO] 127.0.0.1:50578 - 11501 \"HINFO IN 8305876105755474021.8070635482691607969. udp 57 false 512\" NXDOMAIN qr,rd,ra 132 0.006369538s\n","stream":"stdout","time":"2025-06-29T17:37:16.917272287Z"}
{"log":"[INFO] 10.244.0.2:60114 - 40402 \"A IN metadata.google.internal.elastic-system.svc.cluster.local. udp 86 false 1232\" NXDOMAIN qr,aa,rd 168 0.000292824s\n","stream":"stdout","time":"2025-06-29T17:37:30.657746089Z"}
{"log":"[INFO] 10.244.0.2:57182 - 21348 \"AAAA IN metadata.google.internal.elastic-system.svc.cluster.local. udp 86 false 1232\" NXDOMAIN qr,aa,rd 168 0.000354242s\n","stream":"stdout","time":"2025-06-29T17:37:30.657778154Z"}
{"log":"[INFO] 10.244.0.2:41830 - 48782 \"A IN metadata.google.internal.svc.cluster.local. udp 71 false 1232\" NXDOMAIN qr,aa,rd 153 0.000152372s\n","stream":"stdout","time":"2025-06-29T17:37:30.657780955Z"}
{"log":"[INFO] 10.244.0.2:40259 - 35747 \"AAAA IN metadata.google.internal.svc.cluster.local. udp 71 false 1232\" NXDOMAIN qr,aa,rd 153 0.00017997s\n","stream":"stdout","time":"2025-06-29T17:37:30.657783213Z"}
{"log":"[INFO] 10.244.0.2:33894 - 8445 \"A IN metadata.google.internal.cluster.local. udp 67 false 1232\" NXDOMAIN qr,aa,rd 149 0.000131425s\n","stream":"stdout","time":"2025-06-29T17:37:30.65825304Z"}

after (--disable-coredns-log)

$ kubectl logs -n kube-system -l k8s-app=kube-dns -f
.:53
[INFO] plugin/reload: Running configuration SHA512 = eff20e86b4fd2b9878e9c34205d7ba141ff41613cbdadb71e63d4a8be6caff7d1fbccef3edfe618baf8958049a58d98ae28ea781e3e7cdf1cc90820da8e01a6d
CoreDNS-1.9.3
linux/amd64, go1.18.2, 45b0a11

Copy link

linux-foundation-easycla bot commented Jun 29, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: sugymt / name: Jun Sugimoto (2921937)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jun 29, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @sugymt!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 29, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @sugymt. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 29, 2025
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 29, 2025
@@ -957,7 +957,7 @@ func addCoreDNSEntry(runner command.Runner, name, ip string, cc config.ClusterCo
}

if cc.DisableCoreDNSLog {
sed = fmt.Sprintf("%s -e '/^ log$/d'", sed)
sed = fmt.Sprintf("%s -e '/^ log *$/d'", sed)
Copy link
Contributor

Choose a reason for hiding this comment

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

It will be easier to review if you squash this fix into the commit that added this change and force push.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I've pushed it.

@sugymt sugymt force-pushed the sugimoto-disable-coredns-logs branch from 6fc84cf to 2921937 Compare June 29, 2025 17:03
@medyagh
Copy link
Member

medyagh commented Jun 30, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 30, 2025
@medyagh
Copy link
Member

medyagh commented Jun 30, 2025

@sugymt I am curious what is the use case for this ? like what made you think about disabling it

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

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

@sugymt would u plz put in the PR description "the logs of coredns" before/after this PR ?

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 20992) |
+----------------+----------+---------------------+
| minikube start | 52.3s    | 51.8s               |
| enable ingress | 16.0s    | 15.5s               |
+----------------+----------+---------------------+

Times for minikube start: 50.9s 52.6s 52.9s 52.5s 52.7s
Times for minikube (PR 20992) start: 51.9s 50.1s 54.5s 51.7s 51.0s

Times for minikube ingress: 16.1s 15.6s 16.1s 16.6s 15.6s
Times for minikube (PR 20992) ingress: 16.0s 15.1s 15.2s 15.6s 15.6s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 20992) |
+----------------+----------+---------------------+
| minikube start | 23.7s    | 25.4s               |
| enable ingress | 13.1s    | 13.5s               |
+----------------+----------+---------------------+

Times for minikube start: 22.5s 25.0s 23.3s 23.5s 24.0s
Times for minikube (PR 20992) start: 26.4s 23.7s 25.6s 25.1s 26.1s

Times for minikube ingress: 13.3s 13.3s 13.3s 13.3s 12.4s
Times for minikube (PR 20992) ingress: 13.9s 13.3s 14.0s 12.8s 13.3s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 20992) |
+----------------+----------+---------------------+
| minikube start | 24.3s    | 23.9s               |
| enable ingress | 23.5s    | 26.0s               |
+----------------+----------+---------------------+

Times for minikube start: 24.8s 24.2s 26.1s 22.0s 24.7s
Times for minikube (PR 20992) start: 21.6s 22.1s 24.7s 26.7s 24.2s

Times for minikube ingress: 23.8s 23.3s 22.8s 23.8s 23.8s
Times for minikube (PR 20992) ingress: 22.8s 22.8s 22.8s 38.8s 22.8s

@sugymt
Copy link
Contributor Author

sugymt commented Jul 1, 2025

@medyagh I've added a description. Could you please check the issue to see what led me to need this option?
#19757 (comment)

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 30, 2025
@medyagh medyagh merged commit 14dfcee into kubernetes:master Jul 30, 2025
26 of 37 checks passed
elasticdotventures pushed a commit to elasticdotventures/minikube that referenced this pull request Aug 6, 2025
pavansaikrishna78 pushed a commit to pavansaikrishna78/minikube that referenced this pull request Aug 11, 2025
pavansaikrishna78 pushed a commit to pavansaikrishna78/minikube that referenced this pull request Aug 18, 2025
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable CoreDNS log plugin
6 participants