The master controller exposes a RESTful API on port 8070 for managing tasks, pods, services, and worker nodes.
When authentication is enabled, include the JWT token in the Authorization header:
Authorization: Bearer <token>GET /health
curl http://localhost:8070/healthReturns service status and authentication state.
Submit a new task for execution.
POST /api/v1/tasks
Content-Type: application/json
{
"name": "my-nginx-task",
"image": "nginx:latest",
"env": {
"PORT": "8080"
}
}Example:
curl -X POST http://localhost:8070/api/v1/tasks \
-H "Content-Type: application/json" \
-d '{"name":"nginx-task","image":"nginx:latest"}'GET /api/v1/tasks
curl http://localhost:8070/api/v1/tasksGET /api/v1/tasks/{taskId}
curl http://localhost:8070/api/v1/tasks/20250119123456-abc12345Update task execution status (typically called by workers).
PUT /api/v1/tasks/{taskId}/status
Content-Type: application/json
{
"status": "running",
"containerId": "docker-container-id"
}pending → scheduled → running → completed/failed
| Status | Description |
|---|---|
| pending | Task created, awaiting scheduling |
| scheduled | Task assigned to a worker node |
| running | Task is executing on a worker |
| completed | Task finished successfully |
| failed | Task execution failed |
Pods are groups of one or more containers with shared lifecycle.
POST /api/v1/pods
Content-Type: application/json
{
"name": "my-web-app",
"namespace": "production",
"labels": {
"app": "web",
"version": "1.0"
},
"containers": [
{
"name": "app",
"image": "myapp:1.0",
"env": {"PORT": "8080"}
},
{
"name": "sidecar",
"image": "nginx:latest"
}
]
}Example:
curl -X POST http://localhost:8070/api/v1/pods \
-H "Content-Type: application/json" \
-d '{"name":"web-pod","containers":[{"name":"nginx","image":"nginx:latest"}]}'GET /api/v1/pods
curl http://localhost:8070/api/v1/podsGET /api/v1/pods/{podId}
curl http://localhost:8070/api/v1/pods/20250119123456-pod123DELETE /api/v1/pods/{podId}
curl -X DELETE http://localhost:8070/api/v1/pods/20250119123456-pod123pending → scheduled → running → succeeded/failed
| Status | Description |
|---|---|
| pending | Pod created, awaiting scheduling |
| scheduled | Pod assigned to a worker node |
| running | All containers in pod are running |
| succeeded | All containers exited with code 0 |
| failed | One or more containers failed |
Services provide stable endpoints for discovering and accessing pods.
POST /api/v1/services
Content-Type: application/json
{
"name": "web-service",
"namespace": "default",
"selector": {
"app": "nginx"
},
"ports": [
{
"name": "http",
"port": 80,
"targetPort": 8080
}
]
}GET /api/v1/services
GET /api/v1/services?namespace=production
curl http://localhost:8070/api/v1/servicesGET /api/v1/services/{serviceId}
curl http://localhost:8070/api/v1/services/20250119123456-svc123GET /api/v1/services/{serviceId}/endpoints
curl http://localhost:8070/api/v1/services/20250119123456-svc123/endpointsDELETE /api/v1/services/{serviceId}
curl -X DELETE http://localhost:8070/api/v1/services/20250119123456-svc123POST /api/v1/nodes/register
Content-Type: application/json
{
"hostname": "worker-1",
"port": 8081,
"capacity": 10
}POST /api/v1/nodes/{nodeId}/heartbeat
curl -X POST http://localhost:8070/api/v1/nodes/worker-1/heartbeatGET /api/v1/nodes
curl http://localhost:8070/api/v1/nodesThese endpoints are exposed by worker nodes (port 8081+).
Called by master to execute a task on the worker.
POST /api/v1/tasks/:id/execute
Content-Type: application/json
{
"task": {
"taskId": "task-id",
"name": "my-task",
"image": "nginx:latest",
"env": {"PORT": "8080"}
}
}GET /api/v1/tasks/:id/status
curl http://localhost:8081/api/v1/tasks/task-id/statusGET /api/v1/tasks/:id/logs?tail=100
curl http://localhost:8081/api/v1/tasks/task-id/logs?tail=100Import the provided Postman collection to test all endpoints:
- Import
docs/postman/Podling.postman_collection.jsoninto Postman - Import
docs/postman/Podling.postman_environment.jsonfor local environment - Select "Podling - Local" environment
- Start testing the API
See POSTMAN_GUIDE.md for detailed testing workflow.