DELAPARRA
Index
Color
NL
Category: Kubernetes

ConfigMap

Explained by Updated

What is ConfigMap?

ConfigMap: Stores non-secret configuration as key/value pairs. Mount it as files or inject it as environment variables — keeps config out of the image. A ConfigMap stores non-secret configuration for applications in Kubernetes as key and value pairs. Pods can read them as environment variables or as files mounted into the container.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about ConfigMap

How is ConfigMap used in practice?

This keeps configuration out of the image. The same image can run in staging and production with different settings, such as log level, feature flags or the URL of another service.

What should you keep in mind with ConfigMap?

Never put passwords, API keys or tokens in a ConfigMap. They are stored and shown in plain text. Use a Secret for those, ideally backed by a proper secret manager. Also note that changing a ConfigMap does not restart pods. Environment variables are only read at start-up, so after a change, restart the deployment to pick up the new values.

What does an example of ConfigMap look like?

apiVersion: v1 kind: ConfigMap metadata: name: app-config data: LOG_LEVEL: "info" feature.flags: "beta=on"

At a glance

CategoryKubernetes
Explained by
Updated

More Kubernetes terms

All terms starting with C

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.