Horizontal scaling increases capacity by running more instances of a component and distributing workload across them. In a microservices application, it can target the whole cluster or an overloaded service, avoiding the need to enlarge every component. section 12.3 section 12.3.3
Apply the technique at several levels:
- Scale the cluster by adding more virtual machines while keeping each machine’s size unchanged. Six smaller VMs can provide more computing power than three. section 12.3.2
- Scale an individual microservice by increasing its replica count. This directs more compute, memory, and storage toward the specific bottleneck. section 12.3.3
- Use elastic scaling when demand varies: Kubernetes can grow the cluster near its limits and deallocate unneeded resources during quieter periods. section 12.3.4
- Keep microservice databases separate so independent services remain horizontally scalable; a shared database can become a tightly coupled bottleneck. section 12.3.6
Replicate a gateway service
Set replicas to 3 in the Kubernetes Deployment for the gateway service. Multiple instances improve performance by sharing workload and also provide temporary redundancy when one instance fails or restarts. section 12.3.3
Scale a cluster with Terraform
Change the node pool’s node_count from 1 to 6 while retaining the smaller Standard_B2ms VM size. This illustrates fixed-size horizontal expansion. section 12.3.2
Inspect CPU and memory usage in the Kubernetes dashboard to identify overloaded or poorly performing microservices before scaling them. section 12.3












