Scaling a Pod Deployment

Use the kubectl command to scale a deployment in a Kubernetes cluster.

  1. Scale the replicas in a deployment.

    To change the number of instances of the same pod that you're running, you can use the kubectl scale deployment command. For example:

    kubectl scale deployment --replicas=3 hello-world
  2. Check the deployment is scaled.

    You can check that the number of pod instances has been scaled appropriately:

    kubectl get pods

    The output looks similar to:

    NAME                           READY   STATUS    RESTARTS   AGE
    hello-world-5db76fbd7d-99s8h   1/1     Running   0          3m46s
    hello-world-5db76fbd7d-g6lrm   1/1     Running   0          15s
    hello-world-5db76fbd7d-h496h   1/1     Running   0          15s