Files
claude-code/dashboard
OpenCode Test c14bae9a12 feat: Implement Phase 3 automation for K8s agent system
Automation components for scheduled and event-driven workflows:

Scheduler:
- scheduler.sh for cron-based workflow execution
- Logs workflow runs to ~/.claude/logs/workflows/
- Notifies dashboard on completion

Alertmanager Integration:
- webhook-receiver.sh for processing alerts
- Dashboard endpoint /api/webhooks/alertmanager
- Example alertmanager-config.yaml with routing rules
- Maps alerts to workflows (crashloop, node issues, resources)

New Incident Workflows:
- node-issue-response.yaml: Handle NotReady/unreachable nodes
- resource-pressure-response.yaml: Respond to memory/CPU overcommit
- argocd-sync-failure.yaml: Investigate and fix sync failures

Dashboard Updates:
- POST /api/webhooks/alertmanager endpoint
- POST /api/workflows/{name}/complete endpoint
- Alerts create pending actions for visibility

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

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

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

# 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

# Build multi-arch image
docker buildx build --platform linux/arm64 -t ghcr.io/user/k8s-agent-dashboard:latest .

Deployment

Using Kustomize

kubectl apply -k deploy/

Using ArgoCD

  1. Copy deploy/ contents to your GitOps repo under apps/k8s-agent-dashboard/
  2. Apply the ArgoCD application:
    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.