# Install Go dependencies
go mod download
# Run the API server
go run ./cmd/api
The API will be available at http://localhost:8080
In a new terminal:
cd frontend
npm install
npm start
The frontend will be available at http://localhost:3000
In another terminal:
# Build the CLI
go build -o bin/karpenter-optimizer ./cmd/cli
# Analyze example workloads
cat examples/workloads.json | ./bin/karpenter-optimizer analyze
# Or with JSON output
./bin/karpenter-optimizer analyze examples/workloads.json --json
# Build and start all services
docker-compose up --build
# The frontend will be at http://localhost:3000
# The API will be at http://localhost:8080
# Health check
curl http://localhost:8080/api/v1/health
# Analyze workloads
curl -X POST http://localhost:8080/api/v1/analyze \
-H "Content-Type: application/json" \
-d @examples/workloads.json
[
{
"name": "my-app",
"namespace": "default",
"cpu": "500m",
"memory": "512Mi",
"gpu": 0,
"labels": {}
}
]
http://localhost:3000