@@ -52,6 +52,10 @@ public class GlobalSpec extends ValidableSpec<GlobalSpec> implements WithDefault
52
52
53
53
public static final String DEFAULT_TLS_SECRET_NAME = "pulsar-tls" ;
54
54
55
+
56
+ /** See CRD docs for more info about this setting. */
57
+ public static final String DNS_NDOTS = "4" ;
58
+
55
59
private static final Supplier <TlsConfig > DEFAULT_TLS_CONFIG = () -> TlsConfig .builder ()
56
60
.enabled (false )
57
61
.caPath ("/etc/ssl/certs/ca-certificates.crt" )
@@ -91,7 +95,7 @@ public class GlobalSpec extends ValidableSpec<GlobalSpec> implements WithDefault
91
95
private static final Supplier <PodDNSConfig > DEFAULT_DNS_CONFIG = () -> new PodDNSConfigBuilder ()
92
96
.withOptions (new PodDNSConfigOptionBuilder ()
93
97
.withName ("ndots" )
94
- .withValue ("4" )
98
+ .withValue (DNS_NDOTS )
95
99
.build ())
96
100
.build ();
97
101
@@ -162,7 +166,14 @@ public static class GlobalStorageConfig {
162
166
private String clusterName ;
163
167
@ JsonPropertyDescription ("Pulsar cluster components names." )
164
168
private Components components ;
165
- @ JsonPropertyDescription ("DNS config for each pod." )
169
+ @ JsonPropertyDescription ("""
170
+ Override default DNS config for each pod. Note that because we use fully qualified service names for intra
171
+ cluster networking with Pulsar components, we set the ndots value to 4 (the default is 5). This prevents
172
+ unnecessary DNS lookups for the fully qualified service names that would be guaranteed to result in NXDOMAIN.
173
+ For example, the name 'pulsar-broker.pulsar.svc.cluster.local' has 4 dots, so it would be resolved directly
174
+ instead of appending the configured search domains.
175
+ More info here: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config.
176
+ """ )
166
177
private PodDNSConfig dnsConfig ;
167
178
@ JsonPropertyDescription ("""
168
179
The domain name for your kubernetes cluster.
0 commit comments