From 079505023f69123c143ca53e51c327a8dc132dff Mon Sep 17 00:00:00 2001 From: Bowei Du Date: Tue, 11 Apr 2017 14:35:18 -0700 Subject: [PATCH] Use auto mode networks instead of legacy networks in GCP Use of the --range flag creates legacy networks in GCP. --- cluster/gce/util.sh | 2 +- cluster/gke/config-common.sh | 1 - cluster/gke/util.sh | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 2fe05f6c13a..bb1feb5edf2 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -650,7 +650,7 @@ function create-network() { echo "Creating new network: ${NETWORK}" # The network needs to be created synchronously or we have a race. The # firewalls can be added concurrent with instance creation. - gcloud compute networks create --project "${PROJECT}" "${NETWORK}" --range "10.240.0.0/16" + gcloud compute networks create --project "${PROJECT}" "${NETWORK}" --mode=auto fi if ! gcloud compute firewall-rules --project "${PROJECT}" describe "${CLUSTER_NAME}-default-internal-master" &>/dev/null; then diff --git a/cluster/gke/config-common.sh b/cluster/gke/config-common.sh index f64b2f5801f..18015ec92d3 100644 --- a/cluster/gke/config-common.sh +++ b/cluster/gke/config-common.sh @@ -23,7 +23,6 @@ NUM_NODES="${NUM_NODES:-3}" ADDITIONAL_ZONES="${ADDITIONAL_ZONES:-}" CLUSTER_API_VERSION="${CLUSTER_API_VERSION:-}" NETWORK="${NETWORK:-default}" -NETWORK_RANGE="${NETWORK_RANGE:-10.240.0.0/16}" FIREWALL_SSH="${FIREWALL_SSH:-${NETWORK}-allow-ssh}" GCLOUD="${GCLOUD:-gcloud}" CMD_GROUP="${CMD_GROUP:-}" diff --git a/cluster/gke/util.sh b/cluster/gke/util.sh index 95f91efb4cc..41a50503c34 100755 --- a/cluster/gke/util.sh +++ b/cluster/gke/util.sh @@ -142,7 +142,7 @@ function kube-up() { # Make the specified network if we need to. if ! "${GCLOUD}" compute networks --project "${PROJECT}" describe "${NETWORK}" &>/dev/null; then echo "Creating new network: ${NETWORK}" >&2 - with-retry 3 "${GCLOUD}" compute networks create "${NETWORK}" --project="${PROJECT}" --range "${NETWORK_RANGE}" + with-retry 3 "${GCLOUD}" compute networks create "${NETWORK}" --project="${PROJECT}" --mode=auto else echo "... Using network: ${NETWORK}" >&2 fi