Allow choosing min CPU architecture for master VM on gce

This commit is contained in:
Shyam Jeedigunta 2017-11-28 11:55:44 +01:00
parent 24042ce6e7
commit b5c1eff375
4 changed files with 14 additions and 0 deletions

View File

@ -30,6 +30,7 @@ REGIONAL_KUBE_ADDONS=${REGIONAL_KUBE_ADDONS:-true}
NODE_SIZE=${NODE_SIZE:-n1-standard-2}
NUM_NODES=${NUM_NODES:-3}
MASTER_SIZE=${MASTER_SIZE:-n1-standard-$(get-master-size)}
MASTER_MIN_CPU_ARCHITECTURE=${MASTER_MIN_CPU_ARCHITECTURE:-} # To allow choosing better architectures.
MASTER_DISK_TYPE=pd-ssd
MASTER_DISK_SIZE=${MASTER_DISK_SIZE:-$(get-master-disk-size)}
MASTER_ROOT_DISK_SIZE=${MASTER_ROOT_DISK_SIZE:-$(get-master-root-disk-size)}

View File

@ -30,6 +30,7 @@ REGIONAL_KUBE_ADDONS=${REGIONAL_KUBE_ADDONS:-true}
NODE_SIZE=${NODE_SIZE:-n1-standard-2}
NUM_NODES=${NUM_NODES:-3}
MASTER_SIZE=${MASTER_SIZE:-n1-standard-$(get-master-size)}
MASTER_MIN_CPU_ARCHITECTURE=${MASTER_MIN_CPU_ARCHITECTURE:-} # To allow choosing better architectures.
MASTER_DISK_TYPE=pd-ssd
MASTER_DISK_SIZE=${MASTER_DISK_SIZE:-$(get-master-disk-size)}
MASTER_ROOT_DISK_SIZE=${MASTER_ROOT_DISK_SIZE:-$(get-master-root-disk-size)}

View File

@ -79,6 +79,11 @@ function create-master-instance-internal() {
preemptible_master="--preemptible --maintenance-policy TERMINATE"
fi
local min_cpu_platform=""
if [[ -n "${MASTER_MIN_CPU_ARCHITECTURE:-}" ]]; then
min_cpu_platform="--min-cpu-platform=${MASTER_MIN_CPU_ARCHITECTURE}"
fi
local network=$(make-gcloud-network-argument \
"${NETWORK_PROJECT}" "${REGION}" "${NETWORK}" "${SUBNETWORK:-}" \
"${address:-}" "${ENABLE_IP_ALIASES:-}" "${IP_ALIAS_SIZE:-}")
@ -107,6 +112,7 @@ function create-master-instance-internal() {
--disk "${disk}" \
--boot-disk-size "${MASTER_ROOT_DISK_SIZE}" \
${preemptible_master} \
${min_cpu_platform} \
${network} 2>&1); then
echo "${result}" >&2
return 0

View File

@ -94,6 +94,11 @@ function create-master-instance-internal() {
preemptible_master="--preemptible --maintenance-policy TERMINATE"
fi
local min_cpu_platform=""
if [[ -n "${MASTER_MIN_CPU_ARCHITECTURE:-}" ]]; then
min_cpu_platform="--min-cpu-platform=${MASTER_MIN_CPU_ARCHITECTURE}"
fi
local network=$(make-gcloud-network-argument \
"${NETWORK_PROJECT}" "${REGION}" "${NETWORK}" "${SUBNETWORK:-}" \
"${address:-}" "${ENABLE_IP_ALIASES:-}" "${IP_ALIAS_SIZE:-}")
@ -127,6 +132,7 @@ function create-master-instance-internal() {
--disk "${disk}" \
--boot-disk-size "${MASTER_ROOT_DISK_SIZE}" \
${preemptible_master} \
${min_cpu_platform} \
${network} 2>&1); then
echo "${result}" >&2
return 0