1KUBERNETES(1)(kubernetes) KUBERNETES(1)(kubernetes)
2
3
4
5Eric Paris Jan 2015
6
7
9 kubectl scale - Set a new size for a deployment, replica set, or repli‐
10 cation controller
11
12
13
15 kubectl scale [OPTIONS]
16
17
18
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
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
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 --insecure-skip-tls-verify=false If true, the server's certificate
142 will not be checked for validity. This will make your HTTPS connections
143 insecure
144
145
146 --kubeconfig="" Path to the kubeconfig file to use for CLI re‐
147 quests.
148
149
150 --match-server-version=false Require server version to match
151 client version
152
153
154 -n, --namespace="" If present, the namespace scope for this CLI
155 request
156
157
158 --password="" Password for basic authentication to the API server
159
160
161 --profile="none" Name of profile to capture. One of
162 (none|cpu|heap|goroutine|threadcreate|block|mutex)
163
164
165 --profile-output="profile.pprof" Name of the file to write the
166 profile to
167
168
169 --request-timeout="0" The length of time to wait before giving up
170 on a single server request. Non-zero values should contain a corre‐
171 sponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't time‐
172 out requests.
173
174
175 -s, --server="" The address and port of the Kubernetes API server
176
177
178 --tls-server-name="" Server name to use for server certificate
179 validation. If it is not provided, the hostname used to contact the
180 server is used
181
182
183 --token="" Bearer token for authentication to the API server
184
185
186 --user="" The name of the kubeconfig user to use
187
188
189 --username="" Username for basic authentication to the API server
190
191
192 --version=false Print version information and quit
193
194
195 --warnings-as-errors=false Treat warnings received from the server
196 as errors and exit with a non-zero exit code
197
198
199
201 # Scale a replica set named 'foo' to 3
202 kubectl scale --replicas=3 rs/foo
203
204 # Scale a resource identified by type and name specified in "foo.yaml" to 3
205 kubectl scale --replicas=3 -f foo.yaml
206
207 # If the deployment named mysql's current size is 2, scale mysql to 3
208 kubectl scale --current-replicas=2 --replicas=3 deployment/mysql
209
210 # Scale multiple replication controllers
211 kubectl scale --replicas=5 rc/foo rc/bar rc/baz
212
213 # Scale stateful set named 'web' to 3
214 kubectl scale --replicas=3 statefulset/web
215
216
217
218
220 kubectl(1),
221
222
223
225 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
226 com) based on the kubernetes source material, but hopefully they have
227 been automatically generated since!
228
229
230
231Manuals User KUBERNETES(1)(kubernetes)