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

问题描述 投票:0回答:1

我对Kubernetes(Openshift)有一种奇怪的行为。

看起来启动应用程序时未加载配置文件reference.conf

与普通Docker一起使用时,相同的图像也可以使用。

当我将属性复制到application.conf时,它也可以。

playframework kubernetes openshift
1个回答
1
投票

问题是我在使用Kubernetes安装文件时犯了一个错误。

我的配置看起来像:

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

这覆盖了整个配置目录,而不仅仅是文件。

正确的是:

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

我从这里得到了:https://stackoverflow.com/a/43404857/2750966

© www.soinside.com 2019 - 2024. All rights reserved.