Skip to content

Commit 10b54a2

Browse files
committed
OSDOCS-3860: add dns cache tuning
1 parent f345e92 commit 10b54a2

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

modules/nw-dns-cache-tuning.adoc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Module included in the following assemblies:
2+
// * networking/dns-operator.adoc
3+
4+
:_content-type: PROCEDURE
5+
[id="nw-dns-cache-tuning_{context}"]
6+
= Tuning the CoreDNS cache
7+
8+
You can configure the maximum duration of both successful or unsuccessful caching, also known as positive or negative caching respectively, done by CoreDNS. Tuning the duration of caching of DNS query responses can reduce the load for any upstream DNS resolvers.
9+
10+
.Procedure
11+
12+
. Edit the DNS Operator object named `default` by running the following command:
13+
+
14+
[source,terminal]
15+
----
16+
$ oc edit dns.operator.openshift.io/default
17+
----
18+
19+
. Modify the time-to-live (TTL) caching values:
20+
+
21+
.Configuring DNS caching
22+
[source,yaml]
23+
----
24+
apiVersion: operator.openshift.io/v1
25+
kind: DNS
26+
metadata:
27+
name: default
28+
spec:
29+
cache:
30+
successTTL: 1h <1>
31+
denialTTL: 0.5h10m <2>
32+
----
33+
+
34+
<1> The string value `1h` is converted to its respective number of seconds by CoreDNS. If this field is omitted, the value is assumed to be `0s` and the cluster uses the internal default value of `900s` as a fallback.
35+
<2> The string value can be a combination of units such as `0.5h10m` and is converted to its respective number of seconds by CoreDNS. If this field is omitted, the value is assumed to be `0s` and the cluster uses the internal default value of `30s` as a fallback.
36+
+
37+
[WARNING]
38+
====
39+
Setting TTL fields to low values could lead to an increased load on the cluster, any upstream resolvers, or both.
40+
====

networking/dns-operator.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ include::modules/nw-dns-operator-logs.adoc[leveloffset=+1]
2727
include::modules/nw-dns-loglevel.adoc[leveloffset=+1]
2828

2929
include::modules/nw-dns-operatorloglevel.adoc[leveloffset=+1]
30+
31+
include::modules/nw-dns-cache-tuning.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)