mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Allow the use of a network other than default
This commit is contained in:
parent
54d1e7e86d
commit
76e0391ad3
@ -19,6 +19,7 @@ MINION_SIZE=g1-small
|
|||||||
NUM_MINIONS=4
|
NUM_MINIONS=4
|
||||||
# gcloud will expand this to the latest supported image.
|
# gcloud will expand this to the latest supported image.
|
||||||
IMAGE=debian-7-backports
|
IMAGE=debian-7-backports
|
||||||
|
NETWORK=default
|
||||||
INSTANCE_PREFIX=kubernetes
|
INSTANCE_PREFIX=kubernetes
|
||||||
MASTER_NAME="${INSTANCE_PREFIX}-master"
|
MASTER_NAME="${INSTANCE_PREFIX}-master"
|
||||||
MASTER_TAG="${INSTANCE_PREFIX}-master"
|
MASTER_TAG="${INSTANCE_PREFIX}-master"
|
||||||
|
@ -19,6 +19,7 @@ MINION_SIZE=g1-small
|
|||||||
NUM_MINIONS=2
|
NUM_MINIONS=2
|
||||||
# gcloud will expand this to the latest supported image.
|
# gcloud will expand this to the latest supported image.
|
||||||
IMAGE=debian-7-backports
|
IMAGE=debian-7-backports
|
||||||
|
NETWORK=default
|
||||||
INSTANCE_PREFIX="e2e-test-${USER}"
|
INSTANCE_PREFIX="e2e-test-${USER}"
|
||||||
MASTER_NAME="${INSTANCE_PREFIX}-master"
|
MASTER_NAME="${INSTANCE_PREFIX}-master"
|
||||||
MASTER_TAG="${INSTANCE_PREFIX}-master"
|
MASTER_TAG="${INSTANCE_PREFIX}-master"
|
||||||
|
@ -63,7 +63,8 @@ echo "Starting VMs and configuring firewalls"
|
|||||||
gcloud compute firewalls create --quiet ${MASTER_NAME}-https \
|
gcloud compute firewalls create --quiet ${MASTER_NAME}-https \
|
||||||
--project ${PROJECT} \
|
--project ${PROJECT} \
|
||||||
--target-tags ${MASTER_TAG} \
|
--target-tags ${MASTER_TAG} \
|
||||||
--allow tcp:443 &
|
--allow tcp:443 \
|
||||||
|
--network ${NETWORK} &
|
||||||
|
|
||||||
gcloud compute instances create ${MASTER_NAME}\
|
gcloud compute instances create ${MASTER_NAME}\
|
||||||
--project ${PROJECT} \
|
--project ${PROJECT} \
|
||||||
@ -73,7 +74,8 @@ gcloud compute instances create ${MASTER_NAME}\
|
|||||||
--tags ${MASTER_TAG} \
|
--tags ${MASTER_TAG} \
|
||||||
--no-scopes \
|
--no-scopes \
|
||||||
--restart-on-failure \
|
--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 ' ')
|
GCLOUD_VERSION=$(gcloud version | grep compute | cut -f 2 -d ' ')
|
||||||
|
|
||||||
@ -94,7 +96,8 @@ for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
|
|||||||
--no-scopes \
|
--no-scopes \
|
||||||
--restart-on-failure \
|
--restart-on-failure \
|
||||||
--can-ip-forward \
|
--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
|
# '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.
|
# --next-hop-instance and there is no way to be compatible with both versions.
|
||||||
@ -102,13 +105,15 @@ for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
|
|||||||
gcloud compute routes create ${MINION_NAMES[$i]} \
|
gcloud compute routes create ${MINION_NAMES[$i]} \
|
||||||
--project ${PROJECT} \
|
--project ${PROJECT} \
|
||||||
--destination-range ${MINION_IP_RANGES[$i]} \
|
--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
|
else
|
||||||
gcloud compute routes create ${MINION_NAMES[$i]} \
|
gcloud compute routes create ${MINION_NAMES[$i]} \
|
||||||
--project ${PROJECT} \
|
--project ${PROJECT} \
|
||||||
--destination-range ${MINION_IP_RANGES[$i]} \
|
--destination-range ${MINION_IP_RANGES[$i]} \
|
||||||
--next-hop-instance ${MINION_NAMES[$i]} \
|
--next-hop-instance ${MINION_NAMES[$i]} \
|
||||||
--next-hop-instance-zone ${ZONE} &
|
--next-hop-instance-zone ${ZONE} \
|
||||||
|
--network ${NETWORK} &
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user