Skip to content

Commit 25a4b8f

Browse files
committed
fix multicluster tests
1 parent cf6f984 commit 25a4b8f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

scripts/dev/setup_kind_cluster.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,33 @@ function kind_install_calico() {
212212
echo "waiting for calico-kube-controllers to roll out"
213213
kubectl rollout status --kubeconfig "${kubeconfig_path}" \
214214
--namespace kube-system deployment/calico-kube-controllers --timeout=300s
215+
216+
# Allow traffic from the Docker bridge network so that Calico acts purely as
217+
# a CNI plugin without acting as a network firewall. The kind Docker network
218+
# is always 172.18.0.0/16 (hardcoded in docker_create_kind_network). MetalLB
219+
# LoadBalancer traffic from other kind clusters arrives on eth0 sourced from
220+
# that range and is not marked by a Calico interface, so without this policy
221+
# Felix's cali-FORWARD chain drops it, breaking cross-cluster MongoDB
222+
# replica-set formation.
223+
kubectl apply --kubeconfig "${kubeconfig_path}" -f - <<EOF
224+
apiVersion: crd.projectcalico.org/v1
225+
kind: GlobalNetworkPolicy
226+
metadata:
227+
name: allow-docker-bridge-traffic
228+
spec:
229+
order: 1000
230+
selector: all()
231+
ingress:
232+
- action: Allow
233+
source:
234+
nets:
235+
- 172.18.0.0/16
236+
egress:
237+
- action: Allow
238+
destination:
239+
nets:
240+
- 172.18.0.0/16
241+
EOF
215242
}
216243

217244
function kind_install_metallb() {

0 commit comments

Comments
 (0)