Skip to content

Commit

Permalink
GKE: Create network if needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbforbes committed Jan 8, 2015
1 parent 5f67b20 commit 67f3414
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions cluster/gke/config-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ CLUSTER_API_VERSION="${CLUSTER_API_VERSION:-}"
# TODO(mbforbes): Actually plumb this through; this currently only works
# because we use the 'default' network by default.
NETWORK="${NETWORK:-default}"
NETWORK_RANGE="${NETWORK_RANGE:-10.240.0.0/16}"
GCLOUD="${GCLOUD:-gcloud}"
GCLOUD_CONFIG_DIR="${GCLOUD_CONFIG_DIR:-${HOME}/.config/gcloud/kubernetes}"
ENABLE_CLUSTER_DNS=false
Expand Down
8 changes: 8 additions & 0 deletions cluster/gke/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ function verify-prereqs() {
function kube-up() {
echo "... in kube-up()" >&2
detect-project >&2

# Make the specified network if we need to.
if ! gcloud compute networks describe "${NETWORK}" &>/dev/null; then
echo "Creating new network: ${NETWORK}" >&2
gcloud compute networks create "${NETWORK}" --range "${NETWORK_RANGE}"
fi

# Bring up the cluster.
"${GCLOUD}" preview container clusters create "${CLUSTER_NAME}" \
--zone="${ZONE}" \
--project="${PROJECT}" \
Expand Down

0 comments on commit 67f3414

Please sign in to comment.