How do I scale a Deployment?

To scale a Deployment in Kubernetes, you can use the kubectl scale command. Here’s how to do it:

  1. Scale up or down the Deployment: Use the following command to set the desired number of replicas. For example, to scale the my-deployment Deployment to 5 replicas:

    kubectl scale deployment my-deployment --replicas=5
    
  2. Verify the scaling: After scaling, you can check the status of the Deployment to ensure it has been updated correctly:

    kubectl get deployments
    

This command will show you the current state of your Deployments, including the number of replicas.

0 Comments

no data
Be the first to share your comment!