-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support scenario with running Liberty containers with readOnlyRootFilesystem #363
Comments
Yeah would love to see improvements in this space. @leochr would love to see a sample on how you worked around the problem using Init Containers. |
@DasJayYa Here are the details on the workaround. As files can be written to volumes with readOnlyRootFileSystem, the basic idea is to attach an emptyDir volume type (which will be shared among the containers) and add the locations to write to as subpath and then mount them. The init container commands copy the initial set of files the image comes with (i.e. cache, server config)
|
Liberty will write to certain locations while running, so in order to run with readOnlyRootFilesystem, some additional writeable storage is necessary. This can be mounted in the container. The difficulty is where data from the container filesystem is read from a location that is also written to. There are two locations dealt with by the above workaround (i.e. /opt/ol/wlp/output and /opt/ol/wlp/usr/servers/defaultServer/configDropins) For configDropins
One possible way around this would be to add an additional 'include' location into the server.xml. The container startup scripts could write into this additional include location, which would need to be mounted storage. However, this wouldn't allow us to use config overrides at runtime. The alternative would be to use a formalized version of the above workaround. |
For /opt/ol/wlp/output I can't currently see an easy solution to making this readonly |
As mentioned in #457 /tmp also needs to be writeable.
|
@leochr any idea when we might see this item delivered? We have a solid use case in a sovereign/federal use case that we need this for. |
@jtmulvey We have done some preliminary investigation and are assessing the feasibility of this support. Sorry, we don’t have an ETA at this time. Liberty writes many files at runtime which makes this challenging. We’ll update the issue as we have more updates |
When Liberty containers are run with
readOnlyRootFilesystem
security context set to true, it encounters permission issues due to files being generated at runtime. In particular at these locations:/opt/ol/wlp/output
/opt/ol/wlp/usr/servers/defaultServer/configDropins
It's possible to use init containers and volume mounts to get around this. But investigate whether anything can be done at container image level to improve this scenario.
The text was updated successfully, but these errors were encountered: