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

Co-authored-by: Shannon Kularathna <ax3shannonkularathna@gmail.com>
This commit is contained in:
Tom Kivlin 2022-07-26 09:20:11 +01:00 committed by GitHub
parent c3f86b7fc0
commit 748d4a998d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 8 deletions

View File

@ -712,11 +712,8 @@ If you run this pod, and there is a ConfigMap named `a-config` but that ConfigMa
a key named `akey`, the output is also empty. If you do set a value for `akey` in the `a-config`
ConfigMap, this pod prints that value and then terminates.
#### Optional ConfigMap via volume plugin
Volumes and files provided by a ConfigMap can be also be marked as optional.
The ConfigMap or the key specified does not have to exist.
The mount path for such items will always be created.
You can also mark the volumes and files provided by a ConfigMap as optional. Kubernetes always creates the mount paths for the volume, even if the referenced ConfigMap or key doesn't exist. For example, the following
Pod specification marks a volume that references a ConfigMap as optional:
```yaml
apiVersion: v1
@ -737,9 +734,6 @@ spec:
name: no-config
optional: true # mark the source ConfigMap as optional
restartPolicy: Never
```
If you run this pod, and there is no ConfigMap named `no-config`, the mounted volume will be empty.
### Mounted ConfigMaps are updated automatically