0

I have a strange behaviour on Kubernetes (Openshift).

It looks like the configuration file reference.conf is not loaded when starting the Application.

The same image works when used with plain Docker.

When I copy the properties to application.conf it works as well.

pme
  • 14,156
  • 3
  • 52
  • 95

1 Answers1

1

The problem was that I made a mistake in mounting a file with Kubernetes.

My config looked like:

        volumeMounts:
        - name: ${COMPONENT_NAME}-config-volume
          mountPath: /${COMPONENT_NAME}/conf

This overwrote the whole configuration directory, instead just the files.

The correct one is:

        volumeMounts:
        - name: ${COMPONENT_NAME}-config-volume
          mountPath: /${COMPONENT_NAME}/conf/application.conf
          subPath: "application.conf"

This I got from here: https://stackoverflow.com/a/43404857/2750966

pme
  • 14,156
  • 3
  • 52
  • 95