Preface
Building Scalable Kubernetes Infrastructure for Microservices
— with real-world labs using Azure and Terraform
In today’s fast-moving cloud landscape, microservices have become the preferred architecture for building scalable, resilient applications. But designing and deploying the infrastructure to support those services—securely, reliably, and at scale—is still one of the toughest challenges in cloud engineering. That’s what inspired this book.
Over the years, working as a cloud architect on large-scale solutions built on Microsoft Azure, I’ve seen first-hand the critical role that automation plays in building sustainable infrastructure. Infrastructure as Code (IaC) has emerged as a key practice, and among the tools available, Terraform stands out for its power, flexibility, and cloud-agnostic approach.
This book is the companion to my book Building Microservices with Containers. That book builds a small online store as a set of independent services in Docker containers. This book picks up where it ends and runs the same store on Azure.
This book is written for architects, DevOps professionals, developers, and cloud engineers who want a practical, hands-on guide to building infrastructure that can support microservices effectively. Using real-world labs and examples, I’ll walk you through how to use Terraform to provision the Azure services the store needs:
- Azure Kubernetes Service (AKS)
- Azure Container Registry (ACR)
- Virtual Networks, with private endpoints and private DNS
- Azure Key Vault
- Azure Database for PostgreSQL Flexible Server
- Azure SQL Database
- Log Analytics, Azure Monitor, Managed Grafana and Application Insights
Inside the cluster, you'll add the pieces that turn AKS into a platform: Gateway API routing, automatic TLS certificates, autoscaling, security policies, and pipelines with GitOps. Optional chapters cover more services that microservices platforms often use: Redis, Storage, Event Hubs and Front Door.
Each lab builds on the previous one, in one Terraform repository, gradually leading you to a complete microservices environment—fully provisioned through code. What makes the result production-grade is not a label but a set of choices you'll make and understand along the way: least-privilege identities, private networking, autoscaling, and observability. The labs build a low-cost dev environment, and a "dev vs prod" table shows what changes for production and why.
While the focus of this book is on Azure and Terraform, the concepts—automation, modularization, repeatability, and security—are broadly applicable across any cloud platform or infrastructure stack.
More than just code, I want this book to help you think like a systems architect. You’ll learn how to design infrastructure that scales, how to automate repeatable processes, how to secure cloud workloads, and how to keep operations simple and maintainable in the long run.
Whether you’re just starting out in the world of cloud-native infrastructure or looking to sharpen your existing skills, I hope this book becomes a valuable companion on your journey.
— Anji Keesari