Details
-
Enhancement
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
Description
Currently EAP image uses /opt/eap/standalone/configuration/standalone-openshift.xml for both as a template source for launch script, and the runtime configuration.
As an Kubernetes admin, users want to replace the standalone-openshift.xml using ConfigMap (not from the source tree as developers). For example, to enable extra logging.
The following will create configmap from the standalone-openshift.xml with original content, and replace the file:
oc create configmap eap-config --from-file=./standalone-openshift.xml
oc volumes DC_NAME --add --name=eap-config --configmap-name=eap-config --default-mode=0777 --mount-path=/opt/eap/standalone/configuration/standalone-openshift.xml --sub-path=standalone-openshift.xml
This won't work as EAP launch script is going to replace the file /opt/eap/standalone/configuration/standalone-openshift.xml by sed and this file is a mount point thus cannot be replaced.
$ oc logs -p hello-javaee-2-p9bcj sed: cannot rename /opt/eap/standalone/configuration/sedezxomS: Device or resource busy sed: cannot rename /opt/eap/standalone/configuration/sedjGz72R: Device or resource busy sed: cannot rename /opt/eap/standalone/configuration/sedCDOG5Q: Device or resource busy sed: cannot rename /opt/eap/standalone/configuration/sedBrYC5Q: Device or resource busy sed: cannot rename /opt/eap/standalone/configuration/sedwG75aV: Device or resource busy (snip) 07:03:43,188 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:131) [wildfly-controller-2.1.18.Final-redhat-1.jar:2.1.18.Final-redhat-1] at org.jboss.as.server.ServerService.boot(ServerService.java:362) [wildfly-server-2.1.18.Final-redhat-1.jar:2.1.18.Final-redhat-1] at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:301) [wildfly-controller-2.1.18.Final-redhat-1.jar:2.1.18.Final-redhat-1] at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151] Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[131,9] Message: WFLYCTL0133: Missing required attribute(s): default-job-repository
Also getting original standalone-openshift.xml from the image is a little bit hard, because the running container has standalone-openshift.xml already modified by the EAP launch script and the original is gone. You need extra work (like deal with docker image directly) to get the unmodified standalone-openshift.xml from the image.
This is unnecessarily complex and it's much easier and clearer if we use something like standalone-openshift.xml.template and write it to runtime standalone-openshift.xml location.