Fix: Remove duplicated sections and update outdated information in README

This commit is contained in:
2025-09-29 12:25:59 -03:00
parent fd2a2f45a4
commit 2c46b46d2e

142
README.md
View File

@@ -5,12 +5,12 @@ A resource governance tool for OpenShift clusters that goes beyond what Metrics
## 🚀 Features ## 🚀 Features
- **Automatic Collection**: Collects requests/limits from all pods/containers in the cluster - **Automatic Collection**: Collects requests/limits from all pods/containers in the cluster
- **Red Hat Validations**: Validates capacity management best practices - **Red Hat Validations**: Validates capacity management best practices with specific request/limit values
- **VPA Integration**: Consumes VPA recommendations in Off mode - **Historical Analysis**: Workload-based historical resource usage analysis (1d, 7d, 30d)
- **Prometheus Integration**: Collects real consumption metrics - **Prometheus Integration**: Collects real consumption metrics from OpenShift monitoring
- **Consolidated Reports**: Generates reports in JSON, CSV and PDF - **Export Reports**: Generates reports in JSON, CSV formats
- **Web UI**: Simple interface for visualization and interaction - **Web UI**: Modern interface with sidebar navigation and real-time updates
- **Recommendation Application**: Allows approving and applying recommendations - **Cluster Agnostic**: Works on any OpenShift cluster without configuration
## 📋 Requirements ## 📋 Requirements
@@ -37,110 +37,36 @@ oc login <cluster-url>
./scripts/deploy-complete.sh ./scripts/deploy-complete.sh
``` ```
### 📋 Manual Deploy ### 📋 Manual Deploy (Development)
#### 1. Image Build
```bash ```bash
# Local build # Build and push image
./scripts/build.sh ./scripts/build-and-push.sh
# Build with specific tag # Deploy to OpenShift
./scripts/build.sh v1.0.0
# Build for specific registry
./scripts/build.sh latest your-username
```
#### 2. Deploy to OpenShift
```bash
# Apply all resources
oc apply -f k8s/ oc apply -f k8s/
# Wait for deployment # Wait for deployment
oc rollout status deployment/resource-governance -n resource-governance oc rollout status deployment/resource-governance -n resource-governance
``` ```
#### 🚀 Automatic CI/CD (Recommended for Production) ### 🗑️ Undeploy
```bash
# 1. Configure GitHub secrets
./scripts/setup-github-secrets.sh
# 2. Commit and push
git add .
git commit -m "New feature"
git push origin main
# 3. GitHub Actions will do automatic deploy!
```
**Automatic Flow:**
-**Push to main** → GitHub Actions detects change
-**Automatic build** → New image on Docker Hub
-**Automatic deploy** → OpenShift updates deployment
-**Rolling Update** → Zero downtime
-**Health Checks** → Automatic validation
#### 🔧 Manual Deploy (Development)
```bash
# Deploy with Blue-Green strategy
./scripts/blue-green-deploy.sh
# Deploy with specific tag
./scripts/blue-green-deploy.sh v1.2.0
# Test CI/CD flow locally
./scripts/test-ci-cd.sh
```
**Development Scripts:**
-**Full control** over the process
-**Fast iteration** during development
-**Easier debugging**
-**Local tests** before pushing
#### Complete Deploy (Initial)
```bash
# Complete deploy with ImagePullSecret (first time)
./scripts/deploy-complete.sh
```
This script will:
- ✅ Create namespace and RBAC
- ✅ Configure ImagePullSecret for Docker Hub
- ✅ Deploy application
- ✅ Configure Service and Route
- ✅ Verify everything is working
#### Manual Deploy
```bash
# Default deploy
./scripts/deploy.sh
# Deploy with specific tag
./scripts/deploy.sh v1.0.0
# Deploy to specific registry
./scripts/deploy.sh latest your-username
```
#### Undeploy
```bash ```bash
# Completely remove application # Completely remove application
./scripts/undeploy-complete.sh ./scripts/undeploy-complete.sh
``` ```
### 3. Application Access ### 🌐 Application Access
After deploy, access the application through the created route: After deploy, access the application through the created route:
```bash ```bash
# Get route URL # Get route URL
oc get route resource-governance-route -n resource-governance oc get route -n resource-governance
# Access via browser # Access via browser (URL will be automatically generated)
# https://resource-governance-route-resource-governance.apps.openshift.local # Example: https://resource-governance-route-resource-governance.apps.your-cluster.com
``` ```
## 🔧 Configuration ## 🔧 Configuration
@@ -159,7 +85,7 @@ data:
openshift-monitoring openshift-monitoring
openshift-ingress openshift-ingress
openshift-apiserver openshift-apiserver
PROMETHEUS_URL: "http://prometheus.openshift-monitoring.svc.cluster.local:9090" PROMETHEUS_URL: "http://prometheus-k8s.openshift-monitoring.svc.cluster.local:9091"
``` ```
### Environment Variables ### Environment Variables
@@ -190,9 +116,9 @@ GET /api/v1/namespace/{namespace}/status
GET /api/v1/validations?namespace=default&severity=error GET /api/v1/validations?namespace=default&severity=error
``` ```
#### VPA Recommendations #### Historical Analysis
```bash ```bash
GET /api/v1/vpa/recommendations?namespace=default GET /api/v1/namespace/{namespace}/workload/{workload}/historical-analysis?time_range=24h
``` ```
#### Export Report #### Export Report
@@ -201,10 +127,10 @@ POST /api/v1/export
Content-Type: application/json Content-Type: application/json
{ {
"format": "json", "format": "csv",
"namespaces": ["default", "kube-system"], "namespaces": ["default", "kube-system"],
"includeVPA": true, "includeVPA": true,
"includeValidations": true "includeAnalysis": true
} }
``` ```
@@ -212,19 +138,19 @@ Content-Type: application/json
#### 1. Check Cluster Status #### 1. Check Cluster Status
```bash ```bash
curl https://resource-governance-route-resource-governance.apps.openshift.local/api/v1/cluster/status curl https://your-route-url/api/v1/cluster/status
``` ```
#### 2. Export CSV Report #### 2. Export CSV Report
```bash ```bash
curl -X POST https://resource-governance-route-resource-governance.apps.openshift.local/api/v1/export \ curl -X POST https://your-route-url/api/v1/export \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{"format": "csv", "includeVPA": true}' -d '{"format": "csv", "includeAnalysis": true}'
``` ```
#### 3. View Critical Validations #### 3. View Critical Validations
```bash ```bash
curl "https://resource-governance-route-resource-governance.apps.openshift.local/api/v1/validations?severity=critical" curl "https://your-route-url/api/v1/validations?severity=critical"
``` ```
## 🔍 Implemented Validations ## 🔍 Implemented Validations
@@ -243,6 +169,7 @@ curl "https://resource-governance-route-resource-governance.apps.openshift.local
- **Problem**: Ratio too high or low - **Problem**: Ratio too high or low
- **Severity**: Warning/Error - **Severity**: Warning/Error
- **Recommendation**: Adjust to 3:1 ratio - **Recommendation**: Adjust to 3:1 ratio
- **Details**: Shows specific request and limit values (e.g., "Request: 100m, Limit: 500m")
### 4. Minimum Values ### 4. Minimum Values
- **Problem**: Requests too low - **Problem**: Requests too low
@@ -292,15 +219,16 @@ The application uses a dedicated ServiceAccount with minimal permissions:
- **Deployments/ReplicaSets**: get, list, watch, patch, update - **Deployments/ReplicaSets**: get, list, watch, patch, update
### Security Context ### Security Context
- Runs as non-root user (UID 1000) - Runs as non-root user (OpenShift assigns UID automatically)
- Uses SecurityContext with runAsNonRoot: true - Uses SecurityContext with runAsNonRoot: true
- Limits resources with requests/limits - Limits resources with requests/limits
- Cluster-agnostic security context
## 🐛 Troubleshooting ## 🐛 Troubleshooting
### Check Logs ### Check Logs
```bash ```bash
oc logs -f daemonset/resource-governance -n resource-governance oc logs -f deployment/resource-governance -n resource-governance
``` ```
### Check Pod Status ### Check Pod Status
@@ -317,10 +245,10 @@ oc auth can-i get pods --as=system:serviceaccount:resource-governance:resource-g
### Test Connectivity ### Test Connectivity
```bash ```bash
# Health check # Health check
curl https://resource-governance-route-resource-governance.apps.openshift.local/health curl https://your-route-url/health
# API test # API test
curl https://resource-governance-route-resource-governance.apps.openshift.local/api/v1/cluster/status curl https://your-route-url/api/v1/cluster/status
``` ```
## 🚀 Development ## 🚀 Development
@@ -355,13 +283,13 @@ curl http://localhost:8080/health
## 📝 Roadmap ## 📝 Roadmap
### Upcoming Versions ### Upcoming Versions
- [ ] Web UI with interactive charts - [ ] VPA Integration and Health Monitoring
- [ ] PDF reports with charts - [ ] PDF reports with charts
- [ ] Custom rules per namespace - [ ] Advanced filtering and search
- [ ] GitOps integration (ArgoCD) - [ ] Alerting system (email, Slack)
- [ ] Slack/Teams notifications
- [ ] Custom Prometheus metrics
- [ ] Multi-cluster support - [ ] Multi-cluster support
- [ ] RBAC integration
- [ ] API documentation (OpenAPI/Swagger)
## 🤝 Contributing ## 🤝 Contributing