Skip to content

Commit

Permalink
Fix Calico IP addresses
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Popov <[email protected]>
  • Loading branch information
Vladimir Popov committed Nov 2, 2021
1 parent eada09b commit 0074903
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/create-kubernetes-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ SSH_CONFIG="ssh_config"
SSH_OPTS="-F ${SSH_CONFIG} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i ${sshkey}"

if [[ "$CALICO" == "on" ]]; then # calico
CALICO_MASTER_IP="10.0.0.$(( GITHUB_RUN_NUMBER % 100 ))"
CALICO_WORKER_IP="10.0.0.$(( GITHUB_RUN_NUMBER % 100 + 1 ))"
# Use a new 10.0.0.${base_ip}/30 subnet to prevent IP addresses collisions
# ${base_ip} should be <= 248, because 10.0.0.252/30 subnet is reserved for manual testing
base_ip=$(( GITHUB_RUN_NUMBER % 63 * 4 ))

CALICO_MASTER_IP="10.0.0.$(( base_ip + 1 ))"
CALICO_WORKER_IP="10.0.0.$(( base_ip + 2 ))"
CALICO_SUBNET_MASK="30"
fi

Expand Down

0 comments on commit 0074903

Please sign in to comment.