[OpenSearch] Fix readOnlyRootFilesystem by adding emptyDir volumes#727
Open
faarshad wants to merge 1 commit intoopensearch-project:mainfrom
Open
[OpenSearch] Fix readOnlyRootFilesystem by adding emptyDir volumes#727faarshad wants to merge 1 commit intoopensearch-project:mainfrom
faarshad wants to merge 1 commit intoopensearch-project:mainfrom
Conversation
…lumes When securityContext.readOnlyRootFilesystem is set to true, OpenSearch fails to start due to EROFS errors writing to the config directory (opensearch.keystore.tmp), logs directory (performance-analyzer.log), and /tmp (Java temp directories). This adds conditional emptyDir volumes for config, logs, and /tmp when readOnlyRootFilesystem is enabled, along with a config-dir-setup init container that copies the original config files into the writable emptyDir. Also adds an opensearch-data emptyDir when persistence is disabled. Resolves opensearch-project#369 Signed-off-by: Fahad Arshad <26278466+faarshad@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
securityContext.readOnlyRootFilesystem: trueis set/tmp, and data (when persistence is disabled)config-dir-setupinit container that copies the original config directory to a writable emptyDirreadOnlyRootFilesystemis enabled — no change to default behaviorResolves #369
Changes
charts/opensearch/templates/statefulset.yaml:opensearch-config,opensearch-logs,opensearch-tmp, andopensearch-data(when persistence disabled)config-dir-setupinit container to copy original config files to writable emptyDirinitContainerscondition to includereadOnlyRootFilesystemcharts/opensearch/Chart.yaml— Bumped chart version from 3.4.0 to 3.5.0charts/opensearch/CHANGELOG.md— Documented the fix under[Unreleased] > FixedTest plan
helm lintpasseshelm templatewithreadOnlyRootFilesystem=truerenders all emptyDir volumes, mounts, and init containerhelm templatewithoutreadOnlyRootFilesystemproduces no extra volumes (no regression)readOnlyRootFilesystem=trueperformance-analyzer.logwrite failuresFileSystemException/createTempDirectoryerrorsopensearch.keystore.tmpwrite failuresReady 1/1with zero restarts