$linuxjunkies
>

ConfigMap

also: ConfigMap object

A Kubernetes object that stores non-sensitive configuration data as key-value pairs, allowing you to decouple configuration from container images.

A ConfigMap is a Kubernetes API object designed to hold configuration data in key-value format. It lets you manage application configuration separately from your container images, making it easy to change settings without rebuilding Docker images.

ConfigMaps store data as either individual key-value pairs or entire files. You can reference them in Pod definitions to inject configuration via environment variables, command-line arguments, or mounted volumes. For example, a ConfigMap might contain database connection strings, feature flags, or application settings.

Example: Create a ConfigMap with kubectl create configmap myapp-config --from-literal=DB_HOST=localhost --from-literal=LOG_LEVEL=debug, then reference it in a Pod to expose those values as environment variables. ConfigMaps are not encrypted—use Secrets for sensitive data like passwords.

Related terms