-  configMapRef : name : random-generator-config prefix : CONFIG_ Pick up all keys from the ConfigMap  random-generator-config  that can be used as environment variable names. Prefix all suitable ConfigMap keys with  CONFIG_ . With the ConfigMap defined in Example 19-1, this leads to three exposed environment variables:  CONFIG_PAT TERN_NAME ,  CONFIG_EXTRA_OPTIONS , and  CONFIG_SEED . Secrets, as with ConfigMaps, can also be consumed as environment variables, either per entry, or for all entries. To access a Secret instead of a ConfigMap, replace  config MapKeyRef  with  secretKeyRef . When used as a volume, the complete ConfigMap is projected into this volume, with the keys used as filenames. See Example 19-5. A ConfigMap-backed volume will contain as many files as entries, with the map’s keys as filenames and the map’s values as file content. The configuration in Example 19-1 that is mounted as a volume results in two files in the  /config  folder: An  application.properties  with the content defined in the Config‐ Map, and a  PATTERN  file with a single line of content. The mapping of configuration data can be fine-tuned more granularly by adding additional properties to the volume declaration. Rather than mapping all entries as files, you can also individually select every key that should be exposed and the file‐ 154  |  Chapter 19: Configuration Resource apiVersion : v1 kind : Pod metadata : name : random-generator spec : containers : -  image : k8spatterns/random-generator:1.0 name : random-generator volumeMounts : -  name : config-volume mountPath : /config volumes : -  name : config-volume configMap : name : random-generator-config Example 19-5. Mount a ConfigMap as a volume