Kubernetes API¶
API endpoints for Kubernetes cluster management.
Health¶
Get Cluster Health¶
Response:
{
"status": "healthy",
"nodes": {
"total": 3,
"ready": 3
},
"pods": {
"total": 47,
"running": 45,
"pending": 1,
"failed": 1
}
}
Pods¶
List Pods¶
Query Parameters: | Parameter | Type | Description | |-----------|------|-------------| | namespace | string | Filter by namespace | | label | string | Filter by label selector |
Response:
[
{
"name": "nginx-abc123",
"namespace": "default",
"status": "Running",
"containers": ["nginx"],
"ready_containers": 1,
"total_containers": 1,
"restarts": 0,
"age": "2d",
"node": "node-1"
}
]
Get Pod Details¶
Get Pod Logs¶
Query Parameters: | Parameter | Type | Description | |-----------|------|-------------| | container | string | Container name | | tail | int | Number of lines | | timestamps | bool | Include timestamps |
Delete Pod¶
Deployments¶
List Deployments¶
Scale Deployment¶
Request Body:
Restart Deployment¶
Request Body:
Services¶
List Services¶
Nodes¶
List Nodes¶
Get Node Details¶
Namespaces¶
List Namespaces¶
Apply Manifest¶
Apply YAML¶
Request Body:
WebSocket Endpoints¶
Stream Logs¶
Query Parameters: - container - Container name - tail_lines - Initial lines (default: 100) - timestamps - Include timestamps
Messages:
{"type": "log", "content": "Log line here"}
{"type": "status", "status": "connected"}
{"type": "error", "error": "...", "code": 500}
Pod Exec¶
Query Parameters: - container - Container name - shell - Shell path (default: /bin/sh)
Client Messages:
Server Messages: