To scale a Deployment in Kubernetes, you can use the kubectl scale command. Here’s how to do it:
Scale up or down the Deployment: Use the following command to set the desired number of replicas. For example, to scale the
my-deploymentDeployment to 5 replicas:kubectl scale deployment my-deployment --replicas=5Verify 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.
