Control plane for managing hosted StreamingFast services on Kubernetes.
├── cli/ # TypeScript CLI for interacting with control plane
├── cmd/control-freak/ # Go gRPC server
├── grpc/ # gRPC service implementations
├── k8s/
│ ├── deployer/ # K8s deployment logic
│ └── setup/ # Local development environment (START HERE!)
├── pb/ # Generated protobuf code
├── proto/ # Public proto definitions
└── proto-internal/ # Internal proto definitions
Want to test without touching production? Start here!
# One-time setup (creates local K8s cluster)
go run ./cmd/control-freak k8s setup
# Start port forwards (runs in foreground, Ctrl+C to stop)
go run ./cmd/control-freak k8s port-forward
# Run CLI (in another terminal)
cd cli
NODE_ENV=local bun run index.ts🎉 You now have a complete local environment with:
- Local Kubernetes cluster (Kind)
- gRPC server running
- Redis for state
- 3 test deployments you can scale
📖 Full guide: k8s/setup/QUICKSTART.md
📚 Detailed docs: k8s/setup/README.md
- Deploy: Create new service deployments on Kubernetes
- SetReplica: Scale deployments up or down
- Pod Tracking: Real-time monitoring of deployment state via Redis
- TUI: Beautiful terminal interface for operations
# Build and run gRPC server
go build -o control-freak ./cmd/control-freak
./control-freak
# Run CLI (in separate terminal)
cd cli
bun run index.ts- Download and install GitHub Actions Runner
- Configure with your repo token
- Ensure Kind, Docker, kubectl are installed
- Runner will execute tests on your local machine/cluster
GitHub Actions uses ubuntu-latest with Kind for isolated testing.
# Edit Go code, then:
go run ./cmd/control-freak k8s restart# Edit TypeScript code, then:
cd cli
NODE_ENV=local bun run index.tsgo run ./cmd/control-freak k8s teardownThis project is optimized for AI-assisted development using GitHub Copilot and GitHub Actions.
- Planning: Create GitHub Issues for feature requests or bugs
- Development: Copilot suggests code changes in PRs
- Testing: GitHub Actions automatically run tests on Kind cluster
- Review: Copilot assists with code reviews and merges
- Local: Use
go test ./k8s/... -v(auto-sets up Kind cluster if needed) - CI: GitHub Actions automatically run tests on Kind cluster
- Specific Suite: Use workflow dispatch with
test_suiteinput
- Copilot creates PRs with code changes
- Actions run tests automatically
- On success, PR can be auto-merged (configure branch protection)
| Variable | Default | Description |
|---|---|---|
NODE_ENV |
production | local for dev cluster, production for prod |
GRPC_HOST |
Varies by env | gRPC server address |
REDIS_ADDR |
Varies by env | Redis server address |
NAMESPACE |
default | Kubernetes namespace for deployments |
┌─────────────┐ gRPC ┌──────────────┐
│ CLI │◄────────────────►│ control-freak│
│ (TypeScript)│ │ (Go) │
└─────────────┘ └──────┬───────┘
│
│ manages
▼
┌──────────────┐
│ Kubernetes │
│ StatefulSets│
└──────────────┘
│
│ state
▼
┌──────────────┐
│ Redis │
└──────────────┘
See LICENSE file.