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

NAME

9       kubectl  create  configmap - Create a config map from a local file, di‐
10       rectory or literal value
11
12
13

SYNOPSIS

15       kubectl create configmap [OPTIONS]
16
17
18

DESCRIPTION

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

OPTIONS

40       --allow-missing-template-keys=true      If true, ignore any  errors  in
41       templates  when a field or map key is missing in the template. Only ap‐
42       plies to golang and jsonpath output formats.
43
44
45       --append-hash=false      Append a hash of the configmap to its name.
46
47
48       --dry-run="none"      Must be "none", "server", or "client". If  client
49       strategy, only print the object that would be sent, without sending it.
50       If server strategy, submit server-side request without  persisting  the
51       resource.
52
53
54       --field-manager="kubectl-create"      Name of the manager used to track
55       field ownership.
56
57
58       --from-env-file=[]      Specify the path to a file  to  read  lines  of
59       key=val pairs to create a configmap.
60
61
62       --from-file=[]       Key  file can be specified using its file path, in
63       which case file basename will be used as configmap key,  or  optionally
64       with  a  key  and  file path, in which case the given key will be used.
65       Specifying a directory will iterate each named file  in  the  directory
66       whose basename is a valid configmap key.
67
68
69       --from-literal=[]       Specify  a  key  and literal value to insert in
70       configmap (i.e. mykey=somevalue)
71
72
73       -o, --output=""      Output format. One of: (json, yaml, name,  go-tem‐
74       plate, go-template-file, template, templatefile, jsonpath, jsonpath-as-
75       json, jsonpath-file).
76
77
78       --save-config=false      If true, the configuration of  current  object
79       will  be saved in its annotation. Otherwise, the annotation will be un‐
80       changed. This flag is useful when you want to perform kubectl apply  on
81       this object in the future.
82
83
84       --show-managed-fields=false       If  true, keep the managedFields when
85       printing objects in JSON or YAML format.
86
87
88       --template=""      Template string or path to template file to use when
89       -o=go-template, -o=go-template-file. The template format is golang tem‐
90       plates [http://golang.org/pkg/text/template/#pkg-overview].
91
92
93       --validate="strict"      Must be one of: strict (or true), warn, ignore
94       (or false).            "true" or "strict" will use a schema to validate
95       the input and fail the request if invalid. It will perform server  side
96       validation  if  ServerSideFieldValidation is enabled on the api-server,
97       but will fall back to less  reliable  client-side  validation  if  not.
98                 "warn"  will  warn  about unknown or duplicate fields without
99       blocking the request if server-side field validation is enabled on  the
100       API  server,  and  behave  as "ignore" otherwise.            "false" or
101       "ignore" will not perform any schema validation, silently dropping  any
102       unknown or duplicate fields.
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       --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

EXAMPLE

201                # Create a new config map named my-config based on folder bar
202                kubectl create configmap my-config --from-file=path/to/bar
203
204                # Create a new config map named my-config with specified keys instead of file basenames on disk
205                kubectl create configmap my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt
206
207                # Create a new config map named my-config with key1=config1 and key2=config2
208                kubectl create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2
209
210                # Create a new config map named my-config from the key=value pairs in the file
211                kubectl create configmap my-config --from-file=path/to/bar
212
213                # Create a new config map named my-config from an env file
214                kubectl create configmap my-config --from-env-file=path/to/foo.env --from-env-file=path/to/bar.env
215
216
217
218

SEE ALSO

220       kubectl-create(1),
221
222
223

HISTORY

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)
Impressum