Commit Graph

36 Commits

Author SHA1 Message Date
Austin Siu 67deeee5b9 Fix guard on instance type overrides when requirements present 2022-08-08 14:45:12 -05:00
Austin Siu b79be36f7f Improve nil checking, some naming, replace json logic for requirement translation with field-setting 2022-08-08 14:45:11 -05:00
Austin Siu fed54b5715 Support attribute-based instance selection for AWS 2022-08-08 14:45:10 -05:00
Johannes Würbach 285500ed2c
feat(aws): reduce auto-discovery API calls 2022-07-21 17:11:18 +02:00
David Morrison ad93c8ba91 log failure information 2022-03-03 10:41:55 -08:00
David Morrison 8d608ac03e check all scaling activities instead of just the last one 2022-03-02 13:02:24 -08:00
David Morrison aebd984e43 fix linting errors 2022-03-02 11:34:17 -08:00
David Morrison 8ac87b3f34 early abort if we get a failed scaling activity event from AWS 2022-03-02 11:34:17 -08:00
David Morrison a0ae713fba convert registeredAsgs to a map 2022-03-02 11:34:16 -08:00
Austin Siu a1faeddbe7 Use DescribeInstanceTypes API to get EC2 instance type details 2021-12-07 00:05:36 -06:00
Benjamin Pineau 4d6aac7a06 implement GetOptions for AWS
Support per-ASG (scaledown) settings as permited by the
cloudprovider's interface GetOptions() method.
2021-11-15 15:24:41 +01:00
David Morrison 27d96021a4 handle LT/LC cache misses 2021-09-22 21:38:26 -07:00
David Morrison 4999f05f3d cache ASG InstanceTypes for AWS 2021-09-22 15:17:26 -07:00
Benjamin Pineau b21211cf5b Metrics for AWS API calls
Provide metrics for AWS API calls; helps identifying slowness,
throttling causes, and errors surges.
2021-07-04 14:17:15 +02:00
Michael Cristina 7e37e5bd6e Reduce logging when creating placeholder instances 2020-12-10 17:59:15 -06:00
Maciek Pytel 655b4081f4 Migrate to klog v2 2020-06-05 17:22:26 +02:00
Julien Balestra 716836acde cluster-autoscaler/aws: batch launch config query and ttl cache
Signed-off-by: Julien Balestra <julien.balestra@datadoghq.com>
2020-02-19 16:36:42 +01:00
Kubernetes Prow Robot e536639168
Merge pull request #2480 from jaypipes/rework-placeholder-match
[aws] use simple string prefix placeholder match
2019-10-28 10:20:43 -07:00
Jay Pipes 72f936e956 [aws] use simple string prefix placeholder match
Addresses a [comment on PR2235](https://github.com/kubernetes/autoscaler/pull/2235/files#r313536379)
to remove the unnecessary use of a regex with a simpler string prefix
matching for placeholder names.
2019-10-24 12:50:30 -04:00
Ace Eldeib d63067e70b refactor: move aws discovery config 2019-10-17 05:19:11 -07:00
Jay Pipes 54f3076b24 ensure valid AWS LaunchTemplate version
The LaunchTemplateSpecification.Version is a pointer to
string. When the pointer is nil, EC2 AutoScaling API considers the value
to be "$Default", however aws.StringValue(ltSpec.Version) will return an
empty string (which is not considered the same as "$Default" or a nil
string pointer. So, in order to not pass an empty string as the version
for the launch template when we communicate with the EC2 AutoScaling API
using the information in the launchTemplate, we store the string
"$Default" when the ltSpec.Version is a nil pointer.

Issue #1728
2019-09-25 09:52:40 -04:00
Johannes Würbach b6bd06cb66
AWS: Decrease current size only once 2019-09-07 09:24:27 +02:00
Kubernetes Prow Robot 8d9010e11e
Merge pull request #2248 from Jeffwan/mixed_instance_policy
Add MixedInstancesPolicy struct to better handle instance type
2019-08-26 02:40:20 -07:00
Łukasz Piątkowski 8d9b81caaa correctly handle lack of capacity of AWS spot ASGs 2019-08-19 12:43:53 +02:00
Jiaxin Shan 8d567eb102 Add MixedInstancesPolicy struct to better handle instance type
Ensures that when MixedInstancePolicy is used in an AWS AutoScalingGroup, that
the buildInstanceType() AWS manager method returns an instance type after looking
at the MixedInstancePolicy.LaunchTemplateSpecification. The buildInstanceType()
method is called in numerous places including on cluster scale up actions.

Also adds documentation highlighting the minimum version of cluster autoscaler
supporting MixedInstancePolicy is 1.14
2019-08-15 14:40:11 -07:00
Andrew Hemming a6ce5d9d45
Added handler for ASG MixedInstancesPolicy
* Enables the ASG instance type to be determined from the LaunchTemplate
default
* This makes it possible to have a mixed instance ASG, relying on AWS'
native logic for things like on-demand launch priority and spot
instances etc
2019-04-12 12:11:41 +01:00
CodeLingo Bot c0603afdeb Fix error format strings according to best practices from CodeReviewComments
Fix error format strings according to best practices from CodeReviewComments

Fix error format strings according to best practices from CodeReviewComments

Reverted incorrect change to with error format string

Signed-off-by: CodeLingo Bot <hello@codelingo.io>
Signed-off-by: CodeLingoBot <hello@codelingo.io>
Signed-off-by: CodeLingo Bot <hello@codelingo.io>
Signed-off-by: CodeLingo Bot <bot@codelingo.io>

Resolve conflict

Signed-off-by: CodeLingo Bot <hello@codelingo.io>
Signed-off-by: CodeLingoBot <hello@codelingo.io>
Signed-off-by: CodeLingo Bot <hello@codelingo.io>
Signed-off-by: CodeLingo Bot <bot@codelingo.io>

Fix error strings in testscases to remedy failing tests

Signed-off-by: CodeLingo Bot <bot@codelingo.io>

Fix more error strings to remedy failing tests

Signed-off-by: CodeLingo Bot <bot@codelingo.io>
2019-01-11 09:10:31 +13:00
Łukasz Osipiuk 016bf7fc2c Use k8s.io/klog instead github.com/golang/glog 2018-11-26 17:30:31 +01:00
Łukasz Osipiuk 991873c237 Fix gofmt errors 2018-11-26 15:39:59 +01:00
Johannes Würbach 14120a43ff
AWS: Improved balancing 2018-11-06 22:38:47 +01:00
Sheldon Kwok 4bd79c8353 Add EC2 Launch Template handler for ASG instanceType fetching 2018-07-17 02:54:35 -07:00
Johannes Würbach 0598749d76
AWS: Reduce amount of API calls
Instead of doing auto-discovery, nodes per ASG and target size per ASG separately, fetch all
of those ASG details in a single request on each Refresh() with maximum 10 seconds granularity.
2018-05-21 10:31:03 +02:00
Johannes 'fish' Ziemke cf27c68d73 Allow scaling to zero on AWS 2018-02-13 16:13:40 +01:00
Nic Cope e96ff07896 Replace the Polling Autoscaler
Node group discovery is now handled by cloudprovider.Refresh() in all cases.
Additionally, explicit node groups can now be used alongside autodiscovery.
2017-12-11 13:09:56 -08:00
mmerrill3 77aa30a5c1 Fixing for issue 252 by implementing a channel to stop the go routine 2017-11-01 11:00:00 -04:00
Yusuke Kuoka dfb481b19f cluster-autoscaler: Fix excessive calls to DescribeAutoScalingGroup
By caching AWS refs for nodes/EC2 instances already known to be not in any of ASGs managed by cluster-autoscaler(CA).

Please beware of the edge case - this method is safe as long as users don't attach nodes by calling AttachInstances API after CA cached them. I believe, even if it was necessary, a warning in the documentation about the edge case is enough for now. If we really need to support the case, I will submit an another PR to invalidate the cache periodically so that CA can detect the formerly cached nodes are attached to ASG(s).

Also refactor AwsManager for less complexity by extracting types, accordingly to the discussion made [here](https://github.com/kubernetes/autoscaler/pull/46#discussion_r117912687)
2017-06-22 16:55:15 +09:00