KubeFleet consists of three main components that work together to provide comprehensive Kubernetes monitoring with real-time log streaming:
Runs inside your Kubernetes cluster, collecting data about namespaces, pods, deployments, metrics, and pod logs with automatic level detection.
Go backend that receives data via gRPC, serves the React frontend via HTTP APIs, and provides real-time log streaming capabilities.
Modern web interface built with TypeScript and Material-UI for data visualization and comprehensive log monitoring with filtering and search.
Kubernetes Cluster → Agent → gRPC → Dashboard Server → HTTP → React Frontend
↓
Log Collection & Streaming
The main dashboard provides real-time cluster monitoring with namespace exploration and metrics visualization
Get all historical data points
{
"data": [
{
"resources": [...],
"metrics": [...],
"logs": [...],
"timestamp": 1640995200
}
],
"count": 10
}
Get the most recent data point
{
"data": {
"resources": [...],
"metrics": [...],
"logs": [...],
"timestamp": 1640995200
}
}
Get all logs from latest data
{
"logs": [
{
"namespace": "default",
"pod_name": "example-pod",
"container_name": "main",
"log_line": "INFO: Application started",
"timestamp": 1640995200,
"level": "INFO"
}
]
}
Get logs for a specific pod
{
"logs": [
{
"namespace": "default",
"pod_name": "example-pod",
"container_name": "main",
"log_line": "INFO: Application started",
"timestamp": 1640995200,
"level": "INFO"
}
]
}
Get logs for a specific container
{
"logs": [
{
"namespace": "default",
"pod_name": "example-pod",
"container_name": "main",
"log_line": "INFO: Application started",
"timestamp": 1640995200,
"level": "INFO"
}
]
}
Health check endpoint
{
"status": "healthy",
"dataPoints": 10
}
service AgentReporter {
rpc ReportData(AgentData) returns (ReportResponse);
rpc StreamPodLogs(LogRequest) returns (stream LogStream);
}
message AgentData {
repeated ResourceInfo resources = 1;
repeated ResourceMetrics metrics = 2;
repeated PodLog logs = 3;
int64 timestamp = 4;
}
message PodLog {
string namespace = 1;
string pod_name = 2;
string container_name = 3;
string log_line = 4;
int64 timestamp = 5;
string level = 6; // INFO, ERROR, WARN, DEBUG
}
message LogRequest {
string namespace = 1;
string pod_name = 2;
string container_name = 3; // Optional, if empty gets all containers
int32 tail_lines = 4; // Number of lines to fetch, default 100
bool follow = 5; // Whether to follow logs in real-time
}
message LogStream {
repeated PodLog logs = 1;
bool is_complete = 2;
}
Variable | Description | Default |
---|---|---|
KUBEFLEET_SERVER_ADDR | gRPC server address | localhost:50051 |
HTTP_PORT | HTTP server port | 3000 |
GRPC_PORT | gRPC server port | 50051 |
The agent requires the following permissions:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kubefleet-agent
rules:
- apiGroups: [""]
resources: ["namespaces", "pods", "services"]
verbs: ["get", "list"]
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["get", "list"]
- apiGroups: ["metrics.k8s.io"]
resources: ["pods", "nodes"]
verbs: ["get", "list"]
docker build -t kubefleet-agent:latest .
docker build -f Dockerfile.dashboard -t kubefleet-dashboard:latest .
Deploy using the provided manifests:
# Deploy dashboard
kubectl apply -f deploy/dashboard-deployment.yaml
# Deploy agent
kubectl apply -f deploy/agent-deployment.yaml
# Check status
kubectl get pods -l app=kubefleet-dashboard
kubectl get pods -l app=kubefleet-agent
The dashboard service exposes:
Both components include health check endpoints:
# Dashboard health check
curl http://localhost:3000/api/health
# Expected response
{
"status": "healthy",
"dataPoints": 10
}
Components log to stdout/stderr for Kubernetes log collection:
# View dashboard logs
kubectl logs -l app=kubefleet-dashboard
# View agent logs
kubectl logs -l app=kubefleet-agent
The dashboard collects and displays:
The log viewer provides: