Lesson 10: ConfigMap — configuration out of the image
So far we packaged an application into an image — a fixed bundle holding the code and everything it needs. But what happens when that same application must behave a little differently in each environment? In development we might want verbose logs, and in production quieter ones. If we bake those set
A ConfigMap is like the settings menu on a device: you change a setting (language, brightness) without taking the whole device apart and rebuilding it.
- ConfigMap
- A Kubernetes object that stores non-secret settings as key/value pairs and injects them into a container as environment variables or files — so the same image can run with different configuration per environment.
- Environment Variables
- Configuration values stored in a process's runtime environment (for example LOG_LEVEL=info) that the application reads at run time instead of having them written inside the code.
- Image
- A fixed, immutable bundle that contains the application and all its dependencies. Containers are run from an image; changing it requires building a new version.