🎯 Interactive deployment scripts for Magma Core components
This repository provides comprehensive deployment tools for Magma Core, an open-source software platform that gives network operators an open, flexible and extendable mobile core network solution.
- Operating System: Ubuntu 18.04+, CentOS 7+, or compatible Linux distribution
- Resources: 8GB+ RAM, 4+ CPU cores, 100GB+ disk space
- Network: Internet connectivity for downloading container images
- Privileges: sudo access for installing dependencies
# Make executable and run
chmod +x deploy_magma.py
./deploy_magma.py# Make executable and run
chmod +x deploy_magma.sh
./deploy_magma.sh# Copy and customize configuration
cp config/magma_config.env.template config/magma_config.env
# Edit config/magma_config.env with your settings
./deploy_magma.py --config config/magma_config.envThe deployment tool supports the following Magma components:
- Function: Central management plane for the Magma network
- Deployment: Kubernetes-based using Helm charts
- Features:
- Network configuration management
- Policy enforcement
- Metrics collection
- Certificate management
- Multi-tenancy support
- Function: LTE access network gateway
- Deployment: Docker Compose on physical/virtual machine
- Features:
- LTE core network functions (MME, SPGW, HSS)
- eNodeB management
- Subscriber session management
- Traffic policy enforcement
- Mobility management
- Function: Federation with external core networks
- Deployment: Docker Compose on physical/virtual machine
- Features:
- S8 interface support
- Diameter protocol handling
- Session proxy functionality
- Multi-network federation
- Health monitoring
- Function: Web-based network management interface
- Deployment: Kubernetes-based using Helm charts
- Features:
- Graphical network topology view
- Performance monitoring dashboards
- Configuration management UI
- Alarm and event management
- User access control
The deployment scripts automatically detect and install missing dependencies:
- Docker & Docker Compose: Container runtime and orchestration
- Kubernetes & kubectl: Container orchestration platform
- Helm: Kubernetes package manager
- Git: Version control system
- OpenSSL: Certificate generation
Both deployment scripts provide interactive configuration collection:
- Component Selection: Choose which components to deploy
- Network Configuration: Set IP addresses, domain names, and network parameters
- Security Settings: Configure TLS certificates and authentication
- Database Configuration: Set up PostgreSQL connection details
- LTE Parameters: Configure MCC, MNC, TAC for mobile networks
- Federation Settings: Set up diameter and federation parameters
The scripts perform comprehensive validation:
- ✅ Prerequisites check
- ✅ Network connectivity validation
- ✅ Resource availability check
- ✅ Configuration validation
- ✅ Service health monitoring
DOMAIN="magma.local" # Primary domain name
EXTERNAL_IP="192.168.1.100" # External IP address
ADMIN_EMAIL="admin@magma.local" # Administrator emailORC8R_NAMESPACE="magma" # Kubernetes namespace
ORC8R_STORAGE_CLASS="standard" # Storage class for persistent volumes
ORC8R_DB_HOST="postgresql" # Database host
ORC8R_DB_PORT="5432" # Database port
ORC8R_DB_USER="magma" # Database username
ORC8R_DB_PASSWORD="magma123" # Database password
ORC8R_DB_NAME="magma" # Database nameAGW_INTERFACE="eth0" # Network interface
AGW_IP="192.168.1.101" # AGW IP address
AGW_MCC="001" # Mobile Country Code
AGW_MNC="01" # Mobile Network Code
AGW_TAC="1" # Tracking Area Code
AGW_S1AP_IP="192.168.1.101" # S1AP interface IP
AGW_S1AP_PORT="36412" # S1AP portFGW_FEDERATION_ID="fgw01" # Federation identifier
FGW_SERVED_NETWORKS="network1,network2" # Served network IDs
FGW_DIAMETER_HOST="fgw.magma.local" # Diameter host
FGW_DIAMETER_REALM="magma.local" # Diameter realm
FGW_DIAMETER_PORT="3868" # Diameter port- Automatic Generation: Self-signed certificates for testing
- Custom Certificates: Support for production certificates
- Certificate Rotation: Automated certificate renewal
- Secure Communication: All inter-component communication is encrypted
- Admin Account: Configurable administrator credentials
- Role-Based Access: Multi-level user permissions
- API Security: Secure REST API with token-based authentication
- Network Isolation: Container network security
- Prometheus: Metrics collection and alerting
- Grafana: Visualization dashboards
- Health Checks: Service health monitoring
- Performance Metrics: Network performance tracking
- Centralized Logging: All components log to central location
- Log Rotation: Automatic log file management
- Debug Mode: Detailed logging for troubleshooting
- Audit Trail: Security and configuration change tracking
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Orchestrator │ │ Access Gateway │ │Federated Gateway│
│ (ORC8R) │ │ (AGW) │ │ (FGW) │
├─────────────────┤ ├─────────────────┤ ├─────────────────┤
│ • Configuration │ │ • MME │ │ • S8 Interface │
│ • Policy Mgmt │ │ • SPGW │ │ • Diameter │
│ • Metrics │ │ • SessionD │ │ • Session Proxy │
│ • Certificates │ │ • MobilityD │ │ • Health │
│ • Multi-tenancy │ │ • EnodeBD │ │ • Federation │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
│ ┌─────────────────────────────────────┐ │
└───────┤ Network Management System (NMS) ├─┘
│ Web Interface │
└─────────────────────────────────────┘
-
Docker Permission Denied
sudo usermod -aG docker $USER # Log out and log back in
-
Kubernetes Connection Issues
kubectl cluster-info # Verify cluster connectivity -
Helm Chart Issues
helm repo update # Update Helm repositories -
Port Conflicts
netstat -tulpn | grep LISTEN # Check for port conflicts
- Python Script:
magma_deploy.log - Bash Script:
magma_deploy_bash.log - Container Logs:
docker logs <container_name> - Kubernetes Logs:
kubectl logs <pod_name> -n <namespace>
# Check deployment status
./deploy_magma.py --status
# Restart services
docker-compose restart
kubectl rollout restart deployment/<deployment_name>
# Clean deployment
./deploy_magma.py --clean- Orchestrator: Kubernetes cluster with 3+ nodes
- Access Gateway: Dedicated physical server
- Federated Gateway: Dedicated physical server
- Load Balancer: For high availability
- Database: PostgreSQL cluster with replication
- Resource Limits: Configure appropriate CPU/memory limits
- Network Optimization: Optimize network interfaces and routing
- Storage: Use SSD storage for database and high-IOPS workloads
- Monitoring: Set up comprehensive monitoring and alerting
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Documentation: Magma Documentation
- Community: Magma Slack
- Issues: GitHub Issues
- Discussions: GitHub Discussions
# Full deployment
./deploy_magma.py
# Orchestrator only
./deploy_magma.py --components orchestrator
# Custom configuration
./deploy_magma.py --config my_config.env
# Skip prerequisites check
./deploy_magma.py --skip-prerequisites
# Dry run (show what would be deployed)
./deploy_magma.py --dry-run
# Clean deployment
./deploy_magma.py --cleanMade with ❤️ for the Magma Community