mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-20 09:05:26 +00:00
added preemptible flag in gcloud compute instance-templates create
This commit is contained in:
parent
f53e0ff5a8
commit
3bcfdab649
@ -26,6 +26,7 @@ MASTER_DISK_SIZE=${MASTER_DISK_SIZE:-20GB}
|
|||||||
MINION_DISK_TYPE=pd-standard
|
MINION_DISK_TYPE=pd-standard
|
||||||
MINION_DISK_SIZE=${MINION_DISK_SIZE:-100GB}
|
MINION_DISK_SIZE=${MINION_DISK_SIZE:-100GB}
|
||||||
REGISTER_MASTER_KUBELET=${REGISTER_MASTER:-true}
|
REGISTER_MASTER_KUBELET=${REGISTER_MASTER:-true}
|
||||||
|
PREEMPTIBLE_MINION=false
|
||||||
|
|
||||||
OS_DISTRIBUTION=${KUBE_OS_DISTRIBUTION:-debian}
|
OS_DISTRIBUTION=${KUBE_OS_DISTRIBUTION:-debian}
|
||||||
MASTER_IMAGE=${KUBE_GCE_MASTER_IMAGE:-container-vm-v20150806}
|
MASTER_IMAGE=${KUBE_GCE_MASTER_IMAGE:-container-vm-v20150806}
|
||||||
|
@ -398,6 +398,10 @@ function create-node-template {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
local attempt=1
|
local attempt=1
|
||||||
|
local preemptible_minions=""
|
||||||
|
if [[ "${PREEMPTIBLE_MINION}" == "true" ]]; then
|
||||||
|
preemptible_minions="--preemptible --maintenance-policy TERMINATE"
|
||||||
|
fi
|
||||||
while true; do
|
while true; do
|
||||||
echo "Attempt ${attempt} to create ${1}" >&2
|
echo "Attempt ${attempt} to create ${1}" >&2
|
||||||
if ! gcloud compute instance-templates create "$1" \
|
if ! gcloud compute instance-templates create "$1" \
|
||||||
@ -408,7 +412,7 @@ function create-node-template {
|
|||||||
--image-project="${MINION_IMAGE_PROJECT}" \
|
--image-project="${MINION_IMAGE_PROJECT}" \
|
||||||
--image "${MINION_IMAGE}" \
|
--image "${MINION_IMAGE}" \
|
||||||
--tags "${MINION_TAG}" \
|
--tags "${MINION_TAG}" \
|
||||||
--network "${NETWORK}" \
|
--network "${NETWORK}" ${preemptible_minions} \
|
||||||
$2 \
|
$2 \
|
||||||
--can-ip-forward \
|
--can-ip-forward \
|
||||||
--metadata-from-file "$3","$4" >&2; then
|
--metadata-from-file "$3","$4" >&2; then
|
||||||
|
Loading…
Reference in New Issue
Block a user