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

pref: Reduce the number of DescribeImages calls #6126

Merged
merged 2 commits into from
May 6, 2024

Conversation

engedaam
Copy link
Contributor

@engedaam engedaam commented May 1, 2024

Fixes #5997

Description

  • Karpenter currently does not have any locking mechanism during its read and write operation for AMIs that are stored in the cache. Adding in locks to synchronize the cache for identical AMISelectorTerms
  • The DescribeImages API does not filter out AMIs before fetching AMIs by tags. This will result in the DescribeImages API sending empty pages(This is currently expected behavior). The best mitigation here will for Karpenter to increases page sizes to reduce the number of request that are made.

How was this change tested?

  • Result from testing
  • I had 20 EC2NodeClass with Identical AMISelectorTerms set
  amiSelectorTerms:
  - tags:
      testing: aengeda
  • Number of DescribeImages call from main: 1604
  • Number of DescribeImages call from with Improvements: 79

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@engedaam engedaam requested a review from a team as a code owner May 1, 2024 18:11
@engedaam engedaam requested a review from jigisha620 May 1, 2024 18:11
Copy link

netlify bot commented May 1, 2024

Deploy Preview for karpenter-docs-prod canceled.

Name Link
🔨 Latest commit 4e77f50
🔍 Latest deploy log https://app.netlify.com/sites/karpenter-docs-prod/deploys/6632cb499b08010008726885

@coveralls
Copy link

coveralls commented May 1, 2024

Pull Request Test Coverage Report for Build 8916099157

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.008%) to 82.111%

Totals Coverage Status
Change from base Build 8914365316: 0.008%
Covered Lines: 5407
Relevant Lines: 6585

💛 - Coveralls

@engedaam engedaam force-pushed the ami-bug-fix branch 5 times, most recently from 939e947 to f33e611 Compare May 1, 2024 23:05
Copy link
Contributor

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

Copy link
Contributor Author

@engedaam engedaam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/karpenter snapshot

Copy link
Contributor

github-actions bot commented May 6, 2024

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-4e77f50717a5a9fce799ff54414ebe8a66456998.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-4e77f50717a5a9fce799ff54414ebe8a66456998" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

@engedaam engedaam merged commit 06e80f6 into aws:main May 6, 2024
22 of 29 checks passed
@engedaam engedaam deleted the ami-bug-fix branch May 6, 2024 13:47
jonathan-innis pushed a commit to jonathan-innis/karpenter-provider-aws that referenced this pull request May 13, 2024
jonathan-innis pushed a commit to jonathan-innis/karpenter-provider-aws that referenced this pull request May 13, 2024
jonathan-innis pushed a commit to jonathan-innis/karpenter-provider-aws that referenced this pull request May 13, 2024
jonathan-innis pushed a commit to jonathan-innis/karpenter-provider-aws that referenced this pull request May 13, 2024
jonathan-innis pushed a commit to jonathan-innis/karpenter-provider-aws that referenced this pull request May 13, 2024
jonathan-innis pushed a commit to jonathan-innis/karpenter-provider-aws that referenced this pull request May 13, 2024
jonathan-innis pushed a commit to jonathan-innis/karpenter-provider-aws that referenced this pull request May 13, 2024
johngmyers pushed a commit to johngmyers/karpenter that referenced this pull request May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Caching DescribeImages results (amiSelectorTerms)
3 participants