Skip to content

[Dashboards] Fix readOnlyRootFilesystem by adding emptyDir for data dir#726

Open
faarshad wants to merge 1 commit intoopensearch-project:mainfrom
faarshad:fix/dashboards-readonly-root-filesystem
Open

[Dashboards] Fix readOnlyRootFilesystem by adding emptyDir for data dir#726
faarshad wants to merge 1 commit intoopensearch-project:mainfrom
faarshad:fix/dashboards-readonly-root-filesystem

Conversation

@faarshad
Copy link
Copy Markdown

@faarshad faarshad commented Feb 9, 2026

--

Summary

  • Fixes OpenSearch Dashboards failing to start when securityContext.readOnlyRootFilesystem: true is set
  • Adds a conditional emptyDir volume mounted at /usr/share/opensearch-dashboards/data so the UUID file can be written
  • The volume is only added when readOnlyRootFilesystem is enabled — no change to default behavior

Resolves #368

Changes

  • charts/opensearch-dashboards/templates/deployment.yaml — Added conditional emptyDir volume (dashboards-data) and volumeMount at /usr/share/opensearch-dashboards/data when .Values.securityContext.readOnlyRootFilesystem is true
  • charts/opensearch-dashboards/Chart.yaml — Bumped chart version from 3.4.0 to 3.5.0
  • charts/opensearch-dashboards/CHANGELOG.md — Documented the fix under [Unreleased] > Fixed

Test plan

  • helm lint passes
  • helm template with readOnlyRootFilesystem=true renders the emptyDir volume and mount correctly
  • helm template without readOnlyRootFilesystem does NOT include the extra volume (no regression)
  • Full E2E on kind cluster (k8s v1.27.3): deployed OpenSearch 3.4.0 single-node backend, then OpenSearch Dashboards with readOnlyRootFilesystem=true
    • EROFS error is fixed — no read-only filesystem errors in logs
    • No ConnectionError / getaddrinfo EBUSY errors — Dashboards connects to OpenSearch successfully
    • UUID file written successfully at /usr/share/opensearch-dashboards/data/uuid
    • Pod reaches Ready 1/1 with zero restarts
  • Default deployment (without readOnlyRootFilesystem) — behavior unchanged, no extra volume added

…lume for data directory

When securityContext.readOnlyRootFilesystem is set to true, OpenSearch
Dashboards fails to start because it cannot write the UUID file to
/usr/share/opensearch-dashboards/data/uuid (EROFS error).

This adds a conditional emptyDir volume mounted at
/usr/share/opensearch-dashboards/data when readOnlyRootFilesystem is
enabled, providing a writable directory for the UUID file.

Resolves opensearch-project#368

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Fahad Arshad <26278466+faarshad@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[BUG][OpenSearchDashboards] OpenSearch Dashboards fails to start when readOnlyRootFilesystem set to 'true'

1 participant