1KUBERNETES(1) Jan 2015 KUBERNETES(1)
2
3
4
6 kubectl create - Create a resource from a file or from stdin.
7
8
9
11 kubectl create [OPTIONS]
12
13
14
16 Create a resource from a file or from stdin.
17
18
19 JSON and YAML formats are accepted.
20
21
22
24 --allow-missing-template-keys=true
25 If true, ignore any errors in templates when a field or map key is
26 missing in the template. Only applies to golang and jsonpath output
27 formats.
28
29
30 --dry-run=false
31 If true, only print the object that would be sent, without sending
32 it.
33
34
35 --edit=false
36 Edit the API resource before creating
37
38
39 -f, --filename=[]
40 Filename, directory, or URL to files to use to create the resource
41
42
43 -o, --output=""
44 Output format. One of: json|yaml|name|template|go-template|go-tem‐
45 plate-file|templatefile|jsonpath|jsonpath-file.
46
47
48 --raw=""
49 Raw URI to POST to the server. Uses the transport specified by the
50 kubeconfig file.
51
52
53 --record=false
54 Record current kubectl command in the resource annotation. If set
55 to false, do not record the command. If set to true, record the com‐
56 mand. If not set, default to updating the existing annotation value
57 only if one already exists.
58
59
60 -R, --recursive=false
61 Process the directory used in -f, --filename recursively. Useful
62 when you want to manage related manifests organized within the same
63 directory.
64
65
66 --save-config=false
67 If true, the configuration of current object will be saved in its
68 annotation. Otherwise, the annotation will be unchanged. This flag is
69 useful when you want to perform kubectl apply on this object in the
70 future.
71
72
73 -l, --selector=""
74 Selector (label query) to filter on, supports '=', '==', and
75 '!='.(e.g. -l key1=value1,key2=value2)
76
77
78 --template=""
79 Template string or path to template file to use when -o=go-tem‐
80 plate, -o=go-template-file. The template format is golang templates [
81 ⟨http://golang.org/pkg/text/template/#pkg-overview⟩].
82
83
84 --validate=true
85 If true, use a schema to validate the input before sending it
86
87
88 --windows-line-endings=false
89 Only relevant if --edit=true. Defaults to the line ending native to
90 your platform.
91
92
93
95 --allow-verification-with-non-compliant-keys=false
96 Allow a SignatureVerifier to use keys which are technically
97 non-compliant with RFC6962.
98
99
100 --alsologtostderr=false
101 log to standard error as well as files
102
103
104 --application-metrics-count-limit=100
105 Max number of application metrics to store (per container)
106
107
108 --as=""
109 Username to impersonate for the operation
110
111
112 --as-group=[]
113 Group to impersonate for the operation, this flag can be repeated
114 to specify multiple groups.
115
116
117 --azure-container-registry-config=""
118 Path to the file containing Azure container registry configuration
119 information.
120
121
122 --boot-id-file="/proc/sys/kernel/random/boot_id"
123 Comma-separated list of files to check for boot-id. Use the first
124 one that exists.
125
126
127 --cache-dir="/builddir/.kube/http-cache"
128 Default HTTP cache directory
129
130
131 --certificate-authority=""
132 Path to a cert file for the certificate authority
133
134
135 --client-certificate=""
136 Path to a client certificate file for TLS
137
138
139 --client-key=""
140 Path to a client key file for TLS
141
142
143 --cloud-provider-gce-lb-src-cidrs=130.211.0.0/22,209.85.152.0/22,209.85.204.0/22,35.191.0.0/16
144 CIDRs opened in GCE firewall for LB traffic proxy health checks
145
146
147 --cluster=""
148 The name of the kubeconfig cluster to use
149
150
151 --container-hints="/etc/cadvisor/container_hints.json"
152 location of the container hints file
153
154
155 --containerd="unix:///var/run/containerd.sock"
156 containerd endpoint
157
158
159 --context=""
160 The name of the kubeconfig context to use
161
162
163 --default-not-ready-toleration-seconds=300
164 Indicates the tolerationSeconds of the toleration for
165 notReady:NoExecute that is added by default to every pod that does not
166 already have such a toleration.
167
168
169 --default-unreachable-toleration-seconds=300
170 Indicates the tolerationSeconds of the toleration for unreach‐
171 able:NoExecute that is added by default to every pod that does not
172 already have such a toleration.
173
174
175 --docker="unix:///var/run/docker.sock"
176 docker endpoint
177
178
179 --docker-env-metadata-whitelist=""
180 a comma-separated list of environment variable keys that needs to
181 be collected for docker containers
182
183
184 --docker-only=false
185 Only report docker containers in addition to root stats
186
187
188 --docker-root="/var/lib/docker"
189 DEPRECATED: docker root is read from docker info (this is a fall‐
190 back, default: /var/lib/docker)
191
192
193 --docker-tls=false
194 use TLS to connect to docker
195
196
197 --docker-tls-ca="ca.pem"
198 path to trusted CA
199
200
201 --docker-tls-cert="cert.pem"
202 path to client certificate
203
204
205 --docker-tls-key="key.pem"
206 path to private key
207
208
209 --enable-load-reader=false
210 Whether to enable cpu load reader
211
212
213 --event-storage-age-limit="default=0"
214 Max length of time for which to store events (per type). Value is a
215 comma separated list of key values, where the keys are event types
216 (e.g.: creation, oom) or "default" and the value is a duration. Default
217 is applied to all non-specified event types
218
219
220 --event-storage-event-limit="default=0"
221 Max number of events to store (per type). Value is a comma sepa‐
222 rated list of key values, where the keys are event types (e.g.: cre‐
223 ation, oom) or "default" and the value is an integer. Default is
224 applied to all non-specified event types
225
226
227 --global-housekeeping-interval=1m0s
228 Interval between global housekeepings
229
230
231 --google-json-key=""
232 The Google Cloud Platform Service Account JSON Key to use for
233 authentication.
234
235
236 --housekeeping-interval=10s
237 Interval between container housekeepings
238
239
240 --insecure-skip-tls-verify=false
241 If true, the server's certificate will not be checked for validity.
242 This will make your HTTPS connections insecure
243
244
245 --kubeconfig=""
246 Path to the kubeconfig file to use for CLI requests.
247
248
249 --log-backtrace-at=:0
250 when logging hits line file:N, emit a stack trace
251
252
253 --log-cadvisor-usage=false
254 Whether to log the usage of the cAdvisor container
255
256
257 --log-dir=""
258 If non-empty, write log files in this directory
259
260
261 --log-flush-frequency=5s
262 Maximum number of seconds between log flushes
263
264
265 --logtostderr=true
266 log to standard error instead of files
267
268
269 --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
270 Comma-separated list of files to check for machine-id. Use the
271 first one that exists.
272
273
274 --match-server-version=false
275 Require server version to match client version
276
277
278 --mesos-agent="127.0.0.1:5051"
279 Mesos agent address
280
281
282 --mesos-agent-timeout=10s
283 Mesos agent timeout
284
285
286 -n, --namespace=""
287 If present, the namespace scope for this CLI request
288
289
290 --request-timeout="0"
291 The length of time to wait before giving up on a single server
292 request. Non-zero values should contain a corresponding time unit (e.g.
293 1s, 2m, 3h). A value of zero means don't timeout requests.
294
295
296 -s, --server=""
297 The address and port of the Kubernetes API server
298
299
300 --stderrthreshold=2
301 logs at or above this threshold go to stderr
302
303
304 --storage-driver-buffer-duration=1m0s
305 Writes in the storage driver will be buffered for this duration,
306 and committed to the non memory backends as a single transaction
307
308
309 --storage-driver-db="cadvisor"
310 database name
311
312
313 --storage-driver-host="localhost:8086"
314 database host:port
315
316
317 --storage-driver-password="root"
318 database password
319
320
321 --storage-driver-secure=false
322 use secure connection with database
323
324
325 --storage-driver-table="stats"
326 table name
327
328
329 --storage-driver-user="root"
330 database username
331
332
333 --token=""
334 Bearer token for authentication to the API server
335
336
337 --user=""
338 The name of the kubeconfig user to use
339
340
341 -v, --v=0
342 log level for V logs
343
344
345 --version=false
346 Print version information and quit
347
348
349 --vmodule=
350 comma-separated list of pattern=N settings for file-filtered log‐
351 ging
352
353
354
356 # Create a pod using the data in pod.json.
357 kubectl create -f ./pod.json
358
359 # Create a pod based on the JSON passed into stdin.
360 cat pod.json | kubectl create -f -
361
362 # Edit the data in docker-registry.yaml in JSON then create the resource using the edited data.
363 kubectl create -f docker-registry.yaml --edit -o json
364
365
366
367
369 kubectl(1), kubectl-create-clusterrole(1), kubectl-create-cluster‐
370 rolebinding(1), kubectl-create-configmap(1), kubectl-create-deploy‐
371 ment(1), kubectl-create-job(1), kubectl-create-namespace(1),
372 kubectl-create-poddisruptionbudget(1), kubectl-create-priorityclass(1),
373 kubectl-create-quota(1), kubectl-create-role(1), kubectl-cre‐
374 ate-rolebinding(1), kubectl-create-secret(1), kubectl-create-ser‐
375 vice(1), kubectl-create-serviceaccount(1),
376
377
378
380 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
381 com) based on the kubernetes source material, but hopefully they have
382 been automatically generated since!
383
384
385
386Eric Paris kubernetes User Manuals KUBERNETES(1)