liveBook · Manning

Horizontal scaling

As explained in Kubernetes in Action, Second Edition

Scaling out is increasing application capacity by running additional application instances.

Horizontal scaling, also called scaling out, increases application capacity by running additional instances. When one instance cannot handle growing user traffic, replicas distribute requests and keep the service available. section 3.3.3

Scale a Deployment to three replicas

Run `kubectl scale deployment kiada --replicas=3`. Kubernetes updates the Deployment's desired replica count, creates the missing Pods, and reconciles the running state until three replicas are available. section 3.3.3

$ kubectl scale deployment kiada --replicas=3
deployment.apps/kiada scaled

Use the command listing to see the concise kubectl operation that changes the Deployment replica count. section 3.3.3

After scaling:

  • The Deployment reports three up-to-date, available replicas. section 3.3.3
  • The replicas are separate Pods rather than three containers in one Pod. section 3.3.3
  • The Service can load-balance requests across the Pods. section 3.3.3

How Kubernetes in Action, Second Edition covers it

How deep it goes
Explains replica changes and desired-state reconciliation, then demonstrates resulting Pods and Service traffic.
Examples
Uses kubectl scale, Deployment status, Pod listings, and repeated curl requests to show distribution.
What it assumes
Assumes a running Deployment exposed by a Service and distinguishes Pods from containers.
What you can do after
Apply it via kubectl by setting a Deployment's desired replica count and checking available Pods.
How it connects
Connects Deployments, replicas, Pods, Services, load balancing, and desired state.

Also explained in

Compare how 13 books explain horizontal scaling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes in Action, Second Edition. The section links point to the parts of the book it draws on.