Skip to content

Commit 7580383

Browse files
miteshskjtengqm
andauthored
Reflect the changed behaviour for multiple use of --from-env-file in ConfigMap creation (#32603)
* Fix 32392 - Reflect the changed behaviour for multiple from-env-file in configmap creation. * Update content/en/docs/tasks/configure-pod-container/configure-pod-configmap.md updated suggestions. Co-authored-by: Qiming Teng <[email protected]> Co-authored-by: Qiming Teng <[email protected]>
1 parent 4edd7fa commit 7580383

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

content/en/docs/tasks/configure-pod-container/configure-pod-configmap.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ Use the option `--from-env-file` to create a ConfigMap from an env-file, for exa
218218
219219
# Download the sample files into `configure-pod-container/configmap/` directory
220220
wget https://kubernetes.io/examples/configmap/game-env-file.properties -O configure-pod-container/configmap/game-env-file.properties
221+
wget https://kubernetes.io/examples/configmap/ui-env-file.properties -O configure-pod-container/configmap/ui-env-file.properties
221222

222223
# The env-file `game-env-file.properties` looks like below
223224
cat configure-pod-container/configmap/game-env-file.properties
@@ -255,17 +256,10 @@ data:
255256
lives: "3"
256257
```
257258
258-
{{< caution >}}
259-
When passing `--from-env-file` multiple times to create a ConfigMap from multiple data sources, only the last env-file is used.
260-
{{< /caution >}}
261-
262-
The behavior of passing `--from-env-file` multiple times is demonstrated by:
259+
Starting with Kubernetes v1.23, `kubectl` supports the `--from-env-file` argument to be
260+
specified multiple times to create a ConfigMap from multiple data sources.
263261

264262
```shell
265-
# Download the sample files into `configure-pod-container/configmap/` directory
266-
wget https://kubernetes.io/examples/configmap/ui-env-file.properties -O configure-pod-container/configmap/ui-env-file.properties
267-
268-
# Create the configmap
269263
kubectl create configmap config-multi-env-files \
270264
--from-env-file=configure-pod-container/configmap/game-env-file.properties \
271265
--from-env-file=configure-pod-container/configmap/ui-env-file.properties
@@ -288,8 +282,11 @@ metadata:
288282
resourceVersion: "810136"
289283
uid: 252c4572-eb35-11e7-887b-42010a8002b8
290284
data:
285+
allowed: '"true"'
291286
color: purple
287+
enemies: aliens
292288
how: fairlyNice
289+
lives: "3"
293290
textmode: "true"
294291
```
295292

0 commit comments

Comments
 (0)