1KUBERNETES(1)(kubernetes)                            KUBERNETES(1)(kubernetes)
2
3
4
5Eric Paris Jan 2015
6
7

NAME

9       kubectl scale - Set a new size for a deployment, replica set, or repli‐
10       cation controller
11
12
13

SYNOPSIS

15       kubectl scale [OPTIONS]
16
17
18

DESCRIPTION

20       Set a new size for a deployment, replica set,  replication  controller,
21       or stateful set.
22
23
24       Scale  also  allows  users to specify one or more preconditions for the
25       scale action.
26
27
28       If --current-replicas or --resource-version is specified, it  is  vali‐
29       dated before the scale is attempted, and it is guaranteed that the pre‐
30       condition holds true when the scale is sent to the server.
31
32
33

OPTIONS

35       --all=false      Select all resources in the namespace of the specified
36       resource types
37
38
39       --allow-missing-template-keys=true       If  true, ignore any errors in
40       templates when a field or map key is missing in the template. Only  ap‐
41       plies to golang and jsonpath output formats.
42
43
44       --current-replicas=-1      Precondition for current size. Requires that
45       the current size of the resource match this value in order to scale. -1
46       (default) for no condition.
47
48
49       --dry-run="none"       Must be "none", "server", or "client". If client
50       strategy, only print the object that would be sent, without sending it.
51       If  server  strategy, submit server-side request without persisting the
52       resource.
53
54
55       -f, --filename=[]      Filename, directory, or URL to files identifying
56       the resource to set a new size
57
58
59       -k,  --kustomize=""      Process the kustomization directory. This flag
60       can't be used together with -f or -R.
61
62
63       -o, --output=""      Output format. One of: (json, yaml, name,  go-tem‐
64       plate, go-template-file, template, templatefile, jsonpath, jsonpath-as-
65       json, jsonpath-file).
66
67
68       --record=false      Record current kubectl command in the resource  an‐
69       notation.  If  set to false, do not record the command. If set to true,
70       record the command. If not set, default to updating the existing  anno‐
71       tation value only if one already exists.
72
73
74       -R, --recursive=false      Process the directory used in -f, --filename
75       recursively. Useful when you want to manage related manifests organized
76       within the same directory.
77
78
79       --replicas=0      The new desired number of replicas. Required.
80
81
82       --resource-version=""       Precondition for resource version. Requires
83       that the current resource version match this value in order to scale.
84
85
86       -l, --selector=""      Selector (label query) to  filter  on,  supports
87       '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects
88       must satisfy all of the specified label constraints.
89
90
91       --show-managed-fields=false      If true, keep the  managedFields  when
92       printing objects in JSON or YAML format.
93
94
95       --template=""      Template string or path to template file to use when
96       -o=go-template, -o=go-template-file. The template format is golang tem‐
97       plates [http://golang.org/pkg/text/template/#pkg-overview].
98
99
100       --timeout=0s       The  length  of  time  to wait before giving up on a
101       scale operation, zero means don't wait. Any other values should contain
102       a corresponding time unit (e.g. 1s, 2m, 3h).
103
104
105

OPTIONS INHERITED FROM PARENT COMMANDS

107       --as=""      Username to impersonate for the operation. User could be a
108       regular user or a service account in a namespace.
109
110
111       --as-group=[]      Group to impersonate for the  operation,  this  flag
112       can be repeated to specify multiple groups.
113
114
115       --as-uid=""      UID to impersonate for the operation.
116
117
118       --azure-container-registry-config=""       Path  to the file containing
119       Azure container registry configuration information.
120
121
122       --cache-dir="/builddir/.kube/cache"      Default cache directory
123
124
125       --certificate-authority=""      Path to a cert file for the certificate
126       authority
127
128
129       --client-certificate=""      Path to a client certificate file for TLS
130
131
132       --client-key=""      Path to a client key file for TLS
133
134
135       --cluster=""      The name of the kubeconfig cluster to use
136
137
138       --context=""      The name of the kubeconfig context to use
139
140
141       --disable-compression=false       If true, opt-out of response compres‐
142       sion for all requests to the server
143
144
145       --insecure-skip-tls-verify=false      If true, the server's certificate
146       will not be checked for validity. This will make your HTTPS connections
147       insecure
148
149
150       --kubeconfig=""      Path to the kubeconfig file to  use  for  CLI  re‐
151       quests.
152
153
154       --match-server-version=false        Require  server  version  to  match
155       client version
156
157
158       -n, --namespace=""      If present, the namespace scope  for  this  CLI
159       request
160
161
162       --password=""      Password for basic authentication to the API server
163
164
165       --profile="none"         Name   of   profile   to   capture.   One   of
166       (none|cpu|heap|goroutine|threadcreate|block|mutex)
167
168
169       --profile-output="profile.pprof"      Name of the  file  to  write  the
170       profile to
171
172
173       --request-timeout="0"       The length of time to wait before giving up
174       on a single server request. Non-zero values  should  contain  a  corre‐
175       sponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't time‐
176       out requests.
177
178
179       -s, --server=""      The address and port of the Kubernetes API server
180
181
182       --tls-server-name=""      Server name to  use  for  server  certificate
183       validation.  If  it  is  not provided, the hostname used to contact the
184       server is used
185
186
187       --token=""      Bearer token for authentication to the API server
188
189
190       --user=""      The name of the kubeconfig user to use
191
192
193       --username=""      Username for basic authentication to the API server
194
195
196       --version=false      Print version information and quit
197
198
199       --warnings-as-errors=false      Treat warnings received from the server
200       as errors and exit with a non-zero exit code
201
202
203

EXAMPLE

205                # Scale a replica set named 'foo' to 3
206                kubectl scale --replicas=3 rs/foo
207
208                # Scale a resource identified by type and name specified in "foo.yaml" to 3
209                kubectl scale --replicas=3 -f foo.yaml
210
211                # If the deployment named mysql's current size is 2, scale mysql to 3
212                kubectl scale --current-replicas=2 --replicas=3 deployment/mysql
213
214                # Scale multiple replication controllers
215                kubectl scale --replicas=5 rc/foo rc/bar rc/baz
216
217                # Scale stateful set named 'web' to 3
218                kubectl scale --replicas=3 statefulset/web
219
220
221
222

SEE ALSO

224       kubectl(1),
225
226
227

HISTORY

229       January  2015,  Originally compiled by Eric Paris (eparis at redhat dot
230       com) based on the kubernetes source material, but hopefully  they  have
231       been automatically generated since!
232
233
234
235Manuals                              User            KUBERNETES(1)(kubernetes)
Impressum