Skip to content

Commit 2f075d2

Browse files
authored
Merge pull request #22446 from jayunit100/patch-3
Update statefulset.md
2 parents a30090a + 3e33f7f commit 2f075d2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

content/en/docs/concepts/workloads/controllers/statefulset.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,18 @@ As each Pod is created, it gets a matching DNS subdomain, taking the form:
141141
`$(podname).$(governing service domain)`, where the governing service is defined
142142
by the `serviceName` field on the StatefulSet.
143143

144+
Depending on how DNS is configured in your cluster, you may not be able to look up the DNS
145+
name for a newly-run Pod immediately. This behavior can occur when other clients in the
146+
cluster have already sent queries for the hostname of the Pod before it was created.
147+
Negative caching (normal in DNS) means that the results of previous failed lookups are
148+
remembered and reused, even after the Pod is running, for at least a few seconds.
149+
150+
If you need to discover Pods promptly after they are created, you have a few options:
151+
152+
- Query the Kubernetes API directly (for example, using a watch) rather than relying on DNS lookups.
153+
- Decrease the time of caching in your Kubernetes DNS provider (tpyically this means editing the config map for CoreDNS, which currently caches for 30 seconds).
154+
155+
144156
As mentioned in the [limitations](#limitations) section, you are responsible for
145157
creating the [Headless Service](/docs/concepts/services-networking/service/#headless-services)
146158
responsible for the network identity of the pods.
@@ -278,5 +290,3 @@ StatefulSet will then begin to recreate the Pods using the reverted template.
278290
* Follow an example of [deploying Cassandra with Stateful Sets](/docs/tutorials/stateful-application/cassandra/).
279291
* Follow an example of [running a replicated stateful application](/docs/tasks/run-application/run-replicated-stateful-application/).
280292

281-
282-

0 commit comments

Comments
 (0)