Day 21: Building Developer Portals with Backstage

Day 21: Building Developer Portals with Backstage

Welcome to Day 21 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:?https://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 https://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.

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

要查看或添加评论,请登录

Alex Parra的更多文章

社区洞察

其他会员也浏览了