Skip to content
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

AWS: cache instance requirements #6245

Conversation

alexanderConstantinescu
Copy link
Member

What type of PR is this?

We can discuss this, but I am going to go ahead and label this:

/kind bug

since it forces users of the CA to re-configure the CA with a work-around that is sub-optimal, see below for more information.

What this PR does / why we need it:

The cluster-autoscaler on AWS currently builds a representation of the Node object during each scale up/down computation. This computation is performed depending on the scan-interval defined. Parts of this computation requires setting the Node capacity. The capacity is built by fetching instance requirements from the AWS API. For clusters which use mixed instance policy and which specify a launch template, the API call made is DescribeLaunchTemplateVersions. This information does not need to be fetched during each scale up/down computation, but can instead be cached along with all the other information required by the cluster-autoscaler running on AWS. By doing this the cluster-autoscaler can reduce the amount of API calls performed. If the scan-interval is 10s; the amount of API calls to this endpoint will be: 6 calls per minute, or 8640 calls per day. This obviously incurs unnecessary costs for people operating AWS clusters at scale and moreover: only leaves them with the possibility of increasing the scan-interal as to reduce the amount of API calls. This is not great since that has secondary impacts on how quickly the CA can react to changes on the cluster. The current refreshInterval is set to one minute and defines the interval at which the CA refreshes its cache, so by caching the instance requirements we can make sure that this API endpoint is only called once per minute, regardless of the scan-interval chosen.

This PR therefore caches the instance requirements as done with all the other MixedInstancesPolicy data, and uses the cached data when executing buildNodeFromTemplate.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

None

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 3, 2023
@k8s-ci-robot k8s-ci-robot requested a review from drmorr0 November 3, 2023 17:06
@k8s-ci-robot k8s-ci-robot added the area/provider/aws Issues or PRs related to aws provider label Nov 3, 2023
@k8s-ci-robot k8s-ci-robot added area/cluster-autoscaler size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 3, 2023
@gjtempleton
Copy link
Member

/assign @gjtempleton

@alexanderConstantinescu alexanderConstantinescu force-pushed the aws-cache-instance-requirements branch from 7837664 to 705143a Compare November 20, 2023 11:14
@gjtempleton
Copy link
Member

Thanks!
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 4, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexanderConstantinescu, gjtempleton

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 4, 2023
@k8s-ci-robot k8s-ci-robot merged commit 04b89f6 into kubernetes:master Dec 4, 2023
6 checks passed
lyoung-confluent pushed a commit to lyoung-confluent/autoscaler that referenced this pull request Mar 12, 2024
…ache-instance-requirements

AWS: cache instance requirements
lyoung-confluent pushed a commit to lyoung-confluent/autoscaler that referenced this pull request Mar 12, 2024
…ache-instance-requirements

AWS: cache instance requirements
lyoung-confluent pushed a commit to lyoung-confluent/autoscaler that referenced this pull request Mar 12, 2024
…ache-instance-requirements

AWS: cache instance requirements
k8s-ci-robot added a commit that referenced this pull request Mar 12, 2024
…ease-1.28

Backport #6245 [CA] AWS: cache instance requirements into CA 1.28
k8s-ci-robot added a commit that referenced this pull request Mar 12, 2024
…ease-1.27

Backport #6245 [CA] AWS: cache instance requirements into CA 1.27
k8s-ci-robot added a commit that referenced this pull request Mar 12, 2024
…ease-1.26

Backport #6245 [CA] AWS: cache instance requirements into CA 1.26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cluster-autoscaler area/provider/aws Issues or PRs related to aws provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants