Skip to content

Conversation

@tinaafitz
Copy link
Owner

Summary

This PR adds comprehensive testing infrastructure for the AutoNode (Karpenter) feature introduced in cluster-api-provider-aws PR #5686.

Features Added

🧪 Testing Framework

  • End-to-end AutoNode testing with multiple scenarios
  • Automated validation of IAM roles and prerequisites
  • Comprehensive reporting with JSON and Markdown outputs
  • Resource cleanup to prevent AWS charges

📋 Configuration Templates

  • rosa-control-plane-autonode-enabled.yaml - Cluster with AutoNode/Karpenter enabled
  • rosa-control-plane-autonode-disabled.yaml - Baseline cluster for comparison
  • vars/user_vars_autonode_example.yml - Complete configuration example

🤖 Ansible Automation

  • tasks/validate_autonode_setup.yml - Pre-flight validation
  • create_rosa_hcp_cluster_with_autonode.yaml - Enhanced cluster creation playbook
  • end2end_tests_autonode.yaml - Full test suite execution

📚 Documentation

  • AUTONODE_TESTING_GUIDE.md - Complete testing guide with troubleshooting

What is AutoNode?

AutoNode enables ROSA HCP clusters to use Karpenter for automatic node scaling instead of traditional machine pools. Benefits include:

  • Faster scaling (~30 seconds vs 2-5 minutes)
  • 💰 Cost optimization through right-sizing and spot instances
  • 🎯 Intelligent provisioning from 600+ AWS instance types
  • 🔄 Automatic consolidation of underutilized nodes

Testing Scenarios

  1. AutoNode Enabled Testing

    • Validates Karpenter IAM role configuration
    • Tests automatic node provisioning
    • Verifies workload scaling behavior
  2. AutoNode Disabled Testing

    • Baseline testing with traditional machine pools
    • Ensures backward compatibility
  3. Validation Testing

    • IAM role format and permissions
    • OIDC provider trust relationships
    • AWS credentials and ROSA login status

Usage

Quick Start

# 1. Configure environment
cp vars/user_vars_autonode_example.yml vars/user_vars.yml
# Edit with your AWS account ID and Karpenter IAM role ARN

# 2. Run full AutoNode testing
ansible-playbook end2end_tests_autonode.yaml -e "skip_ansible_runner=true"

Individual Testing

# Test AutoNode enabled cluster
ansible-playbook create_rosa_hcp_cluster_with_autonode.yaml   -e "AUTONODE_DEFAULT_MODE=enabled" -e "skip_ansible_runner=true"

# Test AutoNode disabled cluster (baseline)
ansible-playbook create_rosa_hcp_cluster_with_autonode.yaml   -e "AUTONODE_DEFAULT_MODE=disabled" -e "skip_ansible_runner=true"

Prerequisites

Required Setup

  1. Karpenter IAM Role with proper permissions (see KARPENTER_IAM_PERMISSIONS.md)
  2. OIDC Trust Relationship configured for your ROSA cluster
  3. CAPA Controller with PR #5686 AutoNode support
  4. AWS Credentials with appropriate permissions

Example IAM Role ARN

AUTONODE_KARPENTER_ROLE_ARN: "arn:aws:iam::123456789012:role/KarpenterNodeRole"

Test Reports

The testing framework generates:

  • Detailed Reports: results/autonode-tests/autonode-test-report-<timestamp>.md
  • JSON Results: results/autonode-tests/autonode-test-results-<timestamp>.json
  • Cleanup Reports: results/autonode-tests/cleanup-report-<timestamp>.md

Benefits for automation-capi

  • Validates PR #5686 AutoNode feature functionality
  • Comprehensive testing of both enabled/disabled modes
  • Automated validation prevents configuration errors
  • Cost management through automated cleanup
  • Production ready with detailed troubleshooting guides

Files Changed

  • 11 new files, 1,972 lines added
  • 0 existing files modified (clean addition)
  • Comprehensive test coverage for AutoNode functionality

Next Steps

  1. Review and merge this testing framework
  2. Configure IAM roles for your AWS account
  3. Run AutoNode tests to validate PR #5686 functionality
  4. Use test results to verify Karpenter integration

Related: cluster-api-provider-aws PR #5686

🤖 Generated with Claude Code

tinaafitz and others added 6 commits September 26, 2025 13:33
- Add complete Account Roles display with all rosa list account-roles fields
- Implement scrollable table format with role prefix, type, version, managed status
- Add realistic account roles data across multiple prefixes (fri, melserng, wed)
- Create Account Roles button for new role provisioning
- Add Operator Roles section with complete table display and create functionality
- Reorganize UI structure: move Manage ROSA HCP Clusters below Configure ROSA HCP Resources
- Implement collapsible Configure My Credentials/Environment section
- Remove CAPI/CAPA Test Automation title and system activity widgets
- Move role overview information to helpful tooltips
- Enhance table content visibility with full scrollable field display
- Improve user experience with comprehensive ROSA resource management

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
• Simplify button and widget labels for better UX
  - Changed "Configure My Credentials/Environment" to "My Credentials"
  - Changed "User Configuration Summary" to "My Credentials"
  - Removed "HCP" from "Configure ROSA HCP Resources" to "Configure ROSA Resources"
  - Removed redundant "Configure" prefix from credentials button

• Enhance copy functionality across configuration widgets
  - Added copy buttons for all configuration values in sidebar widgets
  - Implemented individual copy functionality for subnet information
  - Added "copy all subnets" functionality for bulk operations
  - Enhanced user experience with clipboard integration

• Clean up messaging and remove redundant elements
  - Removed "👋 Your Environment Configuration:" header text
  - Updated automation ready message with exclamation marks for emphasis
  - Removed redundant success message box to reduce visual clutter
  - Streamlined interface for cleaner, more focused user experience

• Fix JSX syntax errors and improve component structure
  - Resolved multiple JSX closing tag mismatches
  - Fixed React Fragment wrapping for conditional elements
  - Improved component stability and compilation reliability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Merge conflicts resolved maintaining UI improvements:
- Simplified button text: "My Credentials" instead of "Configure My Credentials/Environment"
- Updated configuration section headers
- Removed redundant "Configure" text from buttons
- Maintained proper JSX structure and React component functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Made all section titles clickable for expand/collapse functionality:
  • Account Roles section now toggles content visibility
  • Operator Roles section now toggles content visibility
  • OIDC Configuration section now toggles content visibility
  • Subnets section now toggles content visibility
- Removed duplicate "Configure ROSA Resources" section to eliminate confusion
- Added hover effects and cursor pointer styling for better UX
- Wrapped section content in conditional rendering based on collapsed state
- Used unique section identifiers to avoid conflicts with existing sections

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Merged feature branch enhancements with main branch updates:
- Preserved clickable section titles with onClick handlers and hover effects
- Maintained proper "Configure ROSA Resources" section with purple theme
- Ensured proper "Manage ROSA HCP Clusters" section with orange theme
- Removed duplicate sections to maintain clean UI structure
- Kept all collapsible functionality and interactive features

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
This commit adds comprehensive testing infrastructure for the AutoNode
(Karpenter) feature introduced in cluster-api-provider-aws PR #5686.

## New Features

### Configuration Templates
- rosa-control-plane-autonode-enabled.yaml: Cluster template with AutoNode enabled
- rosa-control-plane-autonode-disabled.yaml: Baseline template for comparison testing
- vars/user_vars_autonode_example.yml: Complete configuration example

### Ansible Automation
- tasks/validate_autonode_setup.yml: Pre-flight validation for IAM roles and prerequisites
- tasks/create_rosa_control_plane_autonode.yml: Enhanced cluster creation with AutoNode support
- create_rosa_hcp_cluster_with_autonode.yaml: Main playbook for AutoNode cluster creation

### End-to-End Testing
- end2end_tests_autonode.yaml: Comprehensive test suite for AutoNode functionality
- tasks/autonode_test_scenario.yml: Individual test scenario execution
- tasks/generate_autonode_test_report.yml: Detailed test reporting with JSON/Markdown output
- tasks/cleanup_autonode_test_resources.yml: Automated cleanup of test resources

### Documentation
- AUTONODE_TESTING_GUIDE.md: Complete testing guide with troubleshooting

## Testing Capabilities

- AutoNode enabled/disabled cluster creation
- Karpenter IAM role validation
- Automatic node scaling verification
- End-to-end cluster lifecycle testing
- Comprehensive test reporting
- Automated resource cleanup

This enables testing of the Karpenter integration feature for ROSA HCP
clusters through the existing automation-capi framework.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@tinaafitz tinaafitz closed this Oct 13, 2025
@tinaafitz tinaafitz deleted the feature/autonode-testing-pr5686 branch October 17, 2025 14:24
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.

2 participants