This implementation adds AWS CloudWatch metrics integration to the Velora Admin Dashboard and automates security group configuration for EKS clusters to enable NodePort access without manual AWS Console intervention.
File: /app/Velora-cli-engine-0.0.2/EKS_SETUP_guide_new.md
Key Features:
- ✅ Automatic security group configuration for NodePort range (30000-32767)
- ✅ Three deployment methods:
- Quick setup with one-line command
- Configuration file approach
- Automated script
- ✅ No manual AWS Console steps required
- ✅ Complete documentation for CloudWatch setup
Usage Example:
# Create cluster and configure security groups automatically
eksctl create cluster \
--name arnav-velora2 \
--region ap-south-1 \
--nodes 2 \
--node-type t3.medium \
--managed
# Auto-configure security groups
NODE_SG=$(aws ec2 describe-security-groups \
--filters "Name=tag:aws:eks:cluster-name,Values=arnav-velora2" \
--query 'SecurityGroups[?contains(GroupName, `node`)].GroupId' \
--output text \
--region ap-south-1)
aws ec2 authorize-security-group-ingress \
--group-id $NODE_SG \
--protocol tcp \
--port 30000-32767 \
--cidr 0.0.0.0/0 \
--region ap-south-1File: /app/Velora-cli-engine-0.0.2/backend/server_new.py
New Endpoints:
-
Admin Authentication:
POST /api/admin/authenticate- Password protection for admin dashboard
- Default password:
velora-cli-engine(configurable via .env)
-
CloudWatch Metrics:
POST /api/admin/cloudwatch/metrics- Fetches real-time metrics from AWS CloudWatch
- Supports time ranges: 1h, 24h, 7d, 30d
- Metrics included:
- Node CPU utilization
- Node memory utilization
- Network traffic
- Disk I/O
- Pod CPU utilization
- Pod memory utilization
-
Pod Statistics:
GET /api/admin/pods/stats- Total pods, running, pending, failed
- Detailed pod information (name, namespace, status, containers, node)
- Falls back to CloudWatch if kubectl unavailable
-
Cost Estimate:
GET /api/admin/cost/estimate- EKS control plane costs
- Node group costs by instance type
- Total cost per hour, day, and month
- Regional pricing (default: ap-south-1)
Required Dependencies (already in requirements.txt):
boto3>=1.34.129- AWS SDK for Python
File: /app/Velora-cli-engine-0.0.2/frontend/src/components/AdminDashboard_new.js
Features:
- Password-protected access
- Toggle password visibility
- Session-based authentication
- 1 hour (real-time)
- 24 hours
- 7 days
- 30 days
- CPU Utilization Chart: Area chart showing node CPU usage over time
- Memory Utilization Chart: Area chart showing memory consumption
- Network Traffic Chart: Line chart showing network bytes transferred
- Disk Utilization Chart: Area chart showing filesystem usage
- Total pods count
- Current CPU usage percentage
- Current memory usage percentage
- Monthly cost estimate
- Live pod status (running, pending, failed)
- Detailed pod table with:
- Pod name
- Namespace
- Status badge
- Container count
- Node assignment
- EKS control plane cost
- Node group costs by instance type
- Total cost per hour/day/month
- Regional pricing information
- Active developers list
- Services per developer
- Developer email and profile
Required Dependencies:
recharts- For charts and graphs (needs to be installed)
File: /app/Velora-cli-engine-0.0.2/ENV_CONFIGURATION.md
Complete guide for setting up all required environment variables:
- AWS credentials and IAM policies
- CloudWatch configuration
- Admin password setup
- Security best practices
Add to /app/Velora-cli-engine-0.0.2/backend/.env:
# AWS Configuration (NEW)
AWS_REGION=ap-south-1
AWS_ACCESS_KEY_ID=your_aws_access_key_here
AWS_SECRET_ACCESS_KEY=your_aws_secret_key_here
# EKS Cluster Configuration (NEW)
EKS_CLUSTER_NAME=arnav-velora2
# Admin Dashboard Password (NEW)
ADMIN_PASSWORD=velora-cli-engine
# Existing variables (keep as is)
MONGO_URL=mongodb://localhost:27017
DB_NAME=velora
CORS_ORIGINS=http://localhost:3005
GITHUB_TOKEN=your_github_token
DOCKER_USERNAME=your_docker_username
DOCKER_TOKEN=your_docker_token
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SMTP_USERNAME=your_email
SMTP_PASSWORD=your_password
FRONTEND_URL=http://localhost:3005The AWS credentials need these managed policies attached:
CloudWatchReadOnlyAccess- For fetching metricsAmazonEKSReadOnlyAccess- For cluster informationAmazonEC2ReadOnlyAccess- For security groups and node info
cd /app/Velora-cli-engine-0.0.2/frontend
yarn add rechartscd /app/Velora-cli-engine-0.0.2/backend
# Add required environment variables to .env file
cat >> .env << 'EOF'
# AWS Configuration
AWS_REGION=ap-south-1
AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY_HERE
AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY_HERE
# EKS Configuration
EKS_CLUSTER_NAME=arnav-velora2
# Admin Password
ADMIN_PASSWORD=velora-cli-engine
EOF
# Install dependencies (if not already installed)
pip install -r requirements.txt# Enable logging on EKS cluster
eksctl utils update-cluster-logging \
--enable-types=all \
--cluster=arnav-velora2 \
--region=ap-south-1 \
--approve
# Install CloudWatch agent
kubectl apply -f https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/quickstart/cwagent-fluentd-quickstart.yaml# Terminal 1: Start backend with new server
cd /app/Velora-cli-engine-0.0.2/backend
python3 -m uvicorn server_new:app --host 0.0.0.0 --port 8002 --reload
# Terminal 2: Start frontend
cd /app/Velora-cli-engine-0.0.2/frontend
yarn start- Open browser:
http://localhost:3005/admin - Enter password:
velora-cli-engine - View real-time CloudWatch metrics!
# Test health check
curl http://localhost:8002/api/health
# Test authentication
curl -X POST http://localhost:8002/api/admin/authenticate \
-H "Content-Type: application/json" \
-d '{"password":"velora-cli-engine"}'
# Test CloudWatch metrics
curl -X POST http://localhost:8002/api/admin/cloudwatch/metrics \
-H "Content-Type: application/json" \
-d '{"time_range":"1h"}'
# Test pod statistics
curl http://localhost:8002/api/admin/pods/stats
# Test cost estimate
curl http://localhost:8002/api/admin/cost/estimate# Deploy a service
velora deploy test-service
# Service should be accessible immediately at http://<NODE_IP>:<NODE_PORT>
# No manual security group configuration needed!┌─────────────────────────────────────────────────────────┐
│ Frontend (React) │
│ ┌──────────────────────────────────────────────────┐ │
│ │ AdminDashboard_new.js │ │
│ │ • Password Authentication │ │
│ │ • Time Range Selector │ │
│ │ • CloudWatch Charts (Recharts) │ │
│ │ • Pod Statistics Display │ │
│ │ • Cost Breakdown │ │
│ └──────────────────────────────────────────────────┘ │
└────────────────────┬────────────────────────────────────┘
│ HTTP Requests
▼
┌─────────────────────────────────────────────────────────┐
│ Backend (FastAPI) │
│ ┌──────────────────────────────────────────────────┐ │
│ │ server_new.py │ │
│ │ • Admin Auth Endpoint │ │
│ │ • CloudWatch Metrics API │ │
│ │ • Pod Stats API │ │
│ │ • Cost Estimate API │ │
│ └──────────────────────────────────────────────────┘ │
└────────────────────┬────────────────────────────────────┘
│ boto3 SDK
▼
┌─────────────────────────────────────────────────────────┐
│ AWS Services │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ CloudWatch │ │ EKS │ │ EC2 │ │
│ │ Metrics │ │ Cluster │ │ Security │ │
│ │ │ │ Info │ │ Groups │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────┘
- Before: Manual AWS Console configuration required
- After: Automatic configuration during cluster setup
- Benefit: Saves time, reduces errors, improves developer experience
- Before: No visibility into cluster metrics
- After: Real-time CPU, memory, network, and disk metrics
- Benefit: Better monitoring, faster troubleshooting, informed scaling decisions
- Before: Unknown operational costs
- After: Real-time cost breakdown and estimates
- Benefit: Budget management, cost optimization opportunities
- Before: Basic dashboard with limited information
- After: Comprehensive dashboard with password protection
- Benefit: Enhanced security, better insights, professional UI
Solution:
- Verify CloudWatch Container Insights is enabled
- Wait 5-10 minutes for initial metrics collection
- Check AWS credentials have correct permissions
Solution:
- Check
ADMIN_PASSWORDin backend.envfile - Restart backend server after changing password
Solution:
- Verify EKS cluster name matches
EKS_CLUSTER_NAMEin.env - Check AWS credentials have EKS read permissions
- Costs are estimates based on instance types and AWS pricing
Solution:
- Install and configure kubectl
- Or enable CloudWatch Container Insights
- Check backend logs for specific errors
Potential improvements for future versions:
- Alerts: Set up CloudWatch alarms for high CPU/memory
- Historical Reports: Export metrics to CSV/PDF
- Multi-Cluster Support: Monitor multiple EKS clusters
- Custom Dashboards: User-defined metric combinations
- Cost Optimization Suggestions: AI-powered recommendations
- Real-time Notifications: Slack/Email alerts for critical events
- ✅
/app/Velora-cli-engine-0.0.2/EKS_SETUP_guide_new.md - ✅
/app/Velora-cli-engine-0.0.2/backend/server_new.py - ✅
/app/Velora-cli-engine-0.0.2/frontend/src/components/AdminDashboard_new.js - ✅
/app/Velora-cli-engine-0.0.2/ENV_CONFIGURATION.md - ✅
/app/Velora-cli-engine-0.0.2/IMPLEMENTATION_SUMMARY.md
- ✅
/app/Velora-cli-engine-0.0.2/EKS_SETUP_guide.md - ✅
/app/Velora-cli-engine-0.0.2/backend/server.py - ✅
/app/Velora-cli-engine-0.0.2/frontend/src/components/AdminDashboard.js
All new files are suffixed with _new to preserve original code:
EKS_SETUP_guide_new.md- Updated setup guideserver_new.py- Enhanced backendAdminDashboard_new.js- New admin dashboard
Original files remain untouched for reference and rollback purposes.
For questions or issues:
- Check
ENV_CONFIGURATION.mdfor setup details - Review
EKS_SETUP_guide_new.mdfor cluster configuration - Verify all environment variables are correctly set
- Check backend logs:
tail -f /var/log/supervisor/backend.*.log
Implementation Complete! 🎉
All requirements have been met:
- ✅ Automated security group configuration for NodePort access
- ✅ CloudWatch metrics integration for arnav-velora2 cluster
- ✅ Pod usage statistics and cost tracking
- ✅ Password-protected admin dashboard
- ✅ Developer management capabilities
- ✅ Real-time and historical data with time range selector
- ✅ New files created with
_newsuffix - ✅ Original code untouched