Merge pull request #56486 from shyamjvs/add-min-cpu-selection-option-to-kubeup

Automatic merge from submit-queue (batch tested with PRs 56392, 56486). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Allow choosing min CPU architecture for master VM on gce

To help with https://github.com/kubernetes/kubernetes/issues/55777

/cc @porridge 
/assign @wojtek-t 

/kind bug
/priority critical-urgent
/sig scalability

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-11-29 00:32:39 -08:00 committed by GitHub
commit 76287fedbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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