API Reference
Kubey exposes a REST API for programmatic access to cluster data.
Authentication
In single mode, no authentication is required. In shared or hybrid mode, requests must include cookies from an authenticated session.
Endpoints
Health Check
GET
/healthReturns server health status.
curl http://localhost:8080/healthResponsejson
{
"status": "ok"
}List Clusters
GET
/api/clustersReturns all available clusters.
Responsejson
{
"clusters": [
{
"id": "production",
"name": "production",
"context": "production-context",
"status": "healthy"
}
]
}Get Cluster
GET
/api/clusters/:idReturns details for a specific cluster.
Get Cluster Nodes
GET
/api/clusters/:id/nodesReturns all nodes in the cluster.
Responsejson
{
"nodes": [
{
"name": "node-1",
"status": "Ready",
"roles": ["control-plane", "master"],
"kubeletVersion": "v1.28.0",
"osImage": "Ubuntu 22.04.3 LTS",
"architecture": "amd64"
}
]
}Get Cluster Pods
GET
/api/clusters/:id/podsReturns all pods in the cluster.
Query Parameters:
namespace— Filter by namespace
Get Cluster Deployments
GET
/api/clusters/:id/deploymentsReturns all deployments in the cluster.
Get Cluster Services
GET
/api/clusters/:id/servicesReturns all services in the cluster.
Get Cluster Namespaces
GET
/api/clusters/:id/namespacesReturns all namespaces in the cluster.
Get Pod Logs
GET
/api/clusters/:id/pods/:namespace/:podName/logsReturns logs for a specific pod.
Query Parameters:
container— Container name (optional)tailLines— Number of lines from the end (default: 100)previous— Get logs from previous container instance
Compare Deployments
GET
/api/compare/deploymentsCompare deployments across clusters.
Query Parameters:
clusters— Comma-separated cluster IDsnamespace— Filter by namespace
curl "http://localhost:8080/api/compare/deployments?clusters=production,staging"Error Responses
All endpoints return standard HTTP status codes:
| Status | Description |
|---|---|
| 200 | Success |
| 401 | Unauthorized - authentication required |
| 403 | Forbidden - insufficient permissions |
| 404 | Resource not found |
| 500 | Internal server error |
Error Responsejson
{
"error": "Cluster not found"
}