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

feat: Add ability to select instances by CPU manufacturer #5769

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

NetanelK
Copy link
Contributor

@NetanelK NetanelK commented Mar 3, 2024

Fixes #3071
Fixes #3529

Description
Added ability to select instance by its CPU manufacturer, by using the label karpenter.k8s.aws/instance-cpu-manufacturer

How was this change tested?
Ran unit tests, updated codegen to include manufacturer information

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.

@NetanelK NetanelK requested a review from a team as a code owner March 3, 2024 03:39
@NetanelK NetanelK requested a review from bwagner5 March 3, 2024 03:39
Copy link

netlify bot commented Mar 3, 2024

Deploy Preview for karpenter-docs-prod ready!

Name Link
🔨 Latest commit 0b58db0
🔍 Latest deploy log https://app.netlify.com/sites/karpenter-docs-prod/deploys/65e62510d2a8a4000815b94c
😎 Deploy Preview https://deploy-preview-5769--karpenter-docs-prod.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

jonathan-innis
jonathan-innis previously approved these changes Mar 3, 2024
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.

This seems great to me! I think our E2E tests will fail now because we aren't exercising all of the labels that we have. Can you add a test case here for the CPU manufacturer label now?

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.

/karpenter snapshot

Copy link
Contributor

github-actions bot commented Mar 3, 2024

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

@coveralls
Copy link

coveralls commented Mar 3, 2024

Pull Request Test Coverage Report for Build 8146095102

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

  • 4 of 4 (100.0%) changed or added relevant lines in 2 files are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.04%) to 82.656%

Files with Coverage Reduction New Missed Lines %
pkg/providers/amifamily/ami.go 1 90.32%
pkg/fake/utils.go 2 94.56%
Totals Coverage Status
Change from base Build 8145852384: -0.04%
Covered Lines: 5266
Relevant Lines: 6371

💛 - Coveralls

@NetanelK
Copy link
Contributor Author

NetanelK commented Mar 3, 2024

This seems great to me! I think our E2E tests will fail now because we aren't exercising all of the labels that we have. Can you add a test case here for the CPU manufacturer label now?

I've added the required label there, is there any place that needs it too?

@NetanelK NetanelK changed the title feat: Ability to select node by cpu manufacturer feat: Add ability to select instances by CPU manufacturer Mar 3, 2024
@jonathan-innis
Copy link
Contributor

I've added the required label there, is there any place that needs it too

Nope! That looks good to me. I'll approve, we'll wait for approval from another maintainer, but I don't expect there to be a huge issue here. Nice work!

jonathan-innis
jonathan-innis previously approved these changes Mar 4, 2024
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

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

/karpenter snapshot

Copy link
Contributor

github-actions bot commented Mar 4, 2024

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

@NetanelK NetanelK force-pushed the feature/cpu-manufacturer-selector branch from 0ecb9bd to 0e37986 Compare March 4, 2024 19:45
@NetanelK NetanelK force-pushed the feature/cpu-manufacturer-selector branch from 0e37986 to 0b58db0 Compare March 4, 2024 19:46
@NetanelK NetanelK requested a review from engedaam March 4, 2024 19:47
Copy link
Contributor

@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 Mar 4, 2024

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

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

LGTM 🚀

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 🚀

@jonathan-innis jonathan-innis merged commit d3f2536 into aws:main Mar 5, 2024
31 checks passed
@ecerulm
Copy link
Contributor

ecerulm commented Mar 11, 2024

For reference, example values of karpenter.k8s.aws/instance-cpu-manufacturer are aws,intel, aws and you can find them in the preview documentation https://karpenter.sh/preview/reference/instance-types/#r7i-family

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants