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:string
default:"0.0.0.0"
The IP address on which to serve HTTPS (set to 0.0.0.0 for all interfaces)
number
default:"8443"
The secure port to listen on for HTTPS
string
The IP address on which to serve HTTP (disabled by default)
number
default:"8080"
The port to listen on for HTTP
string
default:"sidecar"
Metrics provider for resource metrics (options:
sidecar, none)string
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:string
Comma-delimited string for filtering:
propertyName,filterValueExample: filterBy=name,nginxstring
Column name to sort byExample:
sortBy=creationTimestampnumber
default:"10"
Number of items to return per page
number
default:"1"
Page number for pagination
string
Comma-separated list of metric names to downloadExample:
metricNames=cpu/usage,memory/usagestring
Aggregation 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:string
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