1KUBERNETES(1)                      Jan 2015                      KUBERNETES(1)
2
3
4

NAME

6       kubectl create - Create a resource from a file or from stdin.
7
8
9

SYNOPSIS

11       kubectl create [OPTIONS]
12
13
14

DESCRIPTION

16       Create a resource from a file or from stdin.
17
18
19       JSON and YAML formats are accepted.
20
21
22

OPTIONS

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|go-template|go-tem‐
45       plate-file|template|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  [
81http://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

OPTIONS INHERITED FROM PARENT COMMANDS

95       --alsologtostderr=false
96           log to standard error as well as files
97
98
99       --application-metrics-count-limit=100
100           Max number of application metrics to store (per container)
101
102
103       --as=""
104           Username to impersonate for the operation
105
106
107       --as-group=[]
108           Group to impersonate for the operation, this flag can  be  repeated
109       to specify multiple groups.
110
111
112       --azure-container-registry-config=""
113           Path  to the file containing Azure container registry configuration
114       information.
115
116
117       --boot-id-file="/proc/sys/kernel/random/boot_id"
118           Comma-separated list of files to check for boot-id. Use  the  first
119       one that exists.
120
121
122       --cache-dir="/builddir/.kube/http-cache"
123           Default HTTP cache directory
124
125
126       --certificate-authority=""
127           Path to a cert file for the certificate authority
128
129
130       --client-certificate=""
131           Path to a client certificate file for TLS
132
133
134       --client-key=""
135           Path to a client key file for TLS
136
137
138       --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
139           CIDRs opened in GCE firewall for LB traffic proxy  health checks
140
141
142       --cluster=""
143           The name of the kubeconfig cluster to use
144
145
146       --container-hints="/etc/cadvisor/container_hints.json"
147           location of the container hints file
148
149
150       --containerd="unix:///var/run/containerd.sock"
151           containerd endpoint
152
153
154       --context=""
155           The name of the kubeconfig context to use
156
157
158       --default-not-ready-toleration-seconds=300
159           Indicates   the   tolerationSeconds   of   the    toleration    for
160       notReady:NoExecute  that is added by default to every pod that does not
161       already have such a toleration.
162
163
164       --default-unreachable-toleration-seconds=300
165           Indicates the tolerationSeconds  of  the  toleration  for  unreach‐
166       able:NoExecute  that  is  added  by  default to every pod that does not
167       already have such a toleration.
168
169
170       --docker="unix:///var/run/docker.sock"
171           docker endpoint
172
173
174       --docker-env-metadata-whitelist=""
175           a comma-separated list of environment variable keys that  needs  to
176       be collected for docker containers
177
178
179       --docker-only=false
180           Only report docker containers in addition to root stats
181
182
183       --docker-root="/var/lib/docker"
184           DEPRECATED:  docker  root is read from docker info (this is a fall‐
185       back, default: /var/lib/docker)
186
187
188       --docker-tls=false
189           use TLS to connect to docker
190
191
192       --docker-tls-ca="ca.pem"
193           path to trusted CA
194
195
196       --docker-tls-cert="cert.pem"
197           path to client certificate
198
199
200       --docker-tls-key="key.pem"
201           path to private key
202
203
204       --enable-load-reader=false
205           Whether to enable cpu load reader
206
207
208       --event-storage-age-limit="default=0"
209           Max length of time for which to store events (per type). Value is a
210       comma  separated  list  of  key  values, where the keys are event types
211       (e.g.: creation, oom) or "default" and the value is a duration. Default
212       is applied to all non-specified event types
213
214
215       --event-storage-event-limit="default=0"
216           Max  number  of  events to store (per type). Value is a comma sepa‐
217       rated list of key values, where the keys are event  types  (e.g.:  cre‐
218       ation,  oom)  or  "default"  and  the  value  is an integer. Default is
219       applied to all non-specified event types
220
221
222       --global-housekeeping-interval=1m0s
223           Interval between global housekeepings
224
225
226       --housekeeping-interval=10s
227           Interval between container housekeepings
228
229
230       --insecure-skip-tls-verify=false
231           If true, the server's certificate will not be checked for validity.
232       This will make your HTTPS connections insecure
233
234
235       --kubeconfig=""
236           Path to the kubeconfig file to use for CLI requests.
237
238
239       --log-backtrace-at=:0
240           when logging hits line file:N, emit a stack trace
241
242
243       --log-cadvisor-usage=false
244           Whether to log the usage of the cAdvisor container
245
246
247       --log-dir=""
248           If non-empty, write log files in this directory
249
250
251       --log-file=""
252           If non-empty, use this log file
253
254
255       --log-flush-frequency=5s
256           Maximum number of seconds between log flushes
257
258
259       --logtostderr=true
260           log to standard error instead of files
261
262
263       --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
264           Comma-separated  list  of  files  to  check for machine-id. Use the
265       first one that exists.
266
267
268       --match-server-version=false
269           Require server version to match client version
270
271
272       --mesos-agent="127.0.0.1:5051"
273           Mesos agent address
274
275
276       --mesos-agent-timeout=10s
277           Mesos agent timeout
278
279
280       -n, --namespace=""
281           If present, the namespace scope for this CLI request
282
283
284       --password=""
285           Password for basic authentication to the API server
286
287
288       --profile="none"
289           Name of profile to capture. One of (none|cpu|heap|goroutine|thread‐
290       create|block|mutex)
291
292
293       --profile-output="profile.pprof"
294           Name of the file to write the profile to
295
296
297       --request-timeout="0"
298           The  length  of  time  to  wait before giving up on a single server
299       request. Non-zero values should contain a corresponding time unit (e.g.
300       1s, 2m, 3h). A value of zero means don't timeout requests.
301
302
303       -s, --server=""
304           The address and port of the Kubernetes API server
305
306
307       --skip-headers=false
308           If true, avoid header prefixes in the log messages
309
310
311       --stderrthreshold=2
312           logs at or above this threshold go to stderr
313
314
315       --storage-driver-buffer-duration=1m0s
316           Writes  in  the  storage driver will be buffered for this duration,
317       and committed to the non memory backends as a single transaction
318
319
320       --storage-driver-db="cadvisor"
321           database name
322
323
324       --storage-driver-host="localhost:8086"
325           database host:port
326
327
328       --storage-driver-password="root"
329           database password
330
331
332       --storage-driver-secure=false
333           use secure connection with database
334
335
336       --storage-driver-table="stats"
337           table name
338
339
340       --storage-driver-user="root"
341           database username
342
343
344       --token=""
345           Bearer token for authentication to the API server
346
347
348       --user=""
349           The name of the kubeconfig user to use
350
351
352       --username=""
353           Username for basic authentication to the API server
354
355
356       -v, --v=0
357           log level for V logs
358
359
360       --version=false
361           Print version information and quit
362
363
364       --vmodule=
365           comma-separated list of pattern=N settings for  file-filtered  log‐
366       ging
367
368
369

EXAMPLE

371                # Create a pod using the data in pod.json.
372                kubectl create -f ./pod.json
373
374                # Create a pod based on the JSON passed into stdin.
375                cat pod.json | kubectl create -f -
376
377                # Edit the data in docker-registry.yaml in JSON then create the resource using the edited data.
378                kubectl create -f docker-registry.yaml --edit -o json
379
380
381
382

SEE ALSO

384       kubectl(1),    kubectl-create-clusterrole(1),   kubectl-create-cluster‐
385       rolebinding(1),   kubectl-create-configmap(1),   kubectl-create-deploy‐
386       ment(1),       kubectl-create-job(1),      kubectl-create-namespace(1),
387       kubectl-create-poddisruptionbudget(1), kubectl-create-priorityclass(1),
388       kubectl-create-quota(1),      kubectl-create-role(1),      kubectl-cre‐
389       ate-rolebinding(1),    kubectl-create-secret(1),    kubectl-create-ser‐
390       vice(1), kubectl-create-serviceaccount(1),
391
392
393

HISTORY

395       January  2015,  Originally compiled by Eric Paris (eparis at redhat dot
396       com) based on the kubernetes source material, but hopefully  they  have
397       been automatically generated since!
398
399
400
401Eric Paris                  kubernetes User Manuals              KUBERNETES(1)
Impressum