-1

I am deploying my application using Kubernetes. I need configuration from config maps and i am providing via config map generator as below:

configMapGenerator:
- name: example
  files:
  - app.properties

But very often the properties from app.properties are not available when i try to view config map as below:

kubectl describe configmaps example

When pods are initially created i believe the properties are available, but not when pods are destroyer and recreated.

Also i have a question on below:

Are config maps injected during application startup or application will reach out to config map when it wants to read the value from config map?

Any suggestions on this are helpful. Thanks in advance.

ging
  • 219
  • 7
  • 20

1 Answers1

1

When pods are initially created i believe the properties are available, but not when pods are destroyer and recreated.

There's not really enough information in your question to address this. As @zer0 notes in their comment, we would need to see your pod manifest and demonstration of the steps that lead you to believe that "the properties from app.properties are not available".

Are config maps injected during application startup or application will reach out to config map when it wants to read the value from config map?

ConfigMaps are injected when your pod starts up. They may be updated dynamically while your application is running.

If you have configured your pod to set environment variables from a ConfigMap, these are injected at container startup and will not be updated for the lifetime of the pod.

If you are mounting a ConfigMap as a volume, the ConfigMap is mounted in your container when it starts up. As long as you are not using a subPath configuration for the mount, the on-disk values will be updated automatically when the ConfigMap is updated.

larsks
  • 277,717
  • 41
  • 399
  • 399