在 Openshift 中通过 RHPAM kie pod 使用 External standalone-full.xml

问题描述

我只想在 Openshift 中运行的 RHPAM kie 服务器 pod 中使用自定义的 standalone-full.xml。我已经从文件创建了配置映射,但不确定如何设置它。

我像这样创建了配置映射

oc create configmap my-config --from-file=standalone-full.xml.

修改了rhpam kie server的deploymentconfig

   volumeMounts:
      - name: config-volume
        mountPath: /opt/eap/standalone/configuration
  volumes:
    - name: config-volume
      configMap:
        name: my-config

它启动一个新容器,创建状态容器并失败并显示错误(从 1 降为 0)

我设置的 configmap 是否正确?

解决方法

您可以将 configmap 作为卷挂载在 pod 中。 Here 是一个很好的例子:只需在pod 的规格:

apiVersion: v1
kind: Pod
metadata:
  name: dapi-test-pod
spec:
  containers:
    - name: test-container
      image: k8s.gcr.io/busybox
      command: [ "/bin/sh","-c","ls /etc/config/" ]
      volumeMounts:
      - name: config-volume
        mountPath: /etc/config
  volumes:
    - name: config-volume
      configMap:
        # Provide the name of the ConfigMap containing the files you want
        # to add to the container
        name: special-config
  restartPolicy: Never