Hello, Thanks for response. I tried to mount the emptyDir to /data and this helped a little (at least the problem with logs is gone). I am not sure that I understood the part about /etc directory. This directory is part of Karaf (there is content) but it also needs to be writeable, right? That means I cannot mount emptyDir to /etc. Do you think it will be possible to use a PersistentVolumeClaim and mount it to /etc and let OpenShift mount there a PersistentVolume? BR Martin
-----Original Message----- From: Bernd Eckenfels <[email protected]> Sent: Tuesday, June 25, 2024 1:09 PM To: [email protected]; Martin Zukal <[email protected]> Subject: Re: Apache Karaf in OpenShift Hello, With OpenShift and some other K8s environments you get read only containers, you Would have to mount at least a emptidir under data/ and move the pid file. (However that might not be enough since you probably also want a writeable etc/ but Cant mount a volume without prepopulating it. Maybe changing the policy for write access in the image is easier. It also depends on the uid/permission. Gruss Bernd Martin Zukal via user wrote on 25. June 2024 12:19 (GMT +02:00): > Hi everyone > Does anybody run Apache Karaf on OpenShift? I set up developer sandbox > with Red Hat and tried to run Apache Karaf (version 4.4.4) from the > docker hub registry but it fails to start. I can see the following > error(s) in the log file: > karaf: Ignoring predefined value for KARAF_HOME > mkdir: cannot create directory '/opt/apache-karaf/data/log': > Permission denied > WARN: can't update etc/config.properties with the generated command > shutdown. We advise to manually add the karaf.shutdown.command property. > java.io.FileNotFoundException: /opt/apache-karaf-4.4.4/karaf.pid > (Permission denied) > at java.base/java.io.FileOutputStream.open0(Native Method) > at java.base/java.io.FileOutputStream.open(Unknown Source) > at java.base/java.io.FileOutputStream.<init>(Unknown > Source) > at java.base/java.io.FileOutputStream.<init>(Unknown > Source) > at > > org.apache.karaf.main.InstanceHelper.writePid(InstanceHelper.java:126) > at org.apache.karaf.main.Main.launch(Main.java:278) > at org.apache.karaf.main.Main.main(Main.java:183) > java.lang.RuntimeException: /opt/apache-karaf-4.4.4/data/log/karaf.log > (No such file or directory) > at > > org.apache.karaf.main.util.BootstrapLogManager.getDefaultHandlerInternal(BootstrapLogManager.java:102) > at > > org.apache.karaf.main.util.BootstrapLogManager.getDefaultHandlersInternal(BootstrapLogManager.java:137) > at > > org.apache.karaf.main.util.BootstrapLogManager.getDefaultHandlers(BootstrapLogManager.java:70) > at > > org.apache.karaf.main.util.BootstrapLogManager.configureLogger(BootstrapLogManager.java:75) > at org.apache.karaf.main.Main.launch(Main.java:279) > at org.apache.karaf.main.Main.main(Main.java:183) > Caused by: java.io.FileNotFoundException: > /opt/apache-karaf-4.4.4/data/log/karaf.log (No such file or directory) > at java.base/java.io.FileOutputStream.open0(Native Method) > at java.base/java.io.FileOutputStream.open(Unknown Source) > at java.base/java.io.FileOutputStream.<init>(Unknown > Source) > at > > org.apache.karaf.main.util.BootstrapLogManager$SimpleFileHandler.open(BootstrapLogManager.java:193) > at > > org.apache.karaf.main.util.BootstrapLogManager$SimpleFileHandler.<init>(BootstrapLogManager.java:182) > at > > org.apache.karaf.main.util.BootstrapLogManager.getDefaultHandlerInternal(BootstrapLogManager.java:100) > ... 5 more > Error creating bundle cache. > Unable to update instance pid: Unable to create directory > /opt/apache-karaf-4.4.4/instances > > Is there some documentation about running on OpenShift? I have no > problem to build the image by myself but right now I have no idea what > is wrong or what is missing. > Any help will be highly appreciated! > Best regards > Martin Zukal > Gruß Bernd — https://bernd.eckenfels.net
