Workloads API
List Kubernetes workloads (Deployments, StatefulSets, DaemonSets), get per-workload metrics, and view node distribution via the Kubeadapt API.
Workload endpoints return data for Kubernetes workloads (Deployments, StatefulSets, DaemonSets, etc.) across your clusters.
Required scope: workloads:read
List Workloads
text
GET /v1/workloadsReturns a paginated list of workloads across your organization.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
cluster_id | string | Filter by cluster ID | |
namespace | string | Filter by namespace | |
kind | string | Filter by workload kind (e.g., Deployment, StatefulSet, DaemonSet) | |
limit | integer | 100 | Number of results to return (1 to 500) |
offset | integer | 0 | Number of results to skip |
Example Request
bash
curl -H "Authorization: Bearer ka_your_api_key" \
"https://public-api.kubeadapt.io/v1/workloads?cluster_id=cls-abc123&namespace=production&limit=25"Example Response
json
{
"workloads": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"workload_uid": "7fca72fc-5bec-4e8d-b85c-c4e2aa50427b",
"cluster_id": "cls-abc123",
"cluster_name": "prod-us-east",
"namespace": "production",
"workload_name": "api-server",
"workload_kind": "Deployment",
"replicas": 3,
"available_replicas": 3,
"cpu_request": 0.5,
"cpu_limit": 1.0,
"memory_request_gb": 0.5,
"memory_limit_gb": 1.0,
"hourly_cost": 0.85,
"efficiency_score": 0.72,
"monthly_cost": 620.5
}
],
"total": 142
}Workload Metrics
text
GET /v1/workloads/{workload_uid}/metricsReturns time-series CPU, memory, and cost metrics for a specific workload.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workload_uid | string | Yes | Workload UID |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
cluster_id | string | Required. The cluster the workload belongs to | |
timeframe | string | 7d | Time window. Valid values: 1h, 24h, 7d, 30d, 90d, 360d |
Example Request
bash
curl -H "Authorization: Bearer ka_your_api_key" \
"https://public-api.kubeadapt.io/v1/workloads/wl-xyz789/metrics?cluster_id=cls-abc123&timeframe=24h"Example Response
json
{
"workload_uid": "wl-xyz789",
"cluster_id": "cls-abc123",
"timeframe": "24h",
"data_points": [
{
"timestamp": "2026-03-10T12:00:00Z",
"cpu_usage": 0.31,
"cpu_request": 0.5,
"memory_usage_bytes": 408944640,
"memory_request_bytes": 536870912,
"hourly_cost": 0.84
},
{
"timestamp": "2026-03-10T13:00:00Z",
"cpu_usage": 0.34,
"cpu_request": 0.5,
"memory_usage_bytes": 415236096,
"memory_request_bytes": 536870912,
"hourly_cost": 0.85
}
]
}Workload Nodes
text
GET /v1/workloads/{workload_uid}/nodesReturns the nodes where a workload's pods are currently running, with per-node resource usage.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workload_uid | string | Yes | Workload UID |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
cluster_id | string | Required. The cluster the workload belongs to |
Example Request
bash
curl -H "Authorization: Bearer ka_your_api_key" \
"https://public-api.kubeadapt.io/v1/workloads/wl-xyz789/nodes?cluster_id=cls-abc123"Example Response
json
{
"workload_uid": "wl-xyz789",
"cluster_id": "cls-abc123",
"nodes": [
{
"node_uid": "nd-node01",
"node_name": "ip-10-0-1-100.ec2.internal",
"pod_count": 2,
"cpu_usage": 0.21,
"memory_usage_bytes": 274726912
},
{
"node_uid": "nd-node02",
"node_name": "ip-10-0-1-101.ec2.internal",
"pod_count": 1,
"cpu_usage": 0.11,
"memory_usage_bytes": 138217472
}
]
}Related
- Namespaces - Namespace-level cost and resource data
- Nodes - Per-node metrics and capacity
- Recommendations - Cost optimization suggestions for workloads