added preemptible flag in gcloud compute instance-templates create

This commit is contained in:
hokutosei
2015-08-07 06:47:10 +00:00
committed by Hokutosei
parent f53e0ff5a8
commit 3bcfdab649
2 changed files with 6 additions and 1 deletions

View File

@@ -398,6 +398,10 @@ function create-node-template {
fi
local attempt=1
local preemptible_minions=""
if [[ "${PREEMPTIBLE_MINION}" == "true" ]]; then
preemptible_minions="--preemptible --maintenance-policy TERMINATE"
fi
while true; do
echo "Attempt ${attempt} to create ${1}" >&2
if ! gcloud compute instance-templates create "$1" \
@@ -408,7 +412,7 @@ function create-node-template {
--image-project="${MINION_IMAGE_PROJECT}" \
--image "${MINION_IMAGE}" \
--tags "${MINION_TAG}" \
--network "${NETWORK}" \
--network "${NETWORK}" ${preemptible_minions} \
$2 \
--can-ip-forward \
--metadata-from-file "$3","$4" >&2; then