From the course: Kubernetes Step-by-Step by Pearson

Unlock this course with a free trial

Join today to access over 26,400 courses taught by industry experts.

ConfigMaps

ConfigMaps

“

So let's talk about ConfigMaps. The ConfigMap is used to dynamically provide site-specific information to static applications. That's in fact an example of good programming. In good programming, you want your static code to be separated from the dynamic site-specific information. And you can use ConfigMaps to store environment variables and configuration files as well. That's two completely different uses. If you are using them for environment variables, you can use kubectl set env to apply the ConfigMap to a deployment. If you store configuration files, the approach is different and the ConfigMap should be mounted as a volume. And while using ConfigMaps, the actual values it contains are not included in the application. The application reads the ConfigMap when it is started. That's also kind of cool, because it separates it in a way that makes your application more secure. Let me show you how to use ConfigMaps that contain variables. So I'm going to start by using kubectl create cm…

Contents