Kubernetes ConfigMap is a Kubernetes API object that stores non-sensitive configuration data separately from container images and pod definitions. In practical terms, it lets you change application settings, environment-specific values, or config files without rebuilding your application image.
A ConfigMap gives pods access to configuration values at runtime. You can use it to store values such as:
debug, info, or warnnginx.conf or app-specific YAML filesThis helps teams keep the same container image across dev, staging, and production while changing only the configuration that the app receives in each environment.
A ConfigMap stores data as key-value pairs. Kubernetes then makes that data available to a pod in one of several ways:
APP_ENV=production.For example, a ConfigMap might define a log level and an API endpoint. A Deployment can then reference that ConfigMap and pass those values into every pod it creates.
A typical ConfigMap might look like this:
apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
data:
APP_ENV: production
LOG_LEVEL: info
API_BASE_URL: https://api.example.com
A pod can then read these values as environment variables:
envFrom:
- configMapRef:
name: app-config
With this setup, you can move the same application image between environments and inject different runtime values per cluster or namespace.
Use a ConfigMap for non-sensitive data. Do not store passwords, API keys, private tokens, database credentials, or TLS private keys in a ConfigMap.
Use a Kubernetes Secret for sensitive values. Secrets are also Kubernetes API objects, but they are designed for confidential data and can integrate with stronger access controls, encryption at rest, and external secret management systems.
In production, teams usually manage ConfigMaps as code. They store them in Git, template them with Helm or Kustomize, and apply them through CI/CD or GitOps pipelines. This gives you version history, review workflows, and repeatable deployments.
If you provision Kubernetes workloads with infrastructure-as-code, ConfigMaps may be managed alongside Deployments, Services, and Ingress objects. The same idea applies when using Kubernetes as a control plane for infrastructure, such as in workflows that deploy AWS resources using Crossplane on Kubernetes.
ConfigMaps also matter during cluster maintenance. Before making platform changes, check workloads that depend on mounted config files or environment-based settings. This is especially useful when planning Kubernetes upgrades for startups, where small teams need predictable rollout and rollback behavior.
Suppose your team runs the same Node.js API in three environments. The container image is identical in all three, but each environment needs different settings:
LOG_LEVEL=debug and API_BASE_URL=https://dev-api.example.comLOG_LEVEL=info and API_BASE_URL=https://staging-api.example.comLOG_LEVEL=warn and API_BASE_URL=https://api.example.comInstead of building three different images, you create one image and three ConfigMaps. Each Kubernetes namespace references the correct ConfigMap for that environment.
Use a ConfigMap when you need to separate non-sensitive configuration from application code and container images. It is a good fit for values that change by environment, cluster, namespace, or release.
A ConfigMap is not a replacement for a secrets manager, a full configuration service, or application-level dynamic config. For many Kubernetes workloads, though, it is the simplest built-in way to inject runtime configuration cleanly and repeatably.