Skip to content

feat: WIP: allow user to over-scale a buffer of instances in an ASG #100

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ eks_rolling_update.py -c my-eks-cluster
| ASG_ORIG_CAPACITY_TAG | Temporary tag which will be saved to the ASG to store the state of the EKS cluster prior to update | eks-rolling-update:original_capacity |
| ASG_ORIG_MAX_CAPACITY_TAG | Temporary tag which will be saved to the ASG to store the state of the EKS cluster prior to update | eks-rolling-update:original_max_capacity |
| ASG_NAMES | List of space-delimited ASG names. Out of ASGs attached to the cluster, only these will be processed for rolling update. If this is left empty all ASGs of the cluster will be processed. | "" |
| ASG_BUFFER_INSTANCES | # of instances to overprovision the ASG by to allow workloads to scale out and soft affinity/anti-affinity rules to be respected | 0 |
| BATCH_SIZE | # of instances to scale the ASG by at a time. When set to 0, batching is disabled. See [Batching](#batching) section | 0 |
| MAX_ALLOWABLE_NODE_AGE | The max age each node allowed to be. This works with `RUN_MODE` 4 as node rolling is updating based on age of node | 6 |
| EXCLUDE_NODE_LABEL_KEYS | List of space-delimited keys for node labels. Nodes with a label using one of these keys will be excluded from the node count when scaling the cluster. | spotinst.io/node-lifecycle |
Expand Down
4 changes: 2 additions & 2 deletions eksrollup/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def validate_cluster_health(asg_name, new_desired_asg_capacity, cluster_name, pr

def scale_up_asg(cluster_name, asg, count):
asg_old_max_size = asg['MaxSize']
asg_old_desired_capacity = asg['DesiredCapacity']
desired_capacity = asg_old_desired_capacity + count
asg_old_desired_capacity = asg['DesiredCapacity'] + app_config['ASG_BUFFER_INSTANCES']
desired_capacity = asg_old_desired_capacity + count + app_config['ASG_BUFFER_INSTANCES']
asg_tags = asg['Tags']
asg_name = asg['AutoScalingGroupName']
current_capacity = None
Expand Down
1 change: 1 addition & 0 deletions eksrollup/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def str_to_bool(val):
'K8S_AUTOSCALER_REPLICAS': int(os.getenv('K8S_AUTOSCALER_REPLICAS', 2)),
'K8S_CONTEXT': os.getenv('K8S_CONTEXT', None),
'K8S_PROXY_BYPASS': str_to_bool(os.getenv('K8S_PROXY_BYPASS', False)),
'ASG_BUFFER_INSTANCES': int(os.getenv('ASG_BUFFER_INSTANCES', 0)),
'ASG_DESIRED_STATE_TAG': os.getenv('ASG_DESIRED_STATE_TAG', 'eks-rolling-update:desired_capacity'),
'ASG_ORIG_CAPACITY_TAG': os.getenv('ASG_ORIG_CAPACITY_TAG', 'eks-rolling-update:original_capacity'),
'ASG_ORIG_MAX_CAPACITY_TAG': os.getenv('ASG_ORIG_MAX_CAPACITY_TAG', 'eks-rolling-update:original_max_capacity'),
Expand Down