Skip to content

Commit

Permalink
Merge pull request kubernetes#3199 from a-robinson/disk-size
Browse files Browse the repository at this point in the history
Allow for easily specifying the type and size of minion disks on GCE.
  • Loading branch information
thockin committed Jan 5, 2015
2 parents 40808bc + 8b38453 commit c908fbe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cluster/gce/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions cluster/gce/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions cluster/gce/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,16 @@ 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
if ! gcloud compute instances create "$1" \
--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}" \
Expand Down Expand Up @@ -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...
Expand Down

0 comments on commit c908fbe

Please sign in to comment.