As per the documentation at - https://github.com/spring-cloud-incubator/spring-cloud-kubernetes/#configmap-propertysource, it is possible to make ConfigMaps available during application bootstrapping through adding spring.cloud.kubernetes.config.name
to the bootstrap.yaml/properties
.
Is it possible to consume multiple ConfigMaps in this manner?
I believe it is possible to do this in the pod specification through the use of env-from
- https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/. But it would be great to do this with the current setup that we have.
Maybe the spring.cloud.kubernetes.config.sources
config is also an option here. Here you can specify multiple configmaps.
As you can see in ConfigMapPropertySource.java, only one ConfigMap will be used by this property source.
However, using envFrom
, all entries in a ConfigMap can be provided as environment variables to the container and Spring Boot can also read environment variables, so maybe this will help you.