kubectl-scale
sets a new size for a deployment, replica set, or replication controller
TLDR
Scale deployment replicas
SYNOPSIS
kubectl scale type name --replicas=count [options]
DESCRIPTION
kubectl scale adjusts the replica count for deployments, replica sets, replication controllers, and stateful sets, allowing you to increase or decrease the number of running pod instances on demand. Changes take effect immediately, with the Kubernetes controller manager working to reconcile the actual state to the desired replica count.
The command supports a precondition flag (--current-replicas) that causes the scaling operation to fail if the current number of replicas does not match the expected value, which is useful for preventing race conditions in automated workflows. You can also scale resources defined in manifest files and apply the operation to multiple resources in a single invocation.
PARAMETERS
--replicas count
Target number of replicas.--current-replicas count
Precondition for current replicas.-f, --filename file
Resource file to scale.--timeout duration
Timeout for scaling operation.
SEE ALSO
kubectl(1), kubectl-autoscale(1)
