Implementing ConfigMaps
ConfigMaps provide an easy way to store and inject application configuration data for containers running on Kubernetes.
Creating a ConfigMap is simple – and they enable two possibilities for actually injecting the application configuration data:
- Injecting as an environment variable
- Injecting as a file
While the first option operates simply using container environment variables in memory, the latter option touches on some facets of volumes – a Kubernetes storage medium that will be covered in the next chapter. We will keep the review short for now and use it as an introduction to volumes, which will be expanded on in the following chapter, Chapter 7, Storage on Kubernetes.
When working with ConfigMaps, it can be easier to create them using an imperative Kubectl
command. There are a few possible ways to create ConfigMaps, which also result in differences in the way data is stored and accessed from the ConfigMap itself. The...