Overview
Orphelix provides a RESTful API for managing Kubernetes resources and accessing cluster data. All API endpoints are server-side Next.js API routes that communicate with the Kubernetes API.Resources
Deployments, Pods, Nodes, Services, ConfigMaps, Secrets
Real-time
Server-Sent Events for live updates
GitHub
Repository browsing and PR creation
AI Features
File matching and troubleshooting
Base URL
Authentication
GitHub OAuth
Most endpoints work without authentication. GitHub integration requires OAuth:next-auth.session-token(httpOnly, secure)
Kubernetes Access
API uses kubeconfig from server’s filesystem:~/.kube/config- Or
$KUBECONFIGenvironment variable
Request Format
Query Parameters
All resource endpoints accept:Headers
Response Format
Success Response
Error Response
HTTP Status Codes
Rate Limiting
No rate limiting currently implemented. For production deployments, consider:- nginx rate limiting
- API gateway
- Custom middleware
Pagination
Not currently implemented. All list endpoints return full results. For large clusters:- Use namespace filtering
- Implement label selectors
- Future: Add
limitandoffsetparams
Error Handling
Kubernetes API Errors
Connection Errors
Demo Mode
When app is in demo mode, API returns mock data:- No kubeconfig required
- Realistic mock data
- All endpoints functional
- Perfect for testing
API Endpoints Overview
Resources
Dashboard
Real-time
GitHub
AI
Settings
Common Patterns
Listing Resources
Getting Resource Details
Updating Resources
SDK / Client Libraries
Official SDK: Coming soon Manual Implementation:WebSocket Alternative
Orphelix uses Server-Sent Events (SSE) instead of WebSocket for real-time updates. Why SSE:- Simpler protocol (HTTP)
- Automatic reconnection
- One-way communication (sufficient for monitoring)
- Built into browsers
API Versioning
Current version: v1 (implicit) No versioning prefix currently used. Future versions may use:OpenAPI Specification
Coming soon: OpenAPI 3.0 spec for automatic client generation Will be available at:Examples
cURL
JavaScript (fetch)
Python
Rate Limits & Best Practices
Recommendations
- Use SSE for real-time updates - Don’t poll
- Cache responses - Use
staleTimein React Query - Batch requests - Fetch related data together
- Use namespaces - Filter by namespace when possible
- Handle errors gracefully - Retry with exponential backoff
Example with React Query
Security
CORS
CORS is disabled by default (same-origin only). To enable for external clients:API Keys
Not currently implemented. For API key authentication in future:Next Steps
Deployments API
Deployment endpoints reference
Pods API
Pod endpoints reference
Nodes API
Node endpoints reference
Real-time API
SSE streaming reference