Feat: implementar sistema de recomendações inteligentes e categorização de workloads

This commit is contained in:
2025-09-29 15:26:09 -03:00
parent 63a284f4b2
commit afc7462b40
7 changed files with 1491 additions and 91 deletions

167
README.md
View File

@@ -282,14 +282,165 @@ curl http://localhost:8080/health
## 📝 Roadmap
### Upcoming Versions
- [ ] VPA Integration and Health Monitoring
- [ ] PDF reports with charts
- [ ] Advanced filtering and search
- [ ] Alerting system (email, Slack)
- [ ] Multi-cluster support
- [ ] RBAC integration
- [ ] API documentation (OpenAPI/Swagger)
### 🎯 **PRAGMATIC ROADMAP - Resource Governance Focus**
**Core Mission**: List projects without requests/limits + provide smart recommendations based on historical analysis + VPA integration
---
### **Phase 1: Enhanced Validation & Categorization (IMMEDIATE - 1-2 weeks)**
#### 1.1 Smart Resource Detection
- [ ] **Enhanced Validation Engine**
- Better categorization of resource issues (missing requests, missing limits, wrong ratios)
- Severity scoring based on impact and risk
- Workload age detection (new vs established)
- [ ] **Workload Categorization System**
- **New Workloads** (< 7 days): Flag for VPA activation
- **Established Workloads** (> 7 days): Use historical analysis
- **Outlier Workloads**: High resource usage without proper limits
- **Compliant Workloads**: Properly configured resources
#### 1.2 Historical Analysis Integration
- [ ] **Smart Historical Analysis**
- Use historical data to suggest realistic requests/limits
- Calculate P95/P99 percentiles for recommendations
- Identify seasonal patterns and trends
- Flag workloads with insufficient historical data
---
### **Phase 2: Smart Recommendations Engine (SHORT TERM - 2-3 weeks)**
#### 2.1 Recommendation Dashboard
- [ ] **Dedicated Recommendations Section**
- Replace generic "VPA Recommendations" with "Smart Recommendations"
- Show actionable insights with priority levels
- Display estimated impact of changes
- Group by namespace and severity
#### 2.2 Recommendation Types
- [ ] **Resource Configuration Recommendations**
- "Add CPU requests: 200m (based on 7-day P95 usage)"
- "Increase memory limits: 512Mi (current usage peaks at 400Mi)"
- "Fix CPU ratio: 3:1 instead of 5:1 (current: 500m limit, 100m request)"
- [ ] **VPA Activation Recommendations**
- "Activate VPA for new workload 'example' (insufficient historical data)"
- "Enable VPA for outlier workload 'high-cpu-app' (unpredictable usage patterns)"
#### 2.3 Priority Scoring System
- [ ] **Impact-Based Prioritization**
- **Critical**: Missing limits on high-resource workloads
- **High**: Missing requests on production workloads
- **Medium**: Suboptimal ratios on established workloads
- **Low**: New workloads needing VPA activation
---
### **Phase 3: VPA Integration & Automation (MEDIUM TERM - 3-4 weeks)**
#### 3.1 VPA Detection & Management
- [ ] **VPA Status Detection**
- Detect existing VPAs in cluster
- Show VPA health and status
- Display current VPA recommendations
- Compare VPA suggestions with current settings
#### 3.2 Smart VPA Activation
- [ ] **Automatic VPA Suggestions**
- Suggest VPA activation for new workloads (< 7 days)
- Recommend VPA for outlier workloads
- Provide VPA YAML configurations
- Show estimated benefits of VPA activation
#### 3.3 VPA Recommendation Integration
- [ ] **VPA Data Integration**
- Fetch VPA recommendations from cluster
- Compare VPA suggestions with historical analysis
- Show confidence levels for recommendations
- Display VPA update modes and policies
---
### **Phase 4: Action Planning & Implementation (LONG TERM - 4-6 weeks)**
#### 4.1 Action Plan Generation
- [ ] **Step-by-Step Action Plans**
- Generate specific kubectl/oc commands
- Show before/after resource configurations
- Estimate implementation time and effort
- Provide rollback procedures
#### 4.2 Implementation Tracking
- [ ] **Progress Monitoring**
- Track which recommendations have been implemented
- Show improvement metrics after changes
- Alert on new issues or regressions
- Generate implementation reports
#### 4.3 Advanced Analytics
- [ ] **Cost Optimization Insights**
- Show potential cost savings from recommendations
- Identify over-provisioned resources
- Suggest right-sizing opportunities
- Display resource utilization trends
---
### **Phase 5: Enterprise Features (FUTURE - 6+ weeks)**
#### 5.1 Advanced Governance
- [ ] **Policy Enforcement**
- Custom resource policies per namespace
- Automated compliance checking
- Policy violation alerts
- Governance reporting
#### 5.2 Multi-Cluster Support
- [ ] **Cross-Cluster Analysis**
- Compare resource usage across clusters
- Centralized recommendation management
- Cross-cluster best practices
- Unified reporting
---
## 🎯 **IMMEDIATE NEXT STEPS (This Week)**
### Priority 1: Enhanced Validation Engine
1. **Improve Resource Detection**
- Better categorization of missing requests/limits
- Add workload age detection
- Implement severity scoring
2. **Smart Categorization**
- New workloads (< 7 days) → VPA candidates
- Established workloads (> 7 days) → Historical analysis
- Outlier workloads → Special attention needed
### Priority 2: Recommendation Dashboard
1. **Create Recommendations Section**
- Replace generic VPA section
- Show actionable insights
- Display priority levels
2. **Historical Analysis Integration**
- Use Prometheus data for recommendations
- Calculate realistic resource suggestions
- Show confidence levels
### Priority 3: VPA Integration
1. **VPA Detection**
- Find existing VPAs in cluster
- Show VPA status and health
- Display current recommendations
2. **Smart VPA Suggestions**
- Identify VPA candidates
- Generate VPA configurations
- Show estimated benefits
## 🤝 Contributing