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

Fix default CoreDNS TTL #48128

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ The Corefile configuration includes the following [plugins](https://coredns.io/p
* [kubernetes](https://coredns.io/plugins/kubernetes/): CoreDNS will reply to DNS queries
based on IP of the Services and Pods. You can find [more details](https://coredns.io/plugins/kubernetes/)
about this plugin on the CoreDNS website.
- `ttl` allows you to set a custom TTL for responses. The default is 5 seconds.
- `ttl` allows you to set a custom TTL for responses. The default is 30 seconds.
Copy link
Contributor

@sftim sftim Sep 29, 2024

Choose a reason for hiding this comment

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

Thanks, but the default CoreDNS TTL is not 30 seconds. In other words, CoreDNS has a different default value for this field (I think it's 5 seconds).

Try this:

Suggested change
- `ttl` allows you to set a custom TTL for responses. The default is 30 seconds.
- `ttl` allows you to set a maximum time to live (TTL) for responses. The example above
configures CoreDNS to cache records for up to 30 seconds, even if it receives a
record with a longer TTL.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, but the default CoreDNS TTL is not 30 seconds.

I know; sorry for shortening the PR title too much. I meant default TTL when deployed through kubeadm (ref: https://github.com/search?q=repo%3Akubernetes%2Fkubernetes%20%2Fttl%20%5B%5Cd%5D%2F&type=code)


But then I completely misunderstood the current wording. My bad.

I was trying to figure out the default TTL inside a K8S cluster and thought the snippet and the text got out of sync.


How about The default configuration above [...]?

The minimum TTL allowed is 0 seconds, and the maximum is capped at 3600 seconds.
Setting TTL to 0 will prevent records from being cached.
- The `pods insecure` option is provided for backward compatibility with `kube-dns`.
Expand Down