K8s-Dash is a modern, responsive dashboard for managing Kubernetes clusters across multiple cloud providers.
- Multi-cloud management: AWS, Azure, GCP support
- Real-time monitoring: Resource usage, cluster health
- Workload management: Deploy, scale, and manage workloads
- Cost analysis: Track and optimize Kubernetes spending
- User management: Role-based access control
- Frontend: React + Vite + TailwindCSS with iOS-inspired design
- Backend: FastAPI (Python)
- Storage: PostgreSQL database
- Messaging: RabbitMQ for async tasks
- Caching: Redis
- Docker and Docker Compose
- Git
-
Clone the repository
git clone https://github.com/yourusername/k8s-dash.git cd k8s-dash -
Start the application
docker compose up -d
-
Access the dashboard
- Frontend: http://localhost:3000
- API: http://localhost:8000/docs
VITE_API_URL=http://localhost:8000
VITE_DEV_MODE=true
VITE_SKIP_AUTHENTICATION=true
DATABASE_URL=postgresql://postgres:password@db:5432/k8sdash
SECRET_KEY=development-secret-key
DEV_MODE=true
ALLOWED_ORIGINS=http://localhost:3000
ACCESS_TOKEN_EXPIRE_MINUTES=1440
In development mode, authentication can be bypassed for easier testing:
- Set
DEV_MODE=truein backend/.env - Set
VITE_DEV_MODE=trueandVITE_SKIP_AUTHENTICATION=truein frontend/.env.local
docker compose exec backend pytestdocker compose exec frontend npm testAll frontend routes are client-side using React Router:
/- Redirects to dashboard/login- Authentication page/dashboard- Main dashboard/clusters- Cluster management/workloads- Workload management/deployments- Deployment history and management/monitoring- Monitoring and alerts/costs- Cost analysis/users- User management
Base URL: http://localhost:8000
Authentication:
- POST
/api/auth/login- Regular login - GET
/api/dev/login- Dev mode login (when DEV_MODE=true)
Dashboard:
- GET
/api/dashboard/stats- Dashboard statistics - GET
/api/activity- Recent activity
Clusters:
- GET
/api/clusters- List all clusters - GET
/api/clusters/{id}- Get cluster details - POST
/api/clusters- Create new cluster - PATCH
/api/clusters/{id}- Update cluster - DELETE
/api/clusters/{id}- Delete cluster
Workloads:
- GET
/api/workloads- List all workloads - GET
/api/workloads/{id}- Get workload details - POST
/api/workloads- Deploy new workload - PATCH
/api/workloads/{id}- Update workload - DELETE
/api/workloads/{id}- Delete workload
If you encounter a blank page:
- Check browser console for errors
- Verify environment variables are set correctly
- Ensure frontend container is running:
docker compose ps - Check frontend logs:
docker compose logs frontend - Try rebuilding the frontend:
docker compose up --build -d frontend - Ensure paths in index.html are absolute (starting with
/) - Clear browser cache and reload
The blank page is typically caused by one of these issues:
-
Path Configuration:
- Make sure your
index.htmluses absolute paths:<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <script type="module" src="/src/main.jsx"></script>
- Remove any
base: './'configuration fromvite.config.js
- Make sure your
-
Environment Variables:
- Verify the environment variables are being passed correctly:
docker compose exec frontend env | grep VITE
- Create a
.env.localfile in the frontend directory with the correct variables
- Verify the environment variables are being passed correctly:
-
JavaScript Errors:
- Access the debug page to test basic functionality:
http://localhost:3000/debug.html - Check browser console for specific React errors
- Access the debug page to test basic functionality:
-
Module Resolution:
- Try clearing node_modules and reinstalling dependencies:
docker compose exec frontend rm -rf node_modules docker compose exec frontend npm install
- Rebuild the container:
docker compose up --build -d frontend
- Try clearing node_modules and reinstalling dependencies:
-
Browser Compatibility:
- Try a different browser to rule out browser-specific issues
- Update your browser to the latest version
-
Network Issues:
- Ensure all API requests are going to the correct URL
- Check network tab in developer tools for failed requests
- Verify DEV_MODE is set correctly in both frontend and backend
- Check backend logs for authentication errors
- Try using the demo credentials: [email protected] / demo123
- Check that the backend API is accessible: http://localhost:8000/docs
- Check if database container is running:
docker compose ps db - Verify database credentials in backend/.env
- Check database logs:
docker compose logs db - Try restarting the database:
docker compose restart db
When deploying to production, update the following:
-
In
frontend/index.html, use absolute paths for assets:<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <script type="module" src="/src/main.jsx"></script>
-
In
frontend/vite.config.js, ensure proper build settings:build: { target: 'es2019', sourcemap: true, }
-
Set correct API URL in production:
VITE_API_URL=https://api.your-domain.com
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT