Files
claude-code/dashboard/README.md
OpenCode Test 5646508adb feat: Implement Phase 2 dashboard for K8s agent system
Lightweight Go-based dashboard for Raspberry Pi cluster:

Backend:
- chi router with REST API
- Embedded static file serving
- JSON file-based state storage
- Health checks and CORS support

Frontend:
- Responsive dark theme UI
- Status view with nodes, alerts, ArgoCD apps
- Pending actions with approve/reject
- Action history and audit trail
- Workflow listing and manual triggers

Deployment:
- Multi-stage Dockerfile (small Alpine image)
- Kubernetes manifests with Pi 3 tolerations
- Resource limits: 32-64Mi memory, 10-100m CPU
- ArgoCD application manifest
- Kustomize configuration

API endpoints:
- GET /api/status - Cluster status
- GET/POST /api/pending - Action management
- GET /api/history - Action audit trail
- GET/POST /api/workflows - Workflow management

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 11:34:36 -08:00

98 lines
2.3 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
# 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 |
## 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.