Skip to content

Conversation

k4lv15
Copy link
Contributor

@k4lv15 k4lv15 commented Sep 15, 2025

NOTE: Changes in silta.yaml are only for testing purposes, ignore those when merging.

Motivation:
Solr allows to override the storageClassName in helm chart values but is missing the storage.silta/storage-path annotation. If storage class is overridden to silta-shared or nfs-shared, this will map Solr's data volume at {server}/{namespace-x} rather {server}/{namespace-x}/{release-x}/solr-data (i.e., similar to what shell’s volume would do: https://github.com/wunderio/charts/blob/e6613fcc83a28b1d5366efecf0446e44875cdbf3/drupal/templates/shell-volume.yaml#L41
Mapping Solr's data volume to project's namespace folder can cause major issues on a project level, i.e.:

  • If there are multiple releases per namespace using Solr, all will use the same storage thus causing potential confusion (if one environment gets indexes flushed, it will cause search to not work on any other env as well)
  • If a Solr-enabled release gets uninstalled, most likely it will delete the entire {namespace-x} folder from the server associated with the overridden storage class due to persistentVolumeReclaimPolicy: Delete set on the PV, causing major data loss.

Changes proposed:

  • Add storage.silta/storage-path annotation to Solr's volumeClaimTemplates if storage class is either silta-shared or nfs-shared
  • Add helm unit tests verifying that the annotation is present if applicable. Remove the duplicate accessModes property from volumeClaimTemplate as unit tests were complaining about it.

How to test:

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds the storage.silta/storage-path annotation to Solr's volumeClaimTemplates to prevent data loss and storage conflicts when using shared storage classes. The annotation ensures Solr data volumes are mapped to release-specific paths rather than namespace-level paths.

  • Adds conditional annotation for silta-shared and nfs-shared storage classes
  • Removes duplicate accessModes property from volumeClaimTemplate
  • Adds comprehensive unit tests to verify annotation behavior

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
silta/silta.yml Testing configuration enabling Solr with nfs-shared storage
charts/drupal/tests/solr_test.yaml Unit tests verifying storage path annotation behavior
charts/drupal/templates/solr-statefulset.yaml Adds conditional storage path annotation and fixes duplicate accessModes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@Rade333 Rade333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition, thanks @k4lv15 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants