Skip to content

feat: Added check to filter supported nodes by ami's arch type #7933

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

Conversation

gnana997
Copy link
Contributor

@gnana997 gnana997 commented Mar 20, 2025

Fixes #7893

Description
Added a check to filter the nodes from the node pool based on the required architecture for the provided AMI in the Node Class
How was this change tested?
Working on adding test cases to check the added filtering check.

Does this change impact docs?

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 Mar 20, 2025

Deploy Preview for karpenter-docs-prod ready!

Name Link
🔨 Latest commit 6103671
🔍 Latest deploy log https://app.netlify.com/sites/karpenter-docs-prod/deploys/67e5132a34be850008ac1fe9
😎 Deploy Preview https://deploy-preview-7933--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.

@gnana997 gnana997 force-pushed the ami-req-node-class branch from 325bc21 to e989255 Compare March 20, 2025 16:45
@gnana997 gnana997 changed the title feat: Added check to filter supported nodes by amis feat: Added check to filter supported nodes by ami's arch type Mar 20, 2025
@gnana997 gnana997 force-pushed the ami-req-node-class branch from e989255 to a7cad45 Compare March 22, 2025 11:58
@gnana997 gnana997 marked this pull request as ready for review March 22, 2025 12:00
@gnana997 gnana997 requested a review from a team as a code owner March 22, 2025 12:00
@gnana997 gnana997 requested a review from engedaam March 22, 2025 12:00
for _, ami := range amis {
if err := instanceType.Requirements.Compatible(
scheduling.NewNodeSelectorRequirements(ami.Requirements...),
scheduling.AllowUndefinedWellKnownLabels,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we allow our Unknown WellKnown labels to be compatible here? Can we check the other places we are doing instance type compatibility with AMIs?

Also, I wonder if we can just re-leverage MapInstanceTypes and then just pull-out the instance types that we support

Copy link
Contributor

Choose a reason for hiding this comment

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

@gnana997 Any luck with this update?

// Filter instance types that don't have compatible AMIs to prevent architecture mismatches
filteredInstanceTypes := amifamily.FilterInstanceTypesByAMICompatibility(instanceTypesWithOfferings, nodeClass.Status.AMIs)
if len(filteredInstanceTypes) == 0 {
log.FromContext(ctx).WithValues(
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is a log -- this is an error IMO

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

Successfully merging this pull request may close these issues.

Use AMI requirements for a NodeClass to filter out supported Instance Types
3 participants