VictoriaMetrics / helm-charts

Helm charts for VictoriaMetrics, VictoriaLogs and ecosystem
https://victoriametrics.github.io/helm-charts/
Apache License 2.0
327 stars 321 forks source link

Custom vmstorage volumeClaimTemplates name not reflected in volumeMounts #1181

Closed srinusanduri closed 1 month ago

srinusanduri commented 1 month ago

I have a use case to configure a custom volumeClaimTemplates name. While I can successfully configure a custom name for volumeClaimTemplates using vmstorage.persistentVolume.name, there's an inconsistency in how this name is applied throughout the rendered manifest.

Using the latest helm chart, I'm able to configure a custom name for volumeClaimTemplates, and the volume name and PVC names are changed as expected in the rendered vmstorage StatefulSet pod manifest. However, the volume name reference in volumeMounts is not updated and still uses the default vmstorage-volume.

For example, in values, if I configure vmstorage.persistentVolume.name: restored-vmstorage-volume, the rendered volumeClaimTemplate section in StatefulSet is correct as follows:

  volumeClaimTemplates:
    - metadata:
        name: restored-vmstorage-volume

Consequently, in the provisioned pod, the volume is configured with the name restored-vmstorage-volume as expected:

  volumes:
  - name: restored-vmstorage-volume
    persistentVolumeClaim:
      claimName: restored-vmstorage-volume-vmstorage-0

However, the volumeMounts section still references the old name:

    volumeMounts:
    - mountPath: /storage
      name: vmstorage-volume

This causes the deployment to fail with a "volume vmstorage-volume not found" error.

The issue could be resolved by updating the volumeMounts section to use the custom name specified in vmstorage.persistentVolume.name, which is restored-vmstorage-volume in this example.

zekker6 commented 1 month ago

Hello @srinusanduri, thank you for the details and a PR!

It has been merged and released as a part of v0.11.22. Could you try upgrading to this version and see if that helps in your case?

sreenisanduri commented 1 month ago

Hi @zekker6 , thank you for releasing the fix. The issue is resolved after upgrading the chart to v0.11.22.