Day 22: Building Developer Portals with Backstage
Welcome to Day 16 of the Zero to Platform Engineer in 30 Days challenge! 🚀 Today, we’re focusing on Internal Developer Portals (IDPs) and how to build one using Backstage, an open-source platform that enhances developer experience by centralizing documentation, services, APIs, and deployments.
Why Use a Developer Portal?
A well-structured Internal Developer Platform (IDP):
- Improves Developer Productivity: Provides a self-service interface for deploying and managing applications.
- Enhances Visibility: Organizes services, APIs, and infrastructure in a centralized hub.
- Reduces Cognitive Load: Developers can focus on writing code instead of navigating complex infrastructure.
🎯 Key Features of Backstage:
- Software Catalog: Track and manage services, APIs, and resources.
- Plugins: Extend functionality with Kubernetes, CI/CD integrations, and observability tools.
- API Documentation: Centralize API management with OpenAPI and GraphQL integrations.
What Is Backstage?
Backstage, originally developed by Spotify, is an open-source developer portal that helps engineering teams:
- Discover and manage services through a software catalog.
- Access self-service infrastructure and deployment tools.
- Standardize documentation and workflows.
Hands-On: Setting Up Backstage
Step 1: Install Backstage Locally
- Install Node.js and Yarn:
npm install -g yarn
- Create a new Backstage app:
npx @backstage/create-app@latest
cd zero-to-platform-engineer
- Start the Backstage server:
yarn dev
- Open Backstage in your browser: http://localhost:3000
Step 2: Add Services to the Backstage Catalog
- Inside the Backstage UI, navigate to Create Component.
- Register an existing service from GitHub using its repository URL.
- Define metadata in
catalog-info.yaml
:
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: zero-to-platform-service
annotations:
github.com/project-slug: parraletz/zero-to-platform-engineer
spec:
type: service
owner: engineering
lifecycle: production
- Apply the configuration:
curl -X POST http://localhost:7000/api/catalog/entities -H "Content-Type: application/json" -d @catalog-info.yaml
Step 3: Integrate Kubernetes with Backstage
- Install the Kubernetes plugin:
yarn add @backstage/plugin-kubernetes
- Configure Backstage to connect with your Kubernetes cluster by adding:
kubernetes:
serviceLocatorMethod:
type: multiTenant
clusterLocatorMethods:
- type: config
clusters:
- name: my-cluster
url: https://my-kubernetes-api
authProvider: serviceAccount
- Restart Backstage:
yarn dev
Activity for Today
- Set up Backstage locally and explore its default features.
- Register at least one service in the Software Catalog.
- Integrate Kubernetes and view cluster resources inside Backstage.
What’s Next?
Tomorrow, we’ll explore cloud cost optimization strategies for Kubernetes and cloud-native applications.
👉 Check it out here: Zero to Platform Engineer Repository
Feel free to clone the repo, experiment with the code, and even contribute if you’d like! 🚀
Follow the Series!
🎉 Don’t miss a single step in your journey to becoming a Platform Engineer! 🎉
This post is just the beginning. Here’s what we’ve covered so far and what’s coming up next:
-
Day 2: Day 2: Containers and Docker - The Building Blocks of Cloud Native
-
Day 3: Containers and Kubernetes - The Building Blocks of Cloud Native
-
Day 4: Deployments and Scaling in Kubernetes - Let’s Get Practical
-
Day 6: ConfigMaps and Secrets – Managing Configurations in Kubernetes
👉 Bookmark this blog and check back every day for new posts in the series. 📣 Share your progress on social media with the hashtag #ZeroToPlatformEngineer to connect with other readers!