The same image should run in every environment, so settings live outside it. A ConfigMap holds non-secret settings as key-value pairs. You create one from literals (--from-literal=key=value), from files (--from-file=KEY=PATH, where the whole file becomes one value) or from a manifest.
Containers read a ConfigMap in three ways: one key as an environment variable (valueFrom.configMapKeyRef), every key as variables (envFrom), or every key as a file in a mounted directory (a configMap volume). A Pod that references a missing ConfigMap or key waits in CreateContainerConfigError until the data exists.
Timing trips people up. Environment variables are copied in when the container starts, so changing the ConfigMap later doesn't touch running Pods: restart the Deployment with kubectl rollout restart. Mounted files update in place after a short delay, which suits apps that reload their config.
Literals, a file under a chosen key, and a restart to pick up changes.