Skip to content

Commit 6085043

Browse files
author
Vladimir Popov
committed
Fix Calico IP addresses
Signed-off-by: Vladimir Popov <[email protected]>
1 parent eada09b commit 6085043

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/create-kubernetes-cluster.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ SSH_CONFIG="ssh_config"
99
SSH_OPTS="-F ${SSH_CONFIG} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i ${sshkey}"
1010

1111
if [[ "$CALICO" == "on" ]]; then # calico
12-
CALICO_MASTER_IP="10.0.0.$(( GITHUB_RUN_NUMBER % 100 ))"
13-
CALICO_WORKER_IP="10.0.0.$(( GITHUB_RUN_NUMBER % 100 + 1 ))"
12+
# Use a new 10.0.0.${base_ip}/30 subnet to prevent IP addresses collisions
13+
# ${base_ip} should be <= 248, because 10.0.0.252/30 subnet is reserved for manual testing
14+
base_ip=$(( GITHUB_RUN_NUMBER % 63 * 4 ))
15+
16+
CALICO_MASTER_IP="10.0.0.$(( base_ip + 1 ))"
17+
CALICO_WORKER_IP="10.0.0.$(( base_ip + 2 ))"
1418
CALICO_SUBNET_MASK="30"
1519
fi
1620

0 commit comments

Comments
 (0)