Make AWS node sizes dynamic in the number of nodes.

This commit is contained in:
Brendan Burns
2015-10-22 14:33:27 -07:00
parent d3862d453f
commit d32e713b77
4 changed files with 60 additions and 5 deletions

View File

@@ -15,10 +15,33 @@
# limitations under the License.
ZONE=${KUBE_AWS_ZONE:-us-west-2a}
MASTER_SIZE=${MASTER_SIZE:-t2.micro}
MINION_SIZE=${MINION_SIZE:-t2.micro}
MASTER_SIZE=${MASTER_SIZE:-}
MINION_SIZE=${MINION_SIZE:-}
NUM_MINIONS=${NUM_MINIONS:-4}
# Dynamically set node sizes so that Heapster has enough space to run
if [[ -z ${MINION_SIZE} ]]; then
if (( ${NUM_MINIONS} < 50 )); then
MINION_SIZE="t2.micro"
elif (( ${NUM_MINIONS} < 150 )); then
MINION_SIZE="t2.small"
else
MINION_SIZE="t2.medium"
fi
fi
# Dynamically set the master size by the number of nodes, these are guesses
# TODO: gather some data
if [[ -z ${MASTER_SIZE} ]]; then
if (( ${NUM_MINIONS} < 50 )); then
MASTER_SIZE="t2.micro"
elif (( ${NUM_MINIONS} < 150 )); then
MASTER_SIZE="t2.small"
else
MASTER_SIZE="t2.medium"
fi
fi
# Optional: Set AWS_S3_BUCKET to the name of an S3 bucket to use for uploading binaries
# (otherwise a unique bucket name will be generated for you)
# AWS_S3_BUCKET=kubernetes-artifacts