Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make AWS node sizes dynamic in the number of nodes. #16131

Merged
merged 1 commit into from Oct 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 25 additions & 2 deletions cluster/aws/config-default.sh
Expand Up @@ -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
Expand Down
29 changes: 27 additions & 2 deletions cluster/aws/config-test.sh
Expand Up @@ -15,10 +15,35 @@
# 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:-2}

# 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


# Because regions are globally named, we want to create in a single region; default to us-east-1
AWS_S3_REGION=${AWS_S3_REGION:-us-east-1}

Expand Down
6 changes: 5 additions & 1 deletion cluster/aws/options.md
Expand Up @@ -29,7 +29,7 @@ AWS_S3_REGION is useful for people that want to control their data location, bec

**MASTER_SIZE**, **MINION_SIZE**

The instance type to use for creating the master/minion. Defaults to t2.micro.
The instance type to use for creating the master/minion. Defaults to auto-sizing based on the number of nodes (see below).

For production usage, we recommend bigger instances, for example:

Expand All @@ -38,6 +38,10 @@ export MASTER_SIZE=c4.large
export MINION_SIZE=r3.large
```

If you don't specify master and minion sizes, the scripts will attempt to guess the correct size of the master and worker nodes based on `${NUM_MINIONS}`.
In particular for clusters less than 50 nodes it will
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should say "Currently, for clusters" instead of "In particular for clusters". That way we're saying the default-value is "something vaguely sensible for the version you're installing", rather than claiming that <50 always be t2.micro etc. In particular, I'm thinking about whether if we changed to the m3 series whether that would be considered a change that we should highlight, or just part of our regular ongoing improvements

Just a nit though; this looks great.

use a `t2.micro` for clusters between 50 and 150 nodes it will use a `t2.small` and for clusters with greater than 150 nodes it will use a `t2.medium`.

Please note: `kube-up` utilizes ephemeral storage available on instances for docker storage. EBS-only instance types do not
support ephemeral storage and will default to docker storage on the root disk which is usually only 8GB.
EBS-only instance types include `t2`, `c4`, and `m4`.
Expand Down
3 changes: 3 additions & 0 deletions docs/getting-started-guides/aws.md
Expand Up @@ -91,6 +91,9 @@ export INSTANCE_PREFIX=k8s
...
```

The scripts will attempt to guess the correct size of the master and worker nodes based on `${NUM_MINIONS}`, in particular for clusters less than 50 nodes it will
use a `t2.micro` for clusters between 50 and 150 nodes it will use a `t2.small` and for clusters with greater than 150 nodes it will use a `t2.medium`.

It will also try to create or reuse a keypair called "kubernetes", and IAM profiles called "kubernetes-master" and "kubernetes-minion".
If these already exist, make sure you want them to be used here.

Expand Down