From 8b3845350184cc274e4242c68ff99d4c840e2e18 Mon Sep 17 00:00:00 2001 From: Alex Robinson Date: Sat, 3 Jan 2015 16:56:54 -0800 Subject: [PATCH] Allow for easily specifying the type and size of minion disks on GCE. Issue #3192 --- cluster/gce/config-default.sh | 2 ++ cluster/gce/config-test.sh | 2 ++ cluster/gce/util.sh | 6 ++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cluster/gce/config-default.sh b/cluster/gce/config-default.sh index 4061edff570..c5d111a22a1 100755 --- a/cluster/gce/config-default.sh +++ b/cluster/gce/config-default.sh @@ -21,6 +21,8 @@ ZONE=${KUBE_GCE_ZONE:-us-central1-b} MASTER_SIZE=n1-standard-1 MINION_SIZE=n1-standard-1 NUM_MINIONS=${NUM_MINIONS:-4} +MINION_DISK_TYPE=pd-standard +MINION_DISK_SIZE=10GB # TODO(dchen1107): Filed an internal issue to create an alias # for containervm image, so that gcloud will expand this # to the latest supported image. diff --git a/cluster/gce/config-test.sh b/cluster/gce/config-test.sh index 947a67c4d7c..88565d4a23d 100755 --- a/cluster/gce/config-test.sh +++ b/cluster/gce/config-test.sh @@ -21,6 +21,8 @@ ZONE=${KUBE_GCE_ZONE:-us-central1-b} MASTER_SIZE=g1-small MINION_SIZE=g1-small NUM_MINIONS=${NUM_MINIONS:-2} +MINION_DISK_TYPE=pd-standard +MINION_DISK_SIZE=10GB # TODO(dchen1107): Filed an internal issue to create an alias # for containervm image, so that gcloud will expand this # to the latest supported image. diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 77ea3881208..dd77dbf4c97 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -296,7 +296,7 @@ function create-route { # $1: The name of the instance. # $2: The scopes flag. # $3: The minion start script. -function create-instance { +function create-minion { detect-project local attempt=0 while true; do @@ -304,6 +304,8 @@ function create-instance { --project "${PROJECT}" \ --zone "${ZONE}" \ --machine-type "${MINION_SIZE}" \ + --boot-disk-type "${MINION_DISK_TYPE}" \ + --boot-disk-size "${MINION_DISK_SIZE}" \ --image-project="${IMAGE_PROJECT}" \ --image "${IMAGE}" \ --tags "${MINION_TAG}" \ @@ -466,7 +468,7 @@ function kube-up { ) > "${KUBE_TEMP}/minion-start-${i}.sh" local scopes_flag="${scope_flags[@]}" - create-instance "${MINION_NAMES[$i]}" "${scopes_flag}" "startup-script=${KUBE_TEMP}/minion-start-${i}.sh" & + create-minion "${MINION_NAMES[$i]}" "${scopes_flag}" "startup-script=${KUBE_TEMP}/minion-start-${i}.sh" & if [ $i -ne 0 ] && [ $((i%5)) -eq 0 ]; then echo Waiting for creation of a batch of instances at $i...