Using the service catalog
This tutorial walks you through using Infrahub's Service Catalog web interface to manage data center and colocation center deployments. The Service Catalog provides a user-friendly web application built with Streamlit that simplifies infrastructure provisioning by automating branch creation, data loading, and generator execution.
By the end of this tutorial, you'll understand how to enable the Service Catalog, navigate the interface, view existing infrastructure, and create new data centers through a guided form-based workflow.
What you'll accomplish
In this tutorial, you will:
- Enable the Service Catalog container
- Access the web interface
- Switch between Infrahub branches
- View existing data centers and colocation centers
- Create a new data center using the web form
- Understand the automated workflow behind the scenes
Prerequisites
Before starting this tutorial, ensure you have:
- Completed the installation guide and have Infrahub running
- Completed the user walkthrough tutorial
- Docker and Docker Compose installed and configured
- Access to modify environment variables or Docker Compose configuration
The Service Catalog is an optional component that simplifies infrastructure provisioning. It's particularly useful for teams who want a web-based interface for infrastructure requests.
Step 1: enable the service catalog
The Service Catalog runs as a separate Docker container that can be enabled through environment variables or Docker Compose profiles.
- Environment Variables (Recommended)
- Docker Compose Profiles
- Open your
.envfile (or create it from.env.example) - Set the Service Catalog variable to true:
INFRAHUB_SERVICE_CATALOG=true
- Restart Infrahub to apply the changes:
uv run invoke restart
Start Infrahub with the Service Catalog profile:
docker-compose --profile service-catalog up -d
Verify the container is running
Check that the service-catalog container is running:
docker ps --filter "name=service-catalog"
You should see a container named infrahub-bundle-dc-service-catalog-1 or similar in the output.
Step 2: access the service catalog
Once the container is running, access the Service Catalog web interface:
- Open your web browser
- Navigate to
http://localhost:8501 - The Service Catalog landing page should load
The interface displays:
- Branch selector - Dropdown to switch between Infrahub branches
- Data centers - List of existing TopologyDataCenter objects
- Colocation centers - List of existing TopologyColocationCenter objects
- Create new data center - Button to access the DC creation form
If the page doesn't load, verify the container is running and check the logs with docker logs infrahub-bundle-dc-service-catalog-1.
Step 3: switch branches and view infrastructure
The Service Catalog allows you to view infrastructure across different Infrahub branches.
Switch branches
- Locate the branch selector dropdown at the top of the page
- Click the dropdown to see all available branches
- Select a branch (for example, main, add-dc3, etc.)
- The page will refresh and display infrastructure from the selected branch
View existing infrastructure
After selecting a branch, you'll see two lists:
Data centers
Each data center card displays:
- Data center name (for example, DC-1, DC-2, DC-3)
- Location information
- Link to view in Infrahub UI
Colocation centers
Each colocation center card displays:
- Colocation center name (for example, PAR-1, LON-1)
- Location information
- Link to view in Infrahub UI
The lists automatically update when you switch branches, allowing you to see infrastructure in different states (main, proposed changes, feature branches).
Step 4: create a new data center
The Service Catalog provides a guided form for creating new data centers.
Access the creation form
- Click the Create New Data Center button
- The form page will load with several input fields
Fill in the form
Complete each field in the form:
1. Data center name
- Enter a unique name for your data center (for example, DC-6)
- This will be used in the branch name and as the DC identifier
2. Location
- Select a location from the dropdown
- Options include existing LocationBuilding objects (for example, PAR-1, LON-1)
- The location determines where the data center will be deployed
3. Provider
- Select a provider from the dropdown
- Options include existing ProviderNetworkProvider objects
- The provider supplies connectivity and services
4. Design
- Select a design template from the dropdown
- Options include predefined data center architectures
- Different designs support different vendors and topologies
5. Management subnet
- Select an IP prefix for management interfaces
- Used for out-of-band device management
- Choose an available /24 or appropriate size
6. Underlay subnet
- Select an IP prefix for underlay routing
- Used for spine-leaf physical connectivity
- Typically a /24 or /16 depending on DC size
7. Overlay subnet
- Select an IP prefix for overlay services
- Used for VXLAN and EVPN addressing
- Usually a /16 or larger for tenant networks
Submit the request
- Review all form fields for accuracy
- Click the Submit button
- The Service Catalog will display a progress indicator
Step 5: understand the behind-the-scenes workflow
When you submit the form, the Service Catalog executes an automated workflow that:
1. Creates a branch
The Service Catalog creates a new branch in Infrahub with the naming pattern add-{dc_name}:
Branch name: add-dc6 (if you named your DC "DC-6")
This branch isolates your new infrastructure from the main branch, allowing review before merging.
2. Loads data to the branch
The Service Catalog constructs a DesignTopologyDesign YAML object with your form inputs and loads it to the new branch:
nodes:
- kind: DesignTopologyDesign
data:
name: DC-6
location: PAR-1
provider: provider-1
design_template: dc-design-template-1
mgmt_prefix: 10.0.6.0/24
underlay_prefix: 192.168.6.0/24
overlay_prefix: 172.16.0.0/16
3. Waits for the generator
After loading data, the Service Catalog waits for Infrahub's generator to execute:
- Default wait time: 60 seconds (configurable via
GENERATOR_WAIT_TIME) - The generator (for example,
create_dc) processes the design data - Devices, interfaces, cables, and IP addresses are automatically created
4. Creates a proposed change
Once the generator completes, the Service Catalog creates a Proposed Change in Infrahub:
- Compares the new branch to the main branch
- Shows all differences (new devices, interfaces, configurations)
- Allows review before merging to production
View the results
After the workflow completes:
- Navigate to Proposed Changes in the Infrahub UI (
http://localhost:8000) - Find the proposed change for your DC (for example, "Add DC-6")
- Review the Data tab to see new objects
- Review the Artifacts tab to see generated configurations
- Approve and merge when ready
This workflow demonstrates infrastructure-as-code principles: declarative design data is transformed into imperative implementation through automated generators.
Troubleshooting
Service catalog container not starting
If the container fails to start:
- Check Docker logs:
docker logs infrahub-bundle-dc-service-catalog-1
- Verify environment variables in
.env:
INFRAHUB_SERVICE_CATALOG=true
INFRAHUB_ADDRESS=http://infrahub-server:8000
- Ensure Infrahub server is running and accessible:
docker ps --filter "name=infrahub-server"
Cannot access http://localhost:8501
If the web interface doesn't load:
- Verify port 8501 is not in use by another application
- Check container port mapping:
docker ps --format "table {{.Names}}\t{{.Ports}}" --filter "name=service-catalog"
- Try accessing via container IP directly:
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' infrahub-bundle-dc-service-catalog-1
Branch selector is empty
If no branches appear in the dropdown:
- Verify Infrahub server connection from the container:
docker exec infrahub-bundle-dc-service-catalog-1 curl http://infrahub-server:8000/api/schema
- Check that branches exist in Infrahub:
uv run infrahubctl branch list
- Review Service Catalog logs for API errors:
docker logs infrahub-bundle-dc-service-catalog-1 | grep -i error
Generator timeout errors
If DC creation fails with timeout errors:
- Increase the wait time in
.env:
GENERATOR_WAIT_TIME=120 # Increase to 120 seconds
- Check generator status in Infrahub UI under Task Management
- Verify generator definition is registered in
.infrahub.yml
Form submission fails
If the submit button doesn't work:
- Check browser console for JavaScript errors (F12 → Console)
- Verify all required fields are filled
- Check that selected options (location, provider, design) exist in Infrahub
- Review Service Catalog logs during submission:
docker logs -f infrahub-bundle-dc-service-catalog-1
Advanced usage
Custom default branch
Change the default branch shown in the branch selector:
# In .env
DEFAULT_BRANCH=production
Adjust timeouts
Tune timeouts for your environment:
# In .env
GENERATOR_WAIT_TIME=90 # Generator execution wait
API_TIMEOUT=30 # API request timeout
API_RETRY_COUNT=3 # API retry attempts
Integration with CI/CD
The Service Catalog workflow can be automated via API:
- POST form data to Service Catalog endpoint
- Wait for branch creation
- Run validation checks
- Auto-approve proposed changes if checks pass
This enables self-service infrastructure provisioning with approval gates.
What you've learned
Congratulations! You've explored Infrahub's Service Catalog:
- ✅ Enabled the Service Catalog container
- ✅ Accessed the web interface at http://localhost:8501
- ✅ Switched between branches to view different infrastructure states
- ✅ Viewed existing data centers and colocation centers
- ✅ Created a new data center using the guided form
- ✅ Understood the automated workflow (branch → data → generator → proposed change)
Next steps
Now that you understand the Service Catalog, you can:
- Customize the form - Modify
service_catalog/pages/create_dc.pyto add fields - Add validation - Implement checks before submission
- Extend to other infrastructure types - Create forms for POPs, segments, or services
- Integrate with approval workflows - Connect to ticketing or change management systems
- Build custom dashboards - Add Streamlit pages for monitoring and reporting
For deeper understanding:
- Developer guide - Learn about generators and transforms
- Containerlab deployment - Test generated configurations in virtual labs
- Security management - Manage firewall policies through Infrahub