Skip to content

Conversation

@rlanhellas
Copy link
Contributor

@rlanhellas rlanhellas commented Jul 27, 2025

Fixes #4367

Description
Today we don't have a option to filter out all flex instances, instead we need to exclude one by one, which can be hard to maintain. This PR adds a new label karpenter.k8s.aws/instance-capacity-flex, which can have values true and/or false.

Example in NodePool:

        - key: karpenter.k8s.aws/instance-capacity-flex
          operator: In
          values: ["false"]

this will exclude all instances with -flex in the name.

How was this change tested?
On a real AWS EKS and added more tests cases.

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.

@rlanhellas rlanhellas requested a review from a team as a code owner July 27, 2025 12:21
@rlanhellas rlanhellas requested a review from DerekFrank July 27, 2025 12:21
@netlify
Copy link

netlify bot commented Jul 27, 2025

Deploy Preview for karpenter-docs-prod canceled.

Name Link
🔨 Latest commit 4bdbd0f
🔍 Latest deploy log https://app.netlify.com/projects/karpenter-docs-prod/deploys/68c052178ef139000896bb39

@jmdeal jmdeal self-assigned this Aug 18, 2025
Copy link
Contributor

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

Only had a couple of few comments, looks good overall

Copy link
Contributor

@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

@github-actions
Copy link
Contributor

github-actions bot commented Aug 19, 2025

Preview deployment ready!

Preview URL: https://pr-8315.d18coufmbnnaag.amplifyapp.com

Built from commit 4bdbd0f61d87c8b866544bd73c1deca396385099

@coveralls
Copy link

coveralls commented Aug 19, 2025

Pull Request Test Coverage Report for Build 17588838735

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.1%) to 67.248%

Files with Coverage Reduction New Missed Lines %
pkg/providers/instance/instance.go 1 91.96%
Totals Coverage Status
Change from base Build 17571686412: 0.1%
Covered Lines: 7636
Relevant Lines: 11355

💛 - Coveralls

@github-actions
Copy link
Contributor

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

Copy link
Contributor

@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

@github-actions
Copy link
Contributor

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

jmdeal commented Aug 25, 2025

Looks like there was a failure in the scheduling suite test, should just need to add an E2E test for flex instances here: https://github.com/aws/karpenter-provider-aws/blob/main/test/suites/scheduling/suite_test.go

@rlanhellas
Copy link
Contributor Author

Looks like there was a failure in the scheduling suite test, should just need to add an E2E test for flex instances here: https://github.com/aws/karpenter-provider-aws/blob/main/test/suites/scheduling/suite_test.go

ok let me do it

@rlanhellas
Copy link
Contributor Author

Looks like there was a failure in the scheduling suite test, should just need to add an E2E test for flex instances here: https://github.com/aws/karpenter-provider-aws/blob/main/test/suites/scheduling/suite_test.go

I added my tests, if you can run the pipe again

Copy link
Contributor

@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

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2025

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

Copy link
Contributor

@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

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2025

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

Signed-off-by: Ronaldo Lanhellas <[email protected]>
Signed-off-by: Ronaldo Lanhellas <[email protected]>
Copy link
Contributor

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

LGTM 🚀

@jmdeal jmdeal enabled auto-merge (squash) September 9, 2025 16:11
@jmdeal jmdeal merged commit c4fb150 into aws:main Sep 9, 2025
17 checks passed
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.

How does Karpenter deal with the new m7i-flex instance type?

3 participants