Playframework:`reference.conf` 未加载到 Kubernetes (Openshift)

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

我在 Kubernetes (Openshift) 上有一个奇怪的行为。

启动应用程序时似乎没有加载配置文件reference.conf

与普通图像一起使用时,同样的图像有效 Docker。

当我将属性复制到 application.conf 时,它也能正常工作。

问题是我在使用 Kubernetes.

挂载文件时犯了一个错误

我的配置如下:

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

这覆盖了整个 configuration 目录,而只是文件。

正确的是:

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

这是我从这里得到的: