Skip to content

Commit ad33b0c

Browse files
committed
updates from Shannon feedback
1 parent 748d4a9 commit ad33b0c

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ data:
657657

658658
### Restrictions
659659

660-
- You must create a ConfigMap before referencing it in a Pod specification, or mark the ConfigMap as "optional" (see [Optional ConfigMaps](#optional-configmaps)). If you reference a ConfigMap that doesn't exist, or hasn't been marked as "optional" the Pod won't start. Likewise, references to keys that don't exist in the ConfigMap will prevent the pod from starting.
660+
- You must create the `ConfigMap` object before you reference it in a Pod specification. Alternatively, mark the ConfigMap reference as `optional` in the Pod spec (see [Optional ConfigMaps](#optional-configmaps)). If you reference a ConfigMap that doesn't exist and you don't mark the reference as `optional`, the Pod won't start. Similarly, references to keys that don't exist in the ConfigMap will also prevent the Pod from starting, unless you mark the key references as `optional`.
661661

662662
- If you use `envFrom` to define environment variables from ConfigMaps, keys that are considered invalid will be skipped. The pod will be allowed to start, but the invalid names will be recorded in the event log (`InvalidVariableNames`). The log message lists each skipped key. For example:
663663

@@ -677,15 +677,11 @@ data:
677677

678678
### Optional ConfigMaps
679679

680-
In a Pod, or pod template, you can mark a reference to a ConfigMap as _optional_.
681-
If the ConfigMap is non-existent, the configuration for which it provides data in the Pod (e.g. environment variable, mounted volume) will be empty.
680+
You can mark a reference to a ConfigMap as _optional_ in a Pod specification.
681+
If the ConfigMap doesn't exist, the configuration for which it provides data in the Pod (e.g. environment variable, mounted volume) will be empty.
682682
If the ConfigMap exists, but the referenced key is non-existent the data is also empty.
683683

684-
#### Optional ConfigMap in environment variables
685-
686-
There might be situations where environment variables are not always required.
687-
You can mark an environment variables for a container as optional,
688-
like this:
684+
For example, the following Pod specification marks an environment variable from a ConfigMap as optional:
689685

690686
```yaml
691687
apiVersion: v1
@@ -734,6 +730,7 @@ spec:
734730
name: no-config
735731
optional: true # mark the source ConfigMap as optional
736732
restartPolicy: Never
733+
```
737734

738735
### Mounted ConfigMaps are updated automatically
739736

0 commit comments

Comments
 (0)