There's appears to be a template bug in the ingester StatefulSet templates that causes a rendering error when storageClass is set and volumeAttributesClassName is defined in the persistence claims configuration.
Error Message
Error: template: loki/charts/loki/templates/ingester/statefulset-ingester-zone-b.yaml:237:17: executing "loki/charts/loki/templates/ingester/statefulset-ingester-zone-b.yaml" at <.volumeAttributesClassName>: can't evaluate field volumeAttributesClassName in type string
Root Cause
In the volumeClaimTemplates section, the volumeAttributesClassName field is nested inside the {{- with .storageClass }} block:
{{- with .storageClass }}
storageClassName: {{ if (eq "-" .) }}""{{ else }}{{ . }}{{ end }}
{{- with .volumeAttributesClassName }}
volumeAttributesClassName: {{ . }}
{{- end }}
{{- end }}
When {{- with .storageClass }} is entered, the context (.) becomes the value of storageClass (e.g., "gp3" string). When the inner {{- with .volumeAttributesClassName }} tries to access .volumeAttributesClassName, it's attempting to access this field on the string "gp3" instead of the parent claim object, causing the error.
Steps to Reproduce
- Configure ingester persistence with a storageClass and volumeAttributesClassName:
ingester:
zoneAwareReplication:
enabled: true
persistence:
enabled: true
claims:
- name: data
accessModes:
- ReadWriteOnce
size: 10Gi
storageClass: gp3
volumeAttributesClassName: null
- Run
helm template or deploy the chart
- Observe the template rendering error
Environment
- Helm Chart Version: 6.49.0
- Loki Version: 3.6.3
- Kubernetes Version: 1.34
I imagine the fix is to just end the {{- with .storageClass }} prior to starting the {{- with .volumeAttributesClassName }} and to also add volumeAttributesClassName to the values.yaml.
There's appears to be a template bug in the ingester StatefulSet templates that causes a rendering error when
storageClassis set andvolumeAttributesClassNameis defined in the persistence claims configuration.Error Message
Root Cause
In the volumeClaimTemplates section, the
volumeAttributesClassNamefield is nested inside the{{- with .storageClass }}block:When
{{- with .storageClass }}is entered, the context (.) becomes the value ofstorageClass(e.g., "gp3" string). When the inner{{- with .volumeAttributesClassName }}tries to access.volumeAttributesClassName, it's attempting to access this field on the string "gp3" instead of the parent claim object, causing the error.Steps to Reproduce
helm templateor deploy the chartEnvironment
I imagine the fix is to just end the
{{- with .storageClass }}prior to starting the{{- with .volumeAttributesClassName }}and to also addvolumeAttributesClassNameto the values.yaml.