The recommended way to provision production-ready MongoDB infrastructure with a single click
A Golden Path is an opinionated, well-architected solution that represents the best practice for a common use case. Instead of making developers choose between dozens of options and potentially making mistakes, the Golden Path provides a pre-validated, production-ready solution.
With one simple request, this template automatically provisions:
graph TB
subgraph "What You Get"
MongoDB["ποΈ MongoDB Database<br/>Document Store"]
Cluster["βΈοΈ Kubernetes Cluster<br/>3 nodes, HA"]
DNS["π DNS Record<br/>Stable endpoint"]
Network["π Network Security<br/>Firewall rules"]
end
subgraph "How It's Connected"
MongoDB --> Cluster
DNS --> MongoDB
Network --> Cluster
end
Developer["π©βπ» Developer"] -->|"One Template"| MongoDB
style MongoDB fill:#f9f,stroke:#333,stroke-width:4px
style Developer fill:#bbf,stroke:#333,stroke-width:2px
# Step 1: Create a cluster
backstage template:create service-cluster-template
# Step 2: Wait for cluster...
# Step 3: Create DNS
backstage template:create service-dnsrecord-template
# Step 4: Configure DNS to point to cluster...
# Step 5: Create firewall rules
backstage template:create service-firewall-template
# Step 6: Configure network policies...
# Step 7: Finally create MongoDB
backstage template:create service-mongodb-template
# Step 8: Wire everything together...
# Step 9: Hope it all works...Problems:
- π΄ 7+ manual steps
- π΄ Complex dependencies to manage
- π΄ Easy to misconfigure
- π΄ No guarantee components work together
- π΄ Time consuming
# Step 1: Create everything with proper configuration
backstage template:create service-mongodb-golden-path-template
# Done! β¨Benefits:
- π’ 1 step
- π’ Pre-validated configuration
- π’ Guaranteed compatibility
- π’ Production-ready defaults
- π’ 5 minutes to production
System: mongodb-stack
βββ Resource: mongodb (depends on β cluster, dns)
βββ Resource: cluster
βββ Resource: dns (depends on β cluster)
βββ Resource: firewall (protects β cluster)The template uses Crossplane to manage the infrastructure declaratively:
- MongoDB XRD defines the API
- Composition orchestrates the resource creation:
- Creates Kubernetes cluster
- Provisions MongoDB on the cluster
- Sets up DNS records
- Configures security rules
- Single Claim triggers the entire stack
- Backstage instance with this template installed
- Crossplane installed in your cluster
- GitHub account for repository creation
-
In Backstage UI:
- Navigate to "Create Component"
- Select "π MongoDB Golden Path"
- Fill in just 3 fields:
- Stack name
- Storage size
- Team owner
-
Apply Infrastructure:
kubectl apply -f https://github.com/open-service-portal/[your-repo]/example.yaml
-
Get Connection String:
kubectl get mongodb [stack-name] -o jsonpath='{.status.connString}'
This template demonstrates the Stacked Services pattern:
- Kubernetes Cluster
- Network Security
- DNS Management
- Service Discovery
- MongoDB Database
- Connection Management
Each level depends on the one below, creating a stable, scalable stack.
- β You need a production-ready MongoDB quickly
- β You want best-practice configuration
- β You prefer convention over configuration
- β You're building a standard application
β οΈ You have specific infrastructure requirementsβ οΈ You need custom networking setupβ οΈ You're integrating with existing infrastructureβ οΈ You need fine-grained control
- Defined in
template.yaml - Uses scaffolder actions to create resources
- Implements the golden path pattern
- Groups related components
- Shows dependencies with
dependsOn - Creates a system view in the catalog
partOf: Components are part of the systemdependsOn: Shows resource dependenciesownedBy: Indicates team ownership
- Automatically registers all components
- Creates a unified view in Backstage
- Enables discovery and documentation
While this is an opinionated template, you can customize:
- Adjust parameter defaults
- Add more configuration options
- Modify the UI presentation
- Change cluster size/configuration
- Adjust MongoDB settings
- Modify network policies
Based on industry best practices and official documentation:
- Backstage System Model - How to model infrastructure
- Crossplane Compositions - Infrastructure as Code
- Golden Path Pattern - Platform engineering concepts
- Spotify's Golden Paths - Original concept from Spotify
We welcome contributions! Areas for improvement:
- Add more cloud provider options
- Support for different MongoDB configurations
- Integration with monitoring/observability
- Cost optimization options
- Backup and disaster recovery
MIT License - See LICENSE file
- GitHub Issues: Report issues here
- Discussions: Ask questions
- Documentation: Platform Docs
Making infrastructure simple, one golden path at a time