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

NAME

6       kubectl create configmap - Create a configmap from a local file, direc‐
7       tory or literal value
8
9
10

SYNOPSIS

12       kubectl create configmap [OPTIONS]
13
14
15

DESCRIPTION

17       Create a configmap based on a file,  directory,  or  specified  literal
18       value.
19
20
21       A single configmap may package one or more key/value pairs.
22
23
24       When  creating a configmap based on a file, the key will default to the
25       basename of the file, and the value will default to the  file  content.
26       If the basename is an invalid key, you may specify an alternate key.
27
28
29       When  creating  a configmap based on a directory, each file whose base‐
30       name is a valid key in the directory will be  packaged  into  the  con‐
31       figmap.   Any  directory entries except regular files are ignored (e.g.
32       subdirectories, symlinks, devices, pipes, etc).
33
34
35

OPTIONS

37       --allow-missing-template-keys=true
38           If true, ignore any errors in templates when a field or map key  is
39       missing  in  the  template.  Only applies to golang and jsonpath output
40       formats.
41
42
43       --append-hash=false
44           Append a hash of the configmap to its name.
45
46
47       --dry-run=false
48           If true, only print the object that would be sent, without  sending
49       it.
50
51
52       --from-env-file=""
53           Specify the path to a file to read lines of key=val pairs to create
54       a configmap (i.e. a Docker .env file).
55
56
57       --from-file=[]
58           Key file can be specified using its file path, in which  case  file
59       basename  will  be  used as configmap key, or optionally with a key and
60       file path, in which case the given key  will  be  used.   Specifying  a
61       directory  will iterate each named file in the directory whose basename
62       is a valid configmap key.
63
64
65       --from-literal=[]
66           Specify a key and  literal  value  to  insert  in  configmap  (i.e.
67       mykey=somevalue)
68
69
70       --generator="configmap/v1"
71           The name of the API generator to use.
72
73
74       -o, --output=""
75           Output    format.    One   of:   json|yaml|name|go-template|go-tem‐
76       plate-file|template|templatefile|jsonpath|jsonpath-file.
77
78
79       --save-config=false
80           If true, the configuration of current object will be saved  in  its
81       annotation.  Otherwise,  the annotation will be unchanged. This flag is
82       useful when you want to perform kubectl apply on  this  object  in  the
83       future.
84
85
86       --template=""
87           Template  string  or  path  to template file to use when -o=go-tem‐
88       plate, -o=go-template-file. The template format is golang  templates  [
89http://golang.org/pkg/text/template/#pkg-overview⟩].
90
91
92       --validate=true
93           If true, use a schema to validate the input before sending it
94
95
96

OPTIONS INHERITED FROM PARENT COMMANDS

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

EXAMPLE

374                # Create a new configmap named my-config based on folder bar
375                kubectl create configmap my-config --from-file=path/to/bar
376
377                # Create a new configmap named my-config with specified keys instead of file basenames on disk
378                kubectl create configmap my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt
379
380                # Create a new configmap named my-config with key1=config1 and key2=config2
381                kubectl create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2
382
383                # Create a new configmap named my-config from the key=value pairs in the file
384                kubectl create configmap my-config --from-file=path/to/bar
385
386                # Create a new configmap named my-config from an env file
387                kubectl create configmap my-config --from-env-file=path/to/bar.env
388
389
390
391

SEE ALSO

393       kubectl-create(1),
394
395
396

HISTORY

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