我对Kubernetes(Openshift)有一种奇怪的行为。
看起来启动应用程序时未加载配置文件reference.conf
。
与普通Docker一起使用时,相同的图像也可以使用。
当我将属性复制到application.conf
时,它也可以。
问题是我在使用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"