Skip to content

feat: capacity block support #8011

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

jmdeal
Copy link
Contributor

@jmdeal jmdeal commented Apr 23, 2025

Fixes #6519

Description

This PR extends Karpenter's native capacity reservation support to include support for capacity blocks. More details in the included design document.

How was this change tested?

make presubmit && /karpenter snapshot

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.

Copy link

netlify bot commented Apr 23, 2025

Deploy Preview for karpenter-docs-prod canceled.

Name Link
🔨 Latest commit ff3428b
🔍 Latest deploy log https://app.netlify.com/projects/karpenter-docs-prod/deploys/6841db9a350c5b0008dfa787

@jmdeal jmdeal force-pushed the feat/cbr-support branch 2 times, most recently from 025bbd5 to 37ae8ab Compare April 23, 2025 17:25
@coveralls
Copy link

coveralls commented Apr 23, 2025

Pull Request Test Coverage Report for Build 15474076604

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 343 of 404 (84.9%) changed or added relevant lines in 16 files are covered.
  • 32 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.4%) to 67.289%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/providers/amifamily/resolver.go 24 25 96.0%
pkg/controllers/controllers.go 0 2 0.0%
pkg/providers/instance/instance.go 28 30 93.33%
pkg/providers/instance/types.go 94 97 96.91%
pkg/providers/instance/filter/filter.go 95 106 89.62%
pkg/apis/v1/ec2nodeclass_status.go 43 58 74.14%
pkg/controllers/capacityreservation/expiration/controller.go 36 63 57.14%
Files with Coverage Reduction New Missed Lines %
pkg/fake/ec2api.go 3 86.22%
pkg/providers/amifamily/types.go 4 82.46%
pkg/controllers/nodeclass/ami.go 7 76.74%
pkg/test/environment.go 8 93.41%
pkg/providers/amifamily/ami.go 10 93.71%
Totals Coverage Status
Change from base Build 15446930089: 0.4%
Covered Lines: 7239
Relevant Lines: 10758

💛 - Coveralls

@jmdeal jmdeal mentioned this pull request Apr 25, 2025
3 tasks
@jmdeal jmdeal force-pushed the feat/cbr-support branch 5 times, most recently from 94a8548 to 1025aa2 Compare May 21, 2025 23:41
Copy link
Contributor Author

@jmdeal jmdeal 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

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-1025aa235996019eb45d08659f4204d37f0a1e49.
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-1025aa235996019eb45d08659f4204d37f0a1e49" --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

@jmdeal jmdeal marked this pull request as ready for review May 22, 2025 18:19
@jmdeal jmdeal requested a review from a team as a code owner May 22, 2025 18:19
@jmdeal jmdeal requested a review from rschalo May 22, 2025 18:19
@jmdeal jmdeal force-pushed the feat/cbr-support branch 3 times, most recently from 20ffc7e to e87c42b Compare June 2, 2025 18:20
Copy link
Contributor Author

@jmdeal jmdeal 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 Author

@jmdeal jmdeal 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 Jun 3, 2025

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-01edeb6c93fdb6132f9801a342fe4d643542b905.
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-01edeb6c93fdb6132f9801a342fe4d643542b905" --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

@jmdeal jmdeal force-pushed the feat/cbr-support branch from 01edeb6 to 3d2e856 Compare June 4, 2025 18:16
Copy link
Contributor

@rschalo rschalo left a comment

Choose a reason for hiding this comment

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

LGTM

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.

EC2 capacity blocks for ML in Karpenter Nodepools
3 participants