Automated tool to fetch container runtime specifications from various orchestrators (Kubernetes, Docker Swarm, Nomad, etc.) and generate standardized YAML manifests for easy consumption by deployment pipelines and infrastructure tools.
- π§ Unified Schema: Consistent YAML output format for declarative infrastructure
- π Auto Discovery: Intelligent detection of runtime features (GPU access, persistent volumes, network policies)
- ποΈ Multi-Orchestrator: Extensible architecture supporting multiple container platforms
- β‘ Parallel Collection: Efficient concurrent data retrieval from multiple control planes
- π Consolidated Output: Generate both platform-specific manifests and complete environment files
- π€ CI/CD Integration: Automated scheduled updates for runtime specifications
- Go 1.21+
- Make
git clone https://github.com/container-core/runtime-spec.git
cd runtime-spec
make buildCollect runtime specs from all orchestrators:
go run main.go collect-allSpecify output location:
go run main.go collect-all -d ./manifestsCollect from specific platforms:
go run main.go collect-platforms -p kubernetes,nomad# Collect from all platforms
go run main.go collect-all [FLAGS]
# Collect from specific platforms
go run main.go collect-platforms -p <PLATFORMS> [FLAGS]
Flags:
-d, --directory <DIR> Output directory [default: specs]
-c, --config <CONFIG> Configuration file [default: config/orchestrators.yaml]
-v, --verbose Enable verbose loggingplatform: kubernetes
platformName: Kubernetes
lastUpdated: 2025-01-15T10:30:00Z
runtimes:
- id: containerd/stable
name: Containerd Stable
cgroupDriver: systemd
storageDriver: overlay2
gpuSupport: true
volumeTypes:
- persistent
- ephemeral
networkPlugins:
- cni
- calico
description: Production-grade container runtime with full Kubernetes integration...version: 2.1.0
generatedAt: 2025-01-15T10:30:00Z
totalRuntimes: 24
orchestrators:
kubernetes:
platformId: kubernetes
platformName: Kubernetes
runtimes:
- id: containerd/stable
name: Containerd Stable
cgroupDriver: systemd
storageDriver: overlay2
gpuSupport: true
volumeTypes:
- persistent
- ephemeral
networkPlugins:
- cni
- calicoCreate config/orchestrators.yaml file:
kubernetes:
api_endpoint: "https://k8s-api.cluster.local"
auth_token_env: "KUBERNETES_TOKEN"
timeout: 45
rate_limit: 15
nomad:
api_endpoint: "https://nomad-server.local:4646"
auth_token_env: "NOMAD_TOKEN"
timeout: 30
docker_swarm:
api_endpoint: "https://swarm-manager.local:2376"
tls_verify: true
timeout: 25For secured orchestrators, set corresponding environment variables:
export KUBERNETES_TOKEN="bearer-token-here"
export NOMAD_TOKEN="nomad-secret-here"The project includes GitLab CI pipeline with multiple execution modes:
- Code Updates: Triggers on merge to main branch (go.mod, main.go, pipeline config)
- Version Tags: Automatically triggered by
v*.*.*tags
- Pipeline Dispatch: Manual execution with platform selection - Creates merge request
- Tag Deployment: Create and push
vx.y.ztag for versioned deployments
- Manual/Pipeline: Creates merge request for team review
- Direct Commits: Immediate commit to main branch (bypasses review)
- Tag Events: Deployment-only, no code changes
# Create versioned deployment
git tag v2.1.0
git push origin v2.1.0
# Automated pipeline will:
# 1. Collect latest runtime specifications
# 2. Generate YAML manifests
# 3. Create deployment package with comprehensive assets
# 4. Upload platform-specific archivesEach tagged release includes:
- π Runtime statistics and platform metrics
- β±οΈ Generation timestamp
- ποΈ Complete bundle (
runtime-specs-{version}.tar.gz) - π Individual platform archives
- π Direct YAML file access
- π οΈ Integration templates
βββ cmd/
β βββ collector/ # CLI entry point
βββ internal/
β βββ models/ # Type definitions
β βββ platforms/ # Orchestrator implementations
β βββ fetcher/ # Data collection logic
β βββ generator/ # Manifest generation
β βββ config/ # Configuration handling
βββ specs/ # Generated YAML files
βββ runtime_manifests/ # Git-tracked specification files
βββ docs/ # Technical documentation
βββ .gitlab/ # CI/CD configuration
- Create new file in
internal/platforms/(e.g.,mesos.go) - Implement the
PlatformCollectorinterface:
type MesosCollector struct {}
func (m *MesosCollector) FetchRuntimes() ([]RuntimeSpec, error) {
// Implement API calls and data transformation
}
func (m *MesosCollector) PlatformID() string { return "mesos" }
func (m *MesosCollector) PlatformName() string { return "Apache Mesos" }- Register collector in
internal/platforms/registry.go - Add platform to main configuration
Detailed implementation guide: Platform Integration
- β Kubernetes - 24 runtimes with GPU, storage, and network capability detection
- π§ Nomad - In development
- π§ Docker Swarm - Planned
- π§ Apache Mesos - Planned
go test ./...DEBUG=true go run main.go collect-allgo fmt ./...
go vet ./...
staticcheck ./...- Architecture Overview - System design and components
- Platform Development - Guide for adding new platforms
- Schema Validation - YAML structure specifications
- Integration Patterns - Usage examples and best practices
# GitLab CI example
stages:
- collect
- validate
- deploy
collect_specs:
stage: collect
script:
- go run main.go collect-all -d ./generated
artifacts:
paths:
- generated/Generated YAML files support:
- π Runtime capability analysis
- π Platform feature comparison
- π° Cost optimization insights
- π Performance benchmarking
Feature requests and code contributions welcome!
- Fork repository
- Create feature branch
- Implement changes
- Submit merge request
Thanks to container orchestrator communities for providing comprehensive APIs and specifications.