Skip to content

Commit

Permalink
Merge pull request kubernetes#88 from ctso/master
Browse files Browse the repository at this point in the history
Allow the use of a network other than default
  • Loading branch information
brendandburns committed Jun 12, 2014
2 parents 54d1e7e + 76e0391 commit 77cbfab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions cluster/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ MINION_SIZE=g1-small
NUM_MINIONS=4
# gcloud will expand this to the latest supported image.
IMAGE=debian-7-backports
NETWORK=default
INSTANCE_PREFIX=kubernetes
MASTER_NAME="${INSTANCE_PREFIX}-master"
MASTER_TAG="${INSTANCE_PREFIX}-master"
Expand Down
1 change: 1 addition & 0 deletions cluster/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ MINION_SIZE=g1-small
NUM_MINIONS=2
# gcloud will expand this to the latest supported image.
IMAGE=debian-7-backports
NETWORK=default
INSTANCE_PREFIX="e2e-test-${USER}"
MASTER_NAME="${INSTANCE_PREFIX}-master"
MASTER_TAG="${INSTANCE_PREFIX}-master"
Expand Down
15 changes: 10 additions & 5 deletions cluster/kube-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ echo "Starting VMs and configuring firewalls"
gcloud compute firewalls create --quiet ${MASTER_NAME}-https \
--project ${PROJECT} \
--target-tags ${MASTER_TAG} \
--allow tcp:443 &
--allow tcp:443 \
--network ${NETWORK} &

gcloud compute instances create ${MASTER_NAME}\
--project ${PROJECT} \
Expand All @@ -73,7 +74,8 @@ gcloud compute instances create ${MASTER_NAME}\
--tags ${MASTER_TAG} \
--no-scopes \
--restart-on-failure \
--metadata-from-file startup-script=${KUBE_TEMP}/master-start.sh &
--metadata-from-file startup-script=${KUBE_TEMP}/master-start.sh \
--network ${NETWORK} &

GCLOUD_VERSION=$(gcloud version | grep compute | cut -f 2 -d ' ')

Expand All @@ -94,21 +96,24 @@ for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
--no-scopes \
--restart-on-failure \
--can-ip-forward \
--metadata-from-file startup-script=${KUBE_TEMP}/minion-start-${i}.sh &
--metadata-from-file startup-script=${KUBE_TEMP}/minion-start-${i}.sh \
--network ${NETWORK} &

# 'gcloud compute' past 2014.06.11 breaks the way we are specifying
# --next-hop-instance and there is no way to be compatible with both versions.
if [[ $GCLOUD_VERSION < "2014.06.11" ]]; then
gcloud compute routes create ${MINION_NAMES[$i]} \
--project ${PROJECT} \
--destination-range ${MINION_IP_RANGES[$i]} \
--next-hop-instance ${ZONE}/instances/${MINION_NAMES[$i]} &
--next-hop-instance ${ZONE}/instances/${MINION_NAMES[$i]} \
--network ${NETWORK} &
else
gcloud compute routes create ${MINION_NAMES[$i]} \
--project ${PROJECT} \
--destination-range ${MINION_IP_RANGES[$i]} \
--next-hop-instance ${MINION_NAMES[$i]} \
--next-hop-instance-zone ${ZONE} &
--next-hop-instance-zone ${ZONE} \
--network ${NETWORK} &
fi
done

Expand Down

0 comments on commit 77cbfab

Please sign in to comment.