How spegel-org/spegel works
Spegel is a stateless, cluster-local OCI registry mirror. A workload’s image pull reaches Spegel’s registry API, which serves content from the local containerd store when available and can obtain missing content from external registries or peers. The runtime also shares content availability through libp2p and exposes operational metrics and a web interface. The graph preserves these documented capabilities; implementation details for some unsampled modules are limited to source-index references, so uncertain links are omitted.
Main entry points: main.go Runtime setup · registry.go Registry API · containerd.go Containerd store · web.go Web dashboard
Components 17
Runtime
- Runtime setup
main.go - Registry API
pkg/registry/registry.go
Image content
- OCI protocol
pkg/oci/distribution.go - Remote OCI client
pkg/oci/client.go - Containerd store
pkg/oci/containerd/containerd.go - Content index
pkg/oci/containerd/index.go - Mirror configuration
pkg/oci/containerd/mirror.go - Image metadata
pkg/oci/image.go
Peer network
- Libp2p router
pkg/routing/libp2p/libp2p.go - Routing model
pkg/routing/routing.go - Store sync
pkg/routing/sync.go
Operations
- Web dashboard
pkg/web/web.go - Prometheus metrics
pkg/metrics/metrics.go - Cleanup probes
pkg/cleanup/cleanup.go - Preflight checks
pkg/preflight/preflight.go
Other components
- Image puller
- External registry
Connections 22
- Image puller → Registry API: requests images
pkg/registry/registry.go - Runtime setup → Containerd store: initializes store
main.go - Runtime setup → Libp2p router: starts routing
main.go - Runtime setup → Registry API: starts API
main.go - Runtime setup → Web dashboard: starts dashboard
main.go - Runtime setup → Prometheus metrics: registers metrics
main.go - Runtime setup → Mirror configuration: configures mirrors
main.go - Runtime setup → Cleanup probes: runs cleanup
main.go - Registry API → Containerd store: reads content
pkg/registry/registry.go - Registry API → Libp2p router: finds peers
pkg/registry/registry.go - Registry API → Remote OCI client: fetches content
pkg/registry/registry.go - Registry API → OCI protocol: parses requests
pkg/registry/registry.go - Remote OCI client → External registry: fetches OCI data
pkg/oci/client.go - Containerd store → Image metadata: parses image refs
pkg/oci/containerd/containerd.go - Containerd store → Content index: updates index
pkg/oci/containerd/containerd.go - Libp2p router → Routing model: uses routing types
pkg/routing/libp2p/libp2p.go - Web dashboard → Libp2p router: lists peers
pkg/web/web.go - Web dashboard → Containerd store: lists images
pkg/web/web.go - Web dashboard → Registry API: measures pulls
pkg/web/web.go - Prometheus metrics → Registry API: tracks mirror activity
- Store sync → Containerd store: syncs store data
- Preflight checks → Runtime setup: checks startup