Introduction
The Kubernetes Dashboard API is a RESTful API that provides programmatic access to Kubernetes cluster resources through a unified interface. The API acts as a proxy between clients and the Kubernetes API server, offering enhanced features like metrics aggregation, resource management, and web terminal access.Base URL
All API endpoints are prefixed with:Example
Architecture
The Dashboard API consists of several key components:- API Handler: Core request routing and processing (
apihandler.go) - Resource Handlers: Kubernetes resource-specific endpoints
- Integration Manager: Metrics and external service integration
- Authentication: Bearer token-based authentication
- WebSocket Support: Real-time terminal and log streaming via SockJS
Server Configuration
The API server can be configured with the following options:The IP address on which to serve HTTPS (set to 0.0.0.0 for all interfaces)
The secure port to listen on for HTTPS
The IP address on which to serve HTTP (disabled by default)
The port to listen on for HTTP
Metrics provider for resource metrics (options:
sidecar, none)The metrics-scraper sidecar host URL
OpenAPI Documentation
When enabled, the API provides OpenAPI/Swagger documentation at:--enable-openapi flag.
Common Query Parameters
Many list endpoints support the following query parameters for filtering, sorting, and pagination:Comma-delimited string for filtering:
propertyName,filterValueExample: filterBy=name,nginxColumn name to sort byExample:
sortBy=creationTimestampNumber of items to return per page
Page number for pagination
Comma-separated list of metric names to downloadExample:
metricNames=cpu/usage,memory/usageAggregation methods for metrics (default:
sum)Options: sum, avg, min, maxResponse Format
All API responses are in JSON format with the following general structure:Success Response
Error Response
Content Types
The API accepts and returns the following content types:- Accept:
application/json - Content-Type:
application/json
Rate Limiting
The API implements client-side rate limiting with configurable QPS (queries per second) and burst settings:- Default QPS: Follows Kubernetes client-go defaults
- Configurable via server startup parameters
CSRF Protection
POST requests require CSRF token validation. Obtain a CSRF token using:One-time CSRF token for the specified action
X-CSRF-TOKEN header for POST requests.
Metrics Integration
The API supports metrics collection through the metrics-scraper sidecar:- CPU usage:
cpu/usage - Memory usage:
memory/usage - Custom metrics: Extensible through integrations
Proxy Mode
The API can run in proxy mode for development and testing, bypassing in-cluster authentication.Next Steps
Authentication
Learn about API authentication mechanisms
Resources
Explore Kubernetes resource endpoints
Handlers
Discover special handlers for terminal and logs
Metrics
Access metrics and monitoring data