Skip to content

Commit cfb527b

Browse files
committed
Disable IPv6, provide escalated priviledges to the devcontainer - approach#2 (works).
1 parent ce278a5 commit cfb527b

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

scripts/test-local.sh

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,37 @@ if [ ! -f "kind/k8s/kind-config.yaml" ]; then
110110
# exit 1
111111
fi
112112

113+
# Attempt to create cluster traditionally
113114
if kind create cluster \
114115
--config kind/k8s/kind-config.yaml \
115116
--name egitangu-local-cluster \
116117
--image kindest/node:v1.28.0 \
117118
--wait 60s; then
118119
log_success "Kind cluster created successfully ${TICK}"
119120
else
120-
log_error "Failed to create Kind cluster ${CROSS}"
121-
# exit 1
121+
log_warning "Traditional cluster creation failed, trying experimental approach..."
122+
123+
# Create docker network for Kind with IPv4 only (suppress errors if network exists)
124+
docker network create -d bridge \
125+
-o "com.docker.network.bridge.enable_ip_masquerade=true" \
126+
-o "com.docker.network.driver.mtu=1500" \
127+
--subnet=172.18.0.0/16 \
128+
kind 2>/dev/null || true
129+
130+
# Try experimental way
131+
export KIND_EXPERIMENTAL_PROVIDER=docker
132+
if KIND_EXPERIMENTAL_DOCKER_NETWORK=kind \
133+
DOCKER_DEFAULT_PLATFORM=linux/amd64 \
134+
kind create cluster \
135+
--config kind/k8s/kind-config.yaml \
136+
--name egitangu-local-cluster \
137+
--image kindest/node:v1.28.0 \
138+
--wait 60s; then
139+
log_success "Kind cluster created successfully using experimental approach ${TICK}"
140+
else
141+
log_error "Failed to create Kind cluster using both approaches ${CROSS}"
142+
exit 1
143+
fi
122144
fi
123145

124146
# Verify cluster is ready

0 commit comments

Comments
 (0)