In this section, we will see how to use these K8s objects in our containerized applications.
Using ConfigMaps
ConfigMaps can be mounted as data volumes or configured as environmental variables using the configMapKeyRef flag. We can use both these approaches in our use case for database connectivity information. However, we will go ahead with mounting ConfigMaps as data volumes approach as those volumes are automatically updated.
ConfigMaps and Secrets are Kubernetes objects used to store non-sensitive and sensitive configuration data, respectively. They decouple configuration data from container images, making it easier to update and manage.