feat(karpenter): update instance type handling logic#19
Merged
Conversation
bcho
commented
Mar 4, 2026
| // FIXME: don't leak go routine here | ||
| // FIXME: use a better clean up helper to perform the clean up in background | ||
| // | ||
| // TODO: currently nebius doesn't provide a way for us to check if the capacity exists before real creation. |
Member
Author
There was a problem hiding this comment.
talked to someone from Azure karpenter side, he mentioned they use a in-memory cache to handle such case for filtering out bad vm size. We can implement this as a follow up
# Conflicts: # cli/go.mod # cli/go.sum # karpenter/go.mod # karpenter/go.sum # plugin/go.mod # plugin/go.sum
anson627
approved these changes
Mar 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and refactors to the Nebius cloud provider integration for Karpenter, focusing on enhanced instance type resolution, better configurability, and improved error handling. The most significant changes include the introduction of a new
instanceTypeProviderabstraction for managing instance types and platform presets, support for a configurable maximum pods per node in the Nebius node class, and updates to startup taints in example node pool configurations. Additionally, the codebase now handles quota and capacity errors more robustly and includes dependency updates.Core provider enhancements and refactoring:
Introduced an
instanceTypeProviderabstraction (inpkg/cloudproviders/nebius/instancetype) to manage instance type and platform preset resolution, and refactored the Nebius cloud provider (cloudprovider.go) to use this provider for instance type selection, retrieval, and mapping throughout the node lifecycle. This change centralizes logic and improves maintainability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Refactored the provider's registration and construction to pass the Kubernetes cluster version, which is now used in resource creation and instance type provider initialization. [1] [2] [3] [4]
Configurability and CRD/schema updates:
maxPodsPerNodefield to the Nebius node class CRD (nebiusnodeclasses.yaml) and corresponding Go struct (nebius.go), allowing users to specify the maximum number of pods per node. This value is now used in instance type resolution and advertised in node capacity. Deep copy logic was updated accordingly. [1] [2] [3]Example and scheduling improvements:
startupTaintssection, specifically adding a taint to avoid Cilium-related scheduling issues during node startup. [1] [2]Error handling and cleanup:
Dependency updates:
go.modfiles for both CLI and Karpenter modules, including switching to a customAKSFlexNodeversion and adjusting indirect dependencies. [1] [2] [3] [4]