Skip to content
This repository was archived by the owner on Jan 24, 2026. It is now read-only.
This repository was archived by the owner on Jan 24, 2026. It is now read-only.

Feature: Validate host resources before cluster creation #33

Description

@mrgb7

Feature Request: Automatic Host Resource Validation During Cluster Creation

Overview

Implement automatic host resource validation as an internal step during cluster creation. Before attempting to create a new cluster, the system should automatically check if the local machine has sufficient resources (CPU, memory, disk space) and prevent creation if resources are inadequate.

Current Problem

Currently, cluster creation proceeds without validating host machine capabilities, which can lead to:

  • Failed cluster creation due to insufficient resources
  • Poor performance on under-resourced hosts
  • Unclear error messages when resource limits are exceeded
  • Wasted time on doomed cluster creation attempts
  • System instability from resource exhaustion

Proposed Solution

Implement automatic host resource validation that runs internally during the playground create cluster command:

1. Automatic Pre-Creation Validation

  • Internal Step: Validation happens automatically before cluster provisioning begins
  • Seamless Integration: No additional commands needed from users
  • Fail-Fast Approach: Stop cluster creation immediately if resources are insufficient
  • Clear Feedback: Provide detailed resource status and recommendations

2. Resource Validation Checks

  • CPU: Verify minimum cores available for cluster operation
  • Memory: Check available RAM against cluster memory requirements
  • Disk Space: Ensure sufficient storage for cluster data and container images
  • Port Availability: Verify required ports are not in use
  • Container Runtime: Check Docker/containerd resource limits

3. Validation Logic Flow

playground create cluster my-cluster
    ↓
1. Parse cluster configuration
2. Calculate required resources
3. → AUTOMATIC HOST VALIDATION ←
4. If validation fails: stop with clear error
5. If validation passes: proceed with cluster creation

4. Configurable Behavior

  • Default: Automatic validation enabled
  • Override Option: --skip-host-validation flag to bypass if needed
  • Force Creation: --force flag to proceed despite warnings
  • Custom Thresholds: Support for different cluster size requirements

Implementation Details

Internal Validation Process

  • Silent Operation: No user interaction required during validation
  • Fast Execution: Quick resource checks to minimize delay
  • Cross-Platform: Works on macOS, Linux, and Windows
  • Error Handling: Graceful failure with informative messages

Resource Detection

  • CPU Detection: Core count and architecture verification
  • Memory Analysis: Available RAM calculation accounting for OS overhead
  • Disk Space Check: Free storage on target filesystem
  • System Load: Consider current system resource usage
  • Platform-Specific: Handle different OS resource reporting methods

User Experience

  • Transparent Process: Brief status message during validation
  • Clear Failures: Detailed error with specific resource shortfalls
  • Actionable Feedback: Specific recommendations for resolution
  • Quick Validation: Minimal impact on cluster creation time

Example User Experience

$ playground create cluster my-cluster
Validating host resources...
❌ Insufficient resources for cluster creation

Resource Requirements vs. Available:
  CPU: ✅ 8 cores available (4 required)
  Memory: ❌ 6 GB available (8 GB required)
  Disk: ⚠️ 15 GB available (20 GB recommended)

Recommendations:
- Free up at least 2 GB of memory to meet minimum requirements
- Close unnecessary applications to free memory
- Consider cleaning up disk space for optimal performance

To bypass this check, use: playground create cluster my-cluster --skip-host-validation

Acceptance Criteria

  • Automatic host validation integrated into cluster creation workflow
  • Resource validation runs before any cluster provisioning begins
  • Cross-platform resource detection (macOS, Linux, Windows)
  • Configurable resource thresholds based on cluster configuration
  • Clear error messages with specific resource shortfalls and recommendations
  • --skip-host-validation flag to bypass validation when needed
  • --force flag to proceed despite resource warnings
  • Fast validation process (< 2 seconds)
  • Integration tests covering validation scenarios
  • Documentation updated with resource requirements

Implementation Notes

  • No New Commands: All validation is internal to existing cluster creation
  • Fail-Fast Design: Stop immediately on validation failure to save time
  • Configurable Thresholds: Allow different requirements per cluster type
  • Platform Compatibility: Handle resource detection across operating systems
  • Performance: Quick validation with minimal overhead

Benefits

  • Automatic Protection: Prevent resource-related failures without user intervention
  • Time Savings: Catch issues before lengthy cluster creation attempts
  • Better UX: Clear, immediate feedback about system limitations
  • System Stability: Prevent resource exhaustion scenarios
  • Informed Users: Help users understand their system capabilities
  • Seamless Integration: No workflow changes required from users

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions