A distributed container orchestrator that schedules and manages containers across multiple nodes. Built with Go, BoltDB, and Docker, Cogsworth features a control plane for scheduling decisions and worker nodes that execute container workloads, similar to Kubernetes but simplified for learning and experimentation.
- Multi-node orchestration: Deploy containers across multiple worker nodes
- Intelligent scheduling: Automatically assigns containers to least-loaded nodes
- Self-healing: Automatically restarts failed containers (up to 3 attempts)
- Node health monitoring: Detects unhealthy nodes and reschedules their containers
- Reconciliation loop: Continuously ensures actual state matches desired state
- REST API: Control plane exposes HTTP API for cluster management
- Persistent state: Uses BoltDB to store container and node metadata
git clone https://github.com/galadd/cogsworth
cd cogsworth
go build -o cogs .- Start the controller plane
./cogs start-controlOutput:
Cogsworth Control Plane Starting...
API Server listening on :8080
Control plane node ID: control-plane-1
Starting reconciliation loop (interval: 5s)
- Start Worker nodes
In separate terminals, start on one or more worker nodes
# Terminal 2: Worker Node 1
./cogs start-worker http://localhost:8080
# Terminal 3: Worker Node 2
./cogs start-worker http://localhost:8080# to list all nodes
./cogs nodes# to add a container
./cogs add <image> <host_port>:<container_port># to delete a container
./cogs rm <container_id># list all containers
./cogs ls# clean up all
./cogs clean