Skip to content
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

[BUG] Unable to run OpenSearch Cluster with readOnlyRootFilesystem: true #951

Open
DrissiReda opened this issue Jan 28, 2025 · 2 comments
Open
Labels
bug Something isn't working untriaged Issues that have not yet been triaged

Comments

@DrissiReda
Copy link

What is the bug?

I get multiple errors linked to the read-only file system that I don't see how to circumvent

How can one reproduce the bug?

Deploy any cluster with securityContext.readOnlyRootFilesystem set to true.

What is the expected behavior?

I should be able to mount some paths as a R/W emptyDir where OpenSearch can create its files.

However I cannot, for example it tries to create a opensearch.keystore.tmp file in /usr/share/opensearch/config path, but if I mount an emptyDir to that path, I lose default configuration provided by the opensearch image

The complete relevant log:

Likely root cause: java.nio.file.FileSystemException: /usr/share/opensearch/config/opensearch.keystore.tmp: Read-only file system

What is your host/environment?

Kubernetes v1.29.10 rk2
Opensearch version 2.17.0
Operator version 2.7.0

Do you have any screenshots?

Not needed as the problem is straightforward.

Do you have any additional context?

Unrelated maybe but I was unable to change log4j.properties to print all logs to console. If opensearch doesn't need to write logs to file, it doesn't need R/W access to /usr/share/opensearch/logs.

@DrissiReda DrissiReda added bug Something isn't working untriaged Issues that have not yet been triaged labels Jan 28, 2025
@swoehrl-mw
Copy link
Collaborator

Hi @DrissiReda. Does the exception you report happen in the keystore init container or in the main opensearch container?
I would expect in the init container as there the keystore is modified.
If so, we might need to add an extra emptyDir volume just for the init container. I haven't tested it but I would expect there it should not be a problem to mount the volume to /usr/share/opensearch/config.

@DrissiReda
Copy link
Author

DrissiReda commented Jan 31, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged Issues that have not yet been triaged
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants