Skip to main content

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

Production:

Authentication

GitHub OAuth

Most endpoints work without authentication. GitHub integration requires OAuth:
Session cookie:
  • next-auth.session-token (httpOnly, secure)

Kubernetes Access

API uses kubeconfig from server’s filesystem:
  • ~/.kube/config
  • Or $KUBECONFIG environment variable

Request Format

Query Parameters

All resource endpoints accept:
Example:

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 limit and offset params

Error Handling

Kubernetes API Errors

Connection Errors

Demo Mode

When app is in demo mode, API returns mock data:
Demo mode features:
  • 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
See Real-time API for details.

API Versioning

Current version: v1 (implicit) No versioning prefix currently used. Future versions may use:
Breaking changes will be announced in release notes.

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

  1. Use SSE for real-time updates - Don’t poll
  2. Cache responses - Use staleTime in React Query
  3. Batch requests - Fetch related data together
  4. Use namespaces - Filter by namespace when possible
  5. 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