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/health

Returns server health status.

curl http://localhost:8080/health
Responsejson
{
  "status": "ok"
}

List Clusters

GET/api/clusters

Returns all available clusters.

Responsejson
{
  "clusters": [
    {
      "id": "production",
      "name": "production",
      "context": "production-context",
      "status": "healthy"
    }
  ]
}

Get Cluster

GET/api/clusters/:id

Returns details for a specific cluster.

Get Cluster Nodes

GET/api/clusters/:id/nodes

Returns 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/pods

Returns all pods in the cluster.

Query Parameters:
  • namespace — Filter by namespace

Get Cluster Deployments

GET/api/clusters/:id/deployments

Returns all deployments in the cluster.

Get Cluster Services

GET/api/clusters/:id/services

Returns all services in the cluster.

Get Cluster Namespaces

GET/api/clusters/:id/namespaces

Returns all namespaces in the cluster.

Get Pod Logs

GET/api/clusters/:id/pods/:namespace/:podName/logs

Returns 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/deployments

Compare deployments across clusters.

Query Parameters:
  • clusters — Comma-separated cluster IDs
  • namespace — Filter by namespace
curl "http://localhost:8080/api/compare/deployments?clusters=production,staging"

Error Responses

All endpoints return standard HTTP status codes:

StatusDescription
200Success
401Unauthorized - authentication required
403Forbidden - insufficient permissions
404Resource not found
500Internal server error
Error Responsejson
{
  "error": "Cluster not found"
}