Skip to content

Commit 0cb89b1

Browse files
committed
submariner: Restart CoreDNS after lighthouse configures clusterset.local
subctl join patches the Corefile, but CoreDNS reload defaults to ~30s. Until then clusterset.local misses the lighthouse forward and NXDOMAIN is cached, delaying the first connectivity test after cluster start. Restart CoreDNS once lighthouse is ready so the forward applies immediately. Restarting CoreDNS adds 2 seconds delay to submariner start, but the test takes now 20 seconds instead of 75 seconds. The actual connectivity check takes now 0.1s instead of 54s (500x times faster). Example run: 2026-08-07 04:33:49,876 DEBUG [hub/0] Restarting CoreDNS on cluster 'dr1' 2026-08-07 04:33:49,937 DEBUG [hub/0] deployment.apps/coredns restarted 2026-08-07 04:33:49,938 DEBUG [hub/0] Restarting CoreDNS on cluster 'dr2' 2026-08-07 04:33:50,011 DEBUG [hub/0] deployment.apps/coredns restarted 2026-08-07 04:33:50,012 DEBUG [hub/0] Waiting for CoreDNS on cluster 'dr1' 2026-08-07 04:33:50,066 DEBUG [hub/0] Waiting for deployment "coredns" rollout to finish: 0 of 1 updated replicas are available... 2026-08-07 04:33:51,255 DEBUG [hub/0] deployment "coredns" successfully rolled out 2026-08-07 04:33:51,257 DEBUG [hub/0] Waiting for CoreDNS on cluster 'dr2' 2026-08-07 04:33:51,333 DEBUG [hub/0] Waiting for deployment "coredns" rollout to finish: 0 of 1 updated replicas are available... 2026-08-07 04:33:51,654 DEBUG [hub/0] deployment "coredns" successfully rolled out ... 2026-08-07 04:34:06,531 DEBUG [hub/0] Accessing 'nginx.ns1.svc.clusterset.local.' in cluster 'dr2' 2026-08-07 04:34:06,635 DEBUG [hub/0] Access completed in 0.104 seconds 2026-08-07 04:34:06,635 DEBUG [hub/0] Accessing 'nginx.ns2.svc.clusterset.local.' in cluster 'dr1' 2026-08-07 04:34:06,730 DEBUG [hub/0] Access completed in 0.095 seconds Assisted-by: Cursor/Cursor Grok 4.5 High Signed-off-by: Nir Soffer <nsoffer@redhat.com>
1 parent 9e37b02 commit 0cb89b1

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

test/drenv/addons/submariner/start.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ def start(broker, *clusters):
3535
for cluster in clusters:
3636
wait_for_cluster(cluster)
3737

38+
for cluster in clusters:
39+
restart_coredns(cluster)
40+
41+
for cluster in clusters:
42+
wait_for_coredns(cluster)
43+
3844

3945
def deploy_broker(broker):
4046
print(f"Waiting until broker '{broker}' is ready")
@@ -106,6 +112,33 @@ def wait_for_cluster(cluster):
106112
wait_for_deployments(cluster, CLUSTER_DEPLOYMENTS, NAMESPACE)
107113

108114

115+
def restart_coredns(cluster):
116+
"""
117+
Reload cluster CoreDNS after lighthouse has patched the Corefile.
118+
119+
CoreDNS reload defaults to ~30s; until then clusterset.local queries miss
120+
the lighthouse forward and NXDOMAIN is cached.
121+
"""
122+
print(f"Restarting CoreDNS on cluster '{cluster}'")
123+
kubectl.rollout(
124+
"restart",
125+
"deployment/coredns",
126+
"--namespace=kube-system",
127+
context=cluster,
128+
)
129+
130+
131+
def wait_for_coredns(cluster):
132+
print(f"Waiting for CoreDNS on cluster '{cluster}'")
133+
kubectl.rollout(
134+
"status",
135+
"deployment/coredns",
136+
"--namespace=kube-system",
137+
timeout=60,
138+
context=cluster,
139+
)
140+
141+
109142
def wait_for_deployments(cluster, names, namespace):
110143
for name in names:
111144
deployment = f"deploy/{name}"

0 commit comments

Comments
 (0)