Playframework: `reference.conf` not loaded in Kubernetes (Openshift)

4/15/2019

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
kubernetes
openshift
playframework

1 Answer

4/15/2019

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
Source: StackOverflow