HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

kubectl scale — Set a new size for a deployment, replica set, replication controller, or stateful set. More informat

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandnewclisizedeploymentkubectl scalesetfor

Problem

How to use the kubectl scale command: Set a new size for a deployment, replica set, replication controller, or stateful set. More information: <https://kubernetes.io/docs/reference/kubectl/generated/kubectl_scale/>.

Solution

kubectl scale — Set a new size for a deployment, replica set, replication controller, or stateful set. More information: <https://kubernetes.io/docs/reference/kubectl/generated/kubectl_scale/>.

Scale a replica set:
kubectl scale --replicas {{replicas_count}} rs/{{replica_name}}


Scale a resource identified by a file:
kubectl scale --replicas {{replicas_count}} {{[-f|--filename]}} {{path/to/file.yml}}


Scale a deployment based on current number of replicas:
kubectl scale --replicas {{replicas_count}} --current-replicas {{current_replicas}} {{[deploy|deployment]}}/{{deployment_name}}

Code Snippets

Scale a replica set

kubectl scale --replicas {{replicas_count}} rs/{{replica_name}}

Scale a resource identified by a file

kubectl scale --replicas {{replicas_count}} {{[-f|--filename]}} {{path/to/file.yml}}

Scale a deployment based on current number of replicas

kubectl scale --replicas {{replicas_count}} --current-replicas {{current_replicas}} {{[deploy|deployment]}}/{{deployment_name}}

Context

tldr-pages: common/kubectl scale

Revisions (0)

No revisions yet.