Configuring containerized applications using best practices
By now, we know how to effectively deploy (as covered in Chapter 4, Scaling and Deploying Your Application) and expose (as covered in Chapter 5, Services and Ingress – Communicating with the outside world) containerized applications on Kubernetes. This is enough to run non-trivial stateless containerized applications on Kubernetes. However, Kubernetes also provides additional tooling for application configuration and Secrets management.
Since Kubernetes runs containers, you could always configure your application to use environment variables baked into your Dockerfile. But this sidesteps some of the real value of an orchestrator like Kubernetes. We want to be able to change our application container without rebuilding a Docker image. For this purpose, Kubernetes gives us two configuration-focused resources: ConfigMaps and Secrets. Let's first look at ConfigMaps.
Understanding ConfigMaps
When running applications...