liveBook · Manning

Kubectl scale deployment

As explained in Kubernetes in Action, Second Edition

kubectl scale is a kubectl command that changes the number of replicas maintained by a scalable Kubernetes resource.

kubectl scale deployment changes the number of pod replicas maintained for a Deployment. Scaling out adds replicas for increased demand; scaling in removes replicas to reduce capacity. section 3.4

A Deployment manages pods rather than individual containers. Kubernetes works toward the requested replica count, while Services provide stable access and internal load balancing for the application. section 3.4

Scaling an application

After scaling an application, inspect its Kubernetes resources and pods with kubectl get or kubectl describe. The observed pod count should move toward the requested number; newly created pods may briefly be unready, while scaled-down pods terminate. section 3.4 section 14.2.1

How Kubernetes in Action, Second Edition covers it

How deep it goes
Explains desired replica counts, readiness, and termination, but does not detail deployment-specific command options.
Examples
Demonstrates scaling applications up and down, including ReplicaSet changes from five to six, four, zero, and two pods.
What it assumes
Assumes kubectl and basic Kubernetes resources, while identifying pods as the Deployment’s basic unit.
What you can do after
Operate/configure application capacity by changing desired replicas and verifying resulting pods.
How it connects
Connects Deployments to pods and Services, and relates replica scaling to ReplicaSet management.

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.