Skip to content

Conversation

awsfanboy
Copy link

Enable EKS Auto Mode Support

This pull request introduces comprehensive improvements to how the Headlamp Karpenter plugin detects and handles different Karpenter deployment types (EKS Auto Mode, self-installed), enhancing both the user experience and maintainability. The changes include automatic deployment detection, dynamic configuration and UI adaptation, improved error handling, and updated documentation to reflect these enhancements.

Test

EKS Auto Mode

Screenshot 2025-10-10 at 6 59 19 pm Screenshot 2025-10-10 at 6 59 32 pm Screenshot 2025-10-10 at 6 59 40 pm Screenshot 2025-10-10 at 6 59 45 pm Screenshot 2025-10-10 at 6 59 53 pm

EKS self-installed Karpenter

Screenshot 2025-10-10 at 7 00 43 pm Screenshot 2025-10-10 at 7 00 53 pm Screenshot 2025-10-10 at 7 01 00 pm Screenshot 2025-10-10 at 7 01 05 pm Screenshot 2025-10-10 at 7 01 10 pm Screenshot 2025-10-10 at 7 00 34 pm

Note

I haven’t tested for Azure.

@awsfanboy awsfanboy force-pushed the feature/eks-auto-mode-support branch from 6b0de48 to fa9ecf7 Compare October 10, 2025 06:14
@illume illume changed the title Add EKS Auto Mode Support karpenter: Add EKS Auto Mode Support Oct 11, 2025
@illume illume requested a review from Copilot October 11, 2025 13:56
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive support for AWS EKS Auto Mode to the Headlamp Karpenter plugin, allowing it to handle different Karpenter deployment types dynamically. The changes enable automatic detection of EKS Auto Mode vs self-installed Karpenter deployments and adapt the UI accordingly.

  • Enhanced cloud provider detection to support multiple deployment types (EKS Auto Mode, self-installed, generic)
  • Dynamic configuration system that adapts based on detected deployment type
  • Improved error handling and user feedback throughout the plugin

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
karpenter/src/hook/useCloudProviderDetection.ts Enhanced detection logic to identify different Karpenter deployment types and return structured cloud provider information
karpenter/src/common/cloudProviders.ts Added deployment-specific configurations for AWS (EKS Auto Mode, self-installed, generic)
karpenter/src/NodeClass/List.tsx Updated to handle both string and object cloud provider values with improved error handling
karpenter/src/NodeClass/Details.tsx Modified to use dynamic configuration based on deployment type
karpenter/src/schemas/index.tsx Updated schema selection to handle new cloud provider object structure
karpenter/src/mapView.tsx Enhanced to pass cloud provider context to AWS node class creation
karpenter/src/helpers/createNodeClassClass.ts Added static methods for better API integration
karpenter/src/common/resourceEditor.tsx Updated schema determination and removed debug logging
karpenter/src/index.tsx Added icon registration for generic NodeClass kind
karpenter/README.md Updated documentation to reflect EKS Auto Mode support and detection mechanism

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}

return 'EC2NodeClass-schema';
return 'NodeClass-schema';
Copy link

Copilot AI Oct 11, 2025

Choose a reason for hiding this comment

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

The fallback schema changed from 'EC2NodeClass-schema' to 'NodeClass-schema', but there's no corresponding 'NodeClass-schema' defined in KARPENTER_SCHEMAS. This could cause validation to fail for cases that previously worked.

Suggested change
return 'NodeClass-schema';
return 'EC2NodeClass-schema';

Copilot uses AI. Check for mistakes.

Copy link
Contributor

Choose a reason for hiding this comment

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

@awsfanboy I'm unsure if this is a real issue?

Copy link
Author

Choose a reason for hiding this comment

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

good catch @illume . Let me check this soon and update here in the weekend.

@illume
Copy link
Contributor

illume commented Oct 11, 2025

Thanks for this.

For the lint issue mentioned in the CI check, you can use these:

npm run lint
npm run lint-fix
npm run format

For the git commits we follow these git commit guidelines. Instead of feat: use a prefix likekarpenter:

- Add automatic detection for EKS Auto Mode vs self-installed Karpenter
- Support both NodeClass (EKS Auto Mode) and EC2NodeClass (self-installed) resources
- Implement dynamic configuration system based on detected deployment type
- Add AWS_DEPLOYMENT_CONFIGS with complete column definitions for each deployment
- Fix map view null reference errors during provider detection
- Update README with comprehensive multi-deployment documentation
- Add proper error handling and fallbacks throughout the plugin

Resolves support for both EKS Auto Mode managed Karpenter and traditional self-installed Karpenter deployments.

Signed-off-by: Arshad Zackeriya <[email protected]>
✨ Features:
- Support both EKS Auto Mode (eks.amazonaws.com/v1) and self-managed Karpenter (karpenter.k8s.aws/v1)
- Automatic deployment type detection via CRD inspection
- Dynamic API configuration based on detected Karpenter deployment
- Full compatibility with both NodeClass and EC2NodeClass resources

🔧 Technical Changes:
- Enhanced useCloudProviderDetection hook with priority-based CRD detection
- Added AWS_DEPLOYMENT_CONFIGS for EKS_AUTOMODE and SELF_INSTALLED configurations
- Updated mapView to dynamically select correct NodeClass configuration
- Modified NodeClass List and Details components to support multi-deployment scenarios
- Created createNodeClassClass helper for dynamic resource class generation

🎯 Backward Compatibility:
- Maintains existing functionality for self-managed Karpenter deployments
- Returns string 'AWS' for SELF_INSTALLED (backward compatibility)
- Returns object with deployment type for EKS_AUTOMODE (new feature)

�� Bundle Optimization:
- Removed all debug console statements for production
- Optimized bundle size to 216.78 kB (reduced from ~1.2MB)
- Clean, professional error handling without debug artifacts

Resolves: EKS Auto Mode NodeClass resource support
Tested: Both EKS Auto Mode and self-managed Karpenter clusters
Signed-off-by: Arshad Zackeriya <[email protected]>
- Remove unused availableCRDs variable to fix no-unused-vars error
- Apply consistent code formatting using prettier
- Ensure all linting rules pass for CI checks

Signed-off-by: Arshad Zackeriya <[email protected]>
@awsfanboy awsfanboy force-pushed the feature/eks-auto-mode-support branch from fa9ecf7 to e4a5de5 Compare October 11, 2025 22:56
@awsfanboy
Copy link
Author

Thank you @illume, I’ve made the changes 👍

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.

2 participants