HyperFleet API - Simple REST API for cluster lifecycle management. Provides CRUD operations for clusters and status sub-resources. Pure data layer with PostgreSQL integration - no business logic or event creation. Stateless design enables horizontal scaling.
- Language: Go 1.24+
- API Definition: OpenAPI 3.0
- Code Generation: openapi-generator-cli
- Database: PostgreSQL with GORM ORM
- Container Runtime: Podman
- Testing: Gomega + Resty
- OpenAPI 3.0 specification
- Automated Go code generation from OpenAPI
- Cluster and NodePool lifecycle management
- Adapter-based status reporting with Kubernetes-style conditions
- Pagination and search capabilities
- Complete integration test coverage
- Database migrations with GORM
- Embedded OpenAPI specification using
//go:embed
hyperfleet-api/
├── cmd/hyperfleet-api/ # Application entry point
├── pkg/
│ ├── api/ # API models and handlers
│ ├── dao/ # Data access layer
│ ├── db/ # Database setup and migrations
│ ├── handlers/ # HTTP request handlers
│ └── services/ # Business logic
├── openapi/ # API specification source
├── test/ # Integration tests and factories
├── docs/ # Detailed documentation
└── Makefile # Build automation
- Go 1.24+, Podman, PostgreSQL 13+, Make
See PREREQUISITES.md for installation instructions.
# 1. Generate OpenAPI code and mocks
make generate-all
# 2. Install dependencies
go mod download
# 3. Build binary
make binary
# 4. Setup database
make db/setup
# 5. Run migrations
./hyperfleet-api migrate
# 6. Start service (no auth)
make run-no-authNote: Generated code is not tracked in git. You must run make generate-all after cloning.
The service starts on localhost:8000:
- REST API:
http://localhost:8000/api/hyperfleet/v1/ - OpenAPI spec:
http://localhost:8000/api/hyperfleet/v1/openapi - Swagger UI:
http://localhost:8000/api/hyperfleet/v1/openapi.html - Health check:
http://localhost:8083/healthcheck - Metrics:
http://localhost:8080/metrics
# Test the API
curl http://localhost:8000/api/hyperfleet/v1/clusters | jqKubernetes clusters with provider-specific configurations, labels, and adapter-based status reporting.
Main endpoints:
GET/POST /api/hyperfleet/v1/clustersGET /api/hyperfleet/v1/clusters/{id}GET/POST /api/hyperfleet/v1/clusters/{id}/statuses
Groups of compute nodes within clusters.
Main endpoints:
GET /api/hyperfleet/v1/nodepoolsGET/POST /api/hyperfleet/v1/clusters/{cluster_id}/nodepoolsGET /api/hyperfleet/v1/clusters/{cluster_id}/nodepools/{nodepool_id}GET/POST /api/hyperfleet/v1/clusters/{cluster_id}/nodepools/{nodepool_id}/statuses
Both resources support pagination, label-based search, and adapter status reporting. See docs/api-resources.md for complete API documentation.
# Create a cluster
curl -X POST http://localhost:8000/api/hyperfleet/v1/clusters \
-H "Content-Type: application/json" \
-d '{"kind": "Cluster", "name": "my-cluster", "spec": {...}, "labels": {...}}' | jq
# Search clusters
curl -G http://localhost:8000/api/hyperfleet/v1/clusters \
--data-urlencode "search=labels.env='production'" | jqmake binary # Build binary
make run-no-auth # Run without authentication
make test # Run unit tests
make test-integration # Run integration tests
make generate # Generate OpenAPI models
make generate-mocks # Generate test mocks
make generate-all # Generate OpenAPI models and mocks
make db/setup # Create PostgreSQL container
make image # Build container imageSee docs/development.md for detailed workflows.
This project uses pre-commit for code quality checks. See docs/development.md for setup instructions.
- API Resources - API endpoints, data models, and search capabilities
- Development Guide - Local setup, testing, code generation, and workflows
- Database - Schema, migrations, and data model
- Deployment - Container images, Kubernetes deployment, and configuration
- Authentication - Development and production auth
- PREREQUISITES.md - Prerequisite installation
- docs/continuous-delivery-migration.md - CD migration guide
- docs/dao.md - Data access patterns
- docs/testcontainers.md - Testcontainers usage
[License information to be added]