Add comprehensive Claude Code monitoring and realtime streaming to the K8s dashboard. Includes API endpoints for health, stats, summary, inventory, and live event streaming. Frontend provides overview, usage, inventory, debug, and live feed views.
99 lines
2.4 KiB
Markdown
99 lines
2.4 KiB
Markdown
# K8s Agent Dashboard
|
|
|
|
Lightweight web dashboard for the K8s Agent Orchestrator system. Designed to run on Raspberry Pi clusters with minimal resource usage.
|
|
|
|
## Features
|
|
|
|
- **Cluster Status** - View node health, resource usage, and conditions
|
|
- **Pending Actions** - Approve or reject actions requiring confirmation
|
|
- **Action History** - Audit trail of all agent actions
|
|
- **Workflows** - View and trigger defined workflows
|
|
|
|
## Resource Requirements
|
|
|
|
Optimized for Raspberry Pi 3B+ (1GB RAM):
|
|
- Memory: 32-64Mi
|
|
- CPU: 10-100m
|
|
|
|
## Development
|
|
|
|
### Prerequisites
|
|
|
|
- Go 1.21+
|
|
- Docker (for building images)
|
|
|
|
### Local Development
|
|
|
|
```bash
|
|
# Run locally
|
|
go run ./cmd/server --port 8080 --data ./data --claude ~/.claude
|
|
|
|
# Build binary
|
|
go build -o server ./cmd/server
|
|
|
|
# Build Docker image
|
|
docker build -t k8s-agent-dashboard:dev .
|
|
```
|
|
|
|
### Build for ARM64
|
|
|
|
```bash
|
|
# Build multi-arch image
|
|
docker buildx build --platform linux/arm64 -t ghcr.io/user/k8s-agent-dashboard:latest .
|
|
```
|
|
|
|
## Deployment
|
|
|
|
### Using Kustomize
|
|
|
|
```bash
|
|
kubectl apply -k deploy/
|
|
```
|
|
|
|
### Using ArgoCD
|
|
|
|
1. Copy `deploy/` contents to your GitOps repo under `apps/k8s-agent-dashboard/`
|
|
2. Apply the ArgoCD application:
|
|
```bash
|
|
kubectl apply -f deploy/argocd-application.yaml
|
|
```
|
|
|
|
## Configuration
|
|
|
|
### Environment Variables
|
|
|
|
| Variable | Default | Description |
|
|
|----------|---------|-------------|
|
|
| PORT | 8080 | Server port |
|
|
|
|
### Command Line Flags
|
|
|
|
| Flag | Default | Description |
|
|
|------|---------|-------------|
|
|
| --port | 8080 | Server port |
|
|
| --data | /data | Data directory for persistent state |
|
|
| --claude | ~/.claude | Claude Code directory |
|
|
|
|
## API Endpoints
|
|
|
|
| Method | Path | Description |
|
|
|--------|------|-------------|
|
|
| GET | /api/health | Health check |
|
|
| GET | /api/status | Cluster status |
|
|
| GET | /api/pending | Pending actions |
|
|
| POST | /api/pending/{id}/approve | Approve action |
|
|
| POST | /api/pending/{id}/reject | Reject action |
|
|
| GET | /api/history | Action history |
|
|
| GET | /api/workflows | List workflows |
|
|
| POST | /api/workflows/{name}/run | Trigger workflow |
|
|
|
|
## Integration with Claude Code
|
|
|
|
The dashboard reads/writes state files that can be shared with Claude Code agents:
|
|
|
|
- `status.json` - Cluster status (written by agents)
|
|
- `pending.json` - Pending actions (read/write)
|
|
- `history.json` - Action history (append by agents)
|
|
|
|
To share state, mount the same PVC or directory in both the dashboard and Claude Code's data directory.
|