I wish to create Persistent Volumes across multiple zones.
There are two lists inside the data object, one for az's and the other for vol id's.
The structure is:
persistentVolume:
az:
- eu-west-2a
- eu-west-2b
- eu-west-2c
storageClassName: postgres
storage: 10Gi
accessModes: ReadWriteOnce
volumeID:
- vol-123
- vol-456
- vol-789
fsType: ext4
The Helm config:
{{- $fullName := include "postgres.fullname" $ -}}
{{- range .Values.persistentVolume }}
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ $fullName }}
labels:
type: {{ $fullName }}
az: {{ .az }}
spec:
storageClassName: {{ .Values.persistentVolume.storageClassName }}
capacity:
storage: {{ .Values.persistentVolume.storage }}
accessModes:
- {{ .Values.persistentVolume.accessModes }}
awsElasticBlockStore:
volumeID: {{ .volumeID }}
fsType: {{ .Values.persistentVolume.fsType }}
{{- end }}
But this error with:
template: postgres/templates/pv.yaml:10:11: executing "postgres/templates/pv.yaml" at <.az>: can't evaluate field az in type interface {}
Any tips or pointers would be much appreciated :-)