Skip to content

Conversation

k4lv15
Copy link
Contributor

@k4lv15 k4lv15 commented Sep 15, 2025

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_address}/{namespace-x} rather {server_address}/{namespace-x}/{release-x}/solr-data (i.e., similar to what shell’s volume would do:

storage.silta/storage-path: {{ .Values.environmentName | default .Release.Name }}/ssh-keys

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 {server_address}/{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, we can't add it by default as patching existing PVC's will fail.
  • 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:

  • See this PR in drupal-project-k8s project

@k4lv15 k4lv15 marked this pull request as ready for review September 16, 2025 07:24
@k4lv15 k4lv15 requested a review from Copilot September 16, 2025 07:24
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 when specific storage classes are used to prevent data conflicts and loss. The change ensures that Solr data volumes are mapped to release-specific paths rather than namespace-level paths when using silta-shared or nfs-shared storage classes.

Key changes:

  • Conditionally add storage path annotation for silta-shared and nfs-shared storage classes
  • Remove duplicate accessModes property from volumeClaimTemplate
  • Add comprehensive unit tests to verify annotation behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
drupal/templates/solr-statefulset.yaml Added conditional annotation and fixed duplicate accessModes property
drupal/tests/solr_test.yaml Added unit tests to verify storage path annotation behavior

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

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