Commit Graph

21 Commits

Author SHA1 Message Date
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