I have a yaml file shown thus:
volumeClaimTemplates:
apiVersion: v1
type: PersistentVolumeClaim
metadata:
name: {{.Values.features.persistence.name}}
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: {{.Values.features.persistence.size}}
storageClassName: {{.Values.features.persistence.storageClass}}
volumeMode: Filesystem
{{- end}}
I have tried to correct all I can but still not getting any headway. When I try to deploy the file, it gives the error below:
Error: UPGRADE FAILED: error validating "": error validating data: ValidationError(StatefulSet.spec.volumeClaimTemplates): invalid type for io.k8s.api.apps.v1.StatefulSetSpec.volumeClaimTemplates: got "map", expected "array"
make: *** [upgrade] Error 1
Can anyone help, please?
The error is quite obvious from the message you get: volumeClaimTemplates
must contain an array but you supply a map. The simple fix is to add -
here:
volumeClaimTemplates:
- apiVersion: v1
type: PersistentVolumeClaim
# ...
Now the previous content is an item in a sequence.