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

  1. Install Node.js and Yarn:
npm install -g yarn
  1. Create a new Backstage app:
npx @backstage/create-app@latest
cd zero-to-platform-engineer
  1. Start the Backstage server:
yarn dev
  1. Open Backstage in your browser: http://localhost:3000

Step 2: Add Services to the Backstage Catalog

  1. Inside the Backstage UI, navigate to Create Component.
  2. Register an existing service from GitHub using its repository URL.
  3. 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
  1. 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

  1. Install the Kubernetes plugin:
yarn add @backstage/plugin-kubernetes
  1. 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
  1. Restart Backstage:
yarn dev

Activity for Today

  1. Set up Backstage locally and explore its default features.
  2. Register at least one service in the Software Catalog.
  3. 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:

👉 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!

Subscribe to Alex Parra Newsletter

One update per month. No spam.