Getting Started

Prerequisites

  • Go 1.18 or later
  • Node.js 16 or later
  • protoc (Protocol Buffers compiler)
  • Docker (optional, for container builds)
  • Kubernetes cluster (for deployment)

Quick Start

1. Clone the Repository

git clone https://github.com/thekubefleet/kubefleet.git
cd kubefleet

2. Install Dependencies

# Install Go dependencies
go mod tidy

# Install Node.js dependencies
cd dashboard
npm install
cd ..

3. Generate Protobuf Code

protoc --go_out=. --go_opt=paths=source_relative \
       --go-grpc_out=. --go-grpc_opt=paths=source_relative \
       proto/agent.proto

4. Start the Dashboard Server

go run ./cmd/server

5. Start the React Development Server

cd dashboard
npm start

6. Run the Agent

go run ./cmd/agent

7. Access the Dashboard

Open your browser and navigate to:

http://localhost:3000

Using the Log Viewer

KubeFleet includes a comprehensive log viewer for monitoring pod logs in real-time.

Accessing Logs

  1. Navigate to the dashboard and expand any namespace
  2. Find a pod in the namespace list
  3. Click the icon next to the pod name
  4. The log viewer will open in a modal dialog

Log Viewer Features

Container Selection

Choose specific containers or view all containers in the pod

Log Level Filtering

Filter by ERROR, WARN, INFO, DEBUG levels

Text Search

Search for specific text patterns in log messages

Auto-refresh

Toggle real-time log updates every 5 seconds

Log Actions

Download: Export filtered logs as a text file
Refresh: Manually refresh logs
Clear: Clear the current log view

Log Viewer Interface

KubeFleet Log Viewer Interface

The log viewer provides a comprehensive interface for monitoring pod logs with real-time updates, filtering, and search capabilities.

Docker Deployment

Build Containers

# Build agent
docker build -t kubefleet-agent:latest .

# Build dashboard
docker build -f Dockerfile.dashboard -t kubefleet-dashboard:latest .

Deploy to Kubernetes

# Deploy dashboard
kubectl apply -f deploy/dashboard-deployment.yaml

# Deploy agent
kubectl apply -f deploy/agent-deployment.yaml

# Check deployment status
kubectl get pods -l app=kubefleet-dashboard
kubectl get pods -l app=kubefleet-agent

Access the Dashboard

# Port forward to access dashboard
kubectl port-forward svc/kubefleet-dashboard 3000:3000

Then visit http://localhost:3000

Configuration

Environment Variables

Agent Configuration

KUBEFLEET_SERVER_ADDR=localhost:50051 # gRPC server address

Dashboard Server Configuration

HTTP_PORT=3000 # HTTP server port
GRPC_PORT=50051 # gRPC server port

RBAC Permissions

The agent requires the following Kubernetes permissions:

  • Read access to namespaces, pods, services, and deployments
  • Read access to metrics API (if available)
  • Read access to pod logs for log monitoring functionality

Troubleshooting

Agent can't connect to dashboard

  • Check the KUBEFLEET_SERVER_ADDR environment variable
  • Verify the dashboard service is running
  • Check network connectivity between agent and dashboard

Dashboard shows no data

  • Check if the agent is running and sending data
  • Verify the gRPC connection is working
  • Check the dashboard server logs

React app not loading

  • Ensure the React development server is running on port 3001
  • Check browser console for errors
  • Verify all dependencies are installed

Next Steps

What's Next?