#!/bin/bash ## ## Script to set up the pod routing between nodes ## . .gce_kubernetes.config echo "###################################### Set the gcloud compute region and zone ######################################" gcloud config set compute/region $GCE_REGION gcloud config set compute/zone $GCE_ZONE gcloud config set project $GCE_PROJECT echo "Compute region and zone set" KUBE_WORKERS=$((KUBE_WORKERS-1)) for ((i=0; i<=$KUBE_WORKERS; i++)); do gcloud compute routes create kubernetes-pod-route-worker-${i} --network $KUBE_NETWORK --next-hop-address $KUBE_SUBNET_ADDR.2${i} --destination-range $KUBE_POD_ADDR.${i}.0/24 done sleep 10 gcloud compute routes list --filter "network: $KUBE_NETWORK" echo "Routes should be listed above as created"