2025-03-14 21:59:59 -06:00
|
|
|
# kubectl scale
|
|
|
|
|
|
|
|
|
|
> Set a new size for a deployment, replica set, replication controller, or stateful set.
|
2025-12-16 10:20:31 -07:00
|
|
|
> More information: <https://kubernetes.io/docs/reference/kubectl/generated/kubectl_scale>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Scale a replica set:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`kubectl scale --replicas {{replicas_count}} rs/{{replica_name}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Scale a resource identified by a file:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`kubectl scale --replicas {{replicas_count}} {{[-f|--filename]}} {{path/to/file.yml}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Scale a deployment based on current number of replicas:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`kubectl scale --replicas {{replicas_count}} --current-replicas {{current_replicas}} {{[deploy|deployment]}}/{{deployment_name}}`
|