© The Author(s), under exclusive license to APress Media, LLC , part of Springer Nature 2021
P. MartinKuberneteshttps://doi.org/10.1007/978-1-4842-6494-2_7

7. Scaling an Application

Philippe Martin1  
(1)
Gif-sur-Yvette, France
 

We have seen in the spec of the ReplicaSet and Deployment a replicas field. This field indicates how many replicas of a Pod should be running.

Manual Scaling

In declarative form, it is possible to edit the spec of the Deployment to change the value of this field:
apiVersion: apps/v1 kind:
Deployment
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  replicas: 4
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - image:  nginx
        name: nginx
In imperative ...

Get Kubernetes: Preparing for the CKA and CKAD Certifications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.