Build a Microservices Platform

By Pulumi Team
Published
Updated

The Challenge

You need a shared platform where multiple teams can deploy and operate microservices independently. Without a consistent platform, each team reinvents service discovery, logging, tracing, and deployment, leading to fragmented tooling and inconsistent operational practices. A well-built platform provides these capabilities as shared infrastructure.

What You'll Build

  • Managed Kubernetes cluster with service mesh
  • Centralized logging and distributed tracing
  • API gateway for external traffic
  • Automatic TLS certificate management
  • GitOps-based service deployment

Neo Try This Prompt in Pulumi Neo

Run this prompt in Neo to deploy your infrastructure, or edit it to customize.

Best For

Use this prompt when multiple teams need to deploy services onto a shared Kubernetes platform with consistent networking, observability, and deployment practices. This is the right pattern when you have graduated beyond single-service deployments and need platform-level infrastructure that supports many services and teams.

Architecture Overview

This architecture creates a Kubernetes-based platform with the shared infrastructure that microservices teams need. A managed cluster provides the compute foundation, a service mesh handles secure service-to-service communication with mutual TLS and traffic management, and an observability stack aggregates logs and traces from all services into a single view. An API gateway routes external traffic to the appropriate services, and a GitOps controller keeps deployed services in sync with their definitions in Git.

The service mesh is the most significant platform component. It injects a proxy sidecar into every pod, intercepting all network traffic. This gives the platform operator control over traffic routing, retry policies, circuit breaking, and mutual TLS without requiring any changes to application code. Teams deploy their services and get encrypted communication, load balancing, and fault tolerance for free.

GitOps changes the deployment model from “push” to “pull.” Instead of CI/CD pipelines pushing deployments to the cluster, a GitOps controller running inside the cluster watches a Git repository for changes and reconciles the cluster state to match. This means the Git repository is the single source of truth for what is deployed, and the cluster self-heals if someone makes a manual change.

Service Mesh

The service mesh provides a uniform networking layer across all services. It handles mutual TLS between pods, traffic splitting for canary deployments, retry and timeout policies, and circuit breaking for resilience. The mesh also generates detailed telemetry about every request, feeding data to the observability stack without requiring services to add instrumentation code.

Observability Stack

Centralized logging collects stdout/stderr from all pods and makes it searchable. Distributed tracing tracks requests as they flow across service boundaries, showing the full request path and latency breakdown. Monitoring dashboards visualize resource utilization, request rates, error rates, and latency percentiles. Together, these tools give operators visibility into the behavior of the entire platform.

API Gateway and GitOps

The API gateway is the single entry point for external traffic. It handles TLS termination, rate limiting, authentication, and request routing to backend services. Automatic certificate management provisions and renews TLS certificates without manual intervention. The GitOps controller ensures that service definitions in Git are continuously applied to the cluster, providing declarative deployments with audit trails.

Common Customizations

  • Add multi-tenancy: Extend the prompt to include Kubernetes namespaces with resource quotas and network policies that isolate teams from each other on the shared cluster.
  • Add canary deployments: Request traffic splitting configuration in the service mesh so new versions receive a small percentage of traffic before a full rollout.
  • Add external secrets management: Ask for integration with a cloud secrets manager so application secrets are injected into pods without being stored in Git.
  • Add cost allocation: Request resource labels and monitoring dashboards that break down cluster costs by team and service.