Skip to content

Commit

Permalink
docs: autoscaling: Add note about ASG tags for scaling up from 0
Browse files Browse the repository at this point in the history
When the cluster-autoscaler adds a new node to a group, it grabs an
existing node in the group and builds a "template" to launch a new node
identical to the one it grabbed from the group.

However, when scaling up from 0 there aren't any live nodes to reference to
build this template.  Instead, the cluster-autoscaler relies on tags in the
ASG to build the new node template.  This can cause unexpected behavior if
the pods triggering the scale-out are using node selectors or taints; CA
doesn't have sufficient information to decide if a new node launched in the
group will satisfy the request.

The long and short of it is that for CA to do its job properly we must tag
our ASGs corresponding to our labels and taints.  Add a note in the docs
about this since scaling up from 0 is a fairly common use case.

References:

  - kubernetes/autoscaler#2418
  - eksctl-io#1066
  • Loading branch information
mgalgs committed Oct 24, 2019
1 parent 75b0ccb commit 5d67f80
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions site/content/usage/04-autoscaling.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,43 @@ eksctl create cluster --asg-access
Once cluster is running, you will need to install [cluster autoscaler][] itself. This flag also sets `k8s.io/cluster-autoscaler/enabled`
and `k8s.io/cluster-autoscaler/<clusterName>` tags, so nodegroup discovery should work.

### Scaling up from 0

If you'd like to be able to scale your node group up from 0 and you have
labels and/or taints defined on your nodegroups you'll need corresponding
tags on your ASGs. You can do this with the `tags` key on your node group
definitions. For example, given a node group with the following labels and
taints:

```yaml
nodeGroups:
- name: ng1-public
...
labels:
my-cool-label: pizza
taints:
feaster: "true:NoSchedule"
```
You would need to add the following ASG tags:
```yaml
nodeGroups:
- name: ng1-public
...
labels:
my-cool-label: pizza
taints:
feaster: "true:NoSchedule"
tags:
k8s.io/cluster-autoscaler/node-template/label/my-cool-label: pizza
k8s.io/cluster-autoscaler/node-template/taint/feaster: "true:NoSchedule"
```
You can read more about this
[here](https://github.com/weaveworks/eksctl/issues/1066) and
[here](https://github.com/kubernetes/autoscaler/issues/2418).
[cluster autoscaler]: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md
### Zone-aware Auto Scaling
Expand Down

0 comments on commit 5d67f80

Please sign in to comment.