How openstack/magnum works
Magnum is an OpenStack service for provisioning and managing container-orchestration clusters as OpenStack resources. Users enter through its WSGI/Pecan API; resource controllers expose cluster and related operations, while the broader service includes conductor handlers, pluggable drivers, certificate management, persistence, and periodic status/health work. The excerpts show service-health and certificate paths in detail, but not the API-to-conductor RPC dispatch or most cluster-operation implementations; those connections are therefore omitted. Several documented-by-product subsystems are represented by their exact source directories where their implementation was not sampled.
Main entry points: driver.py Cluster drivers · magnum_services.py Service controller · app.py WSGI application · cert_manager Certificate backends
Components 29
API and resources
- WSGI application
magnum/api/app.py - REST controllers
magnum/api/controllers - Service controller
magnum/api/controllers/v1/magnum_services.py - Cluster templates
magnum/objects/cluster_template.py
Cluster control
- Conductor handlers
magnum/conductor/handlers - Cluster drivers
magnum/drivers/common/driver.py - Scale manager
magnum/conductor/scale_manager.py - RPC transport
magnum/common/rpc.py - Configuration
magnum/common/config.py - Request context
magnum/common/context.py - Authorization policy
magnum/common/policy.py - Request profiling
magnum/common/profiler.py - Service exceptions
magnum/common/exception.py - Translations
magnum/i18n.py
Certificates and security
- Cluster certificate workflow
magnum/conductor/handlers/common/cert_manager.py - Certificate backends
magnum/common/cert_manager - Certificate interface
magnum/common/cert_manager/cert_manager.py - X.509 operations
magnum/common/x509/operations.py
Persistence and operations
- Resource objects
magnum/objects - Object base
magnum/objects/base.py - Database API
magnum/db/api.py - SQL database
magnum/db/sqlalchemy/api.py - Cluster periodic tasks
magnum/service/periodic.py - Service heartbeat
magnum/servicegroup/magnum_service_periodic.py - Service records
magnum/objects/magnum_service.py - Service health
magnum/api/servicegroup.py
Other components
- OpenStack user
- OpenStack cloud services
- Barbican key manager
Connections 23
- OpenStack user → WSGI application: sends requests
- WSGI application → REST controllers: serves API
- WSGI application → Configuration: sets defaults
magnum/api/app.py - Service controller → Resource objects: lists services
magnum/api/controllers/v1/magnum_services.py - Service controller → Service health: checks liveness
magnum/api/controllers/v1/magnum_services.py - Service controller → Authorization policy: enforces access
magnum/api/controllers/v1/magnum_services.py - Resource objects → Object base: exports object types
magnum/objects/__init__.py - Service records → Database API: reads and writes
magnum/objects/magnum_service.py - Service heartbeat → Service records: reports heartbeat
magnum/servicegroup/magnum_service_periodic.py - Service heartbeat → Cluster periodic tasks: sets task context
magnum/servicegroup/magnum_service_periodic.py - Cluster periodic tasks → Cluster drivers: updates cluster status
magnum/service/periodic.py - Cluster periodic tasks → Conductor handlers: polls cluster monitors
magnum/service/periodic.py - Scale manager → Cluster drivers: selects scale manager
magnum/conductor/scale_manager.py - Scale manager → Resource objects: loads cluster state
magnum/conductor/scale_manager.py - Cluster certificate workflow → Certificate backends: stores certificates
magnum/conductor/handlers/common/cert_manager.py - Certificate backends → Certificate interface: implements interface
magnum/common/cert_manager/barbican_cert_manager.py - Certificate interface → X.509 operations: uses operations
magnum/common/cert_manager/cert_manager.py - Certificate backends → Barbican key manager: stores secrets
magnum/common/cert_manager/barbican_cert_manager.py - Cluster drivers → Cluster templates: uses template model
magnum/drivers/common/driver.py - Conductor handlers → RPC transport: dispatches operations
- RPC transport → Conductor handlers: routes operations
- Cluster drivers → OpenStack cloud services: provisions infrastructure
- Database API → SQL database: persists records