https://github.com/stakater/scaler
A tool to modify auto scaling groups.
https://github.com/stakater/scaler
asg auto-scaling-group aws scaler stakater
Last synced: 10 months ago
JSON representation
A tool to modify auto scaling groups.
- Host: GitHub
- URL: https://github.com/stakater/scaler
- Owner: stakater
- License: apache-2.0
- Created: 2019-01-29T12:30:36.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T14:39:55.000Z (over 2 years ago)
- Last Synced: 2025-08-10T12:55:02.893Z (11 months ago)
- Topics: asg, auto-scaling-group, aws, scaler, stakater
- Language: Go
- Homepage: https://stakater.com/opensource
- Size: 5.39 MB
- Stars: 11
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#  Scaler
[](https://goreportcard.com/report/github.com/stakater/scaler)
[](http://godoc.org/github.com/stakater/scaler)
[](https://github.com/stakater/scaler/releases/latest)
[](https://github.com/stakater/scaler/releases/latest)
[](https://hub.docker.com/r/stakater/scaler/)
[](https://hub.docker.com/r/stakater/scaler/)
[](https://microbadger.com/images/stakater/scaler)
[](https://microbadger.com/images/stakater/scaler)
[](LICENSE)
[](http://stakater.com/?utm_source=scaler&utm_medium=github)
## Problem
Scale cluster at pre-defined schedule e.g at night and weekends to save cost.
## Scaler
Scaler can modify auto scaling groups to change cluster size at pre-defined schedule
## Usage
Scaler can be used to modify max, min and desired capacity of an auto scaling group.
Scaler supports the following flags
|Short Flag|Long Flag|Type|Description|
|----------|---------|----|-----------|
|-d | --desired | int | Desired no of instances (Required)|
|-h | --help | | Help for Scaler|
|-m | --max | int | Maximum no of instances (Required)|
|-i | --min | int | Minimum no of instances (Required)|
|-p | --provider | string | Cloud provider to user. Valid Values (aws)|
|-r | --region | string | Region in which auto scaling group exists (Required)|
|-a | --roleArn | string | Arn of role to assume (Required)|
|-n | --scalerName | string | Name of Auto Scaling group (Required)|
## Run
Scale can be run by passing arguments to the published image. e.g
```
docker run -it docker.io/stakater/scaler:0.0.1 --roleArn arn:aws:iam::449074299682:role/nodes.stackator.com --region us-west-2 --max 0 --min 0 --desired 0 --provider aws --scalerName nodes.stackator.com
```
## Use Case
Scaler can be used in combination with Cronjob to control the cluster size during different times. e.g You can bring down your cloud cost by keeping the servers shut down on weekends
A sample configuration of kubernetes cronjob can be found [here](cronjob/example.yaml).
## Adding Support for Cloud Providers
[Provider](internal/pkg/providers/provider.go) can be implemented to modify auto scaling groups on other cloud providers e.g Azure, Google Cloud etc. If new parameters are needed then they can be added by modifying Scaler Options struct in [common.go](internal/pkg/cmd/common/common.go). The values will automatically be available in the Init method of new implementation of [Provider](internal/pkg/providers/provider.go)
## Help
### Have a question?
File a GitHub [issue](https://github.com/stakater/Scaler/issues), or send us an [email](mailto:hello@stakater.com).
### Talk to us on Slack
Join and talk to us on Slack for discussing Reloader
[](https://slack.stakater.com/)
[](https://stakater-community.slack.com/messages/C018HUU9J2F)