I am building a new Helm chart (mychart) that I'm trying to install.
A values.yaml
exists and its contents specify the fullnameOverride:
fullnameOverride: "myapp"
I run the following command
helm install --dry-run -f "mychart-stack/values.yaml" mychart-stack1 ./mychart-stack
And it's giving me the error:
template: mychart-stack/templates/persistentvolume.local-storage.range.yml:5:14: executing "mychart-stack/templates/persistentvolume.local-storage.range.yml" at <include "mychart-stack.fullname" .>: error calling include: template: mychart-stack/templates/_helpers.tpl:14:14: executing "mychart-stack.fullname" at <.Values.fullnameOverride>: nil pointer evaluating interface {}.fullnameOverride
The mychart-stack/templates/_helpers.tpl:14:14
is the pregenerated one when you're asking Helm to produce a Chart example.
The error (14:14) is associated at the first line of the following auto generated code:
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
A little more context, as it's throwing an error while checking the persistentvolume.local-storage.range.yml, here are the contents of the file:
{{- range .Values.persistentVolume.localStorage }}
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-{{ include "mychart-stack.fullname" }}-{{ .name }}
spec:
capacity:
storage: 20Gi
# le champ volumeMode requiert l'activation de la "feature gate" Alpha BlockVolume
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: local-storage-{{ include "mychart-stack.fullname" }}--{{ .name }}
local:
path: {{ .Values.persistentVolume.basePath }}/{{ .name }}
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- {{ .Values.hostName }}
{{- end }}
I don't know what's wrong, the code seems to indicate that it's not defined properly. I tried to run it in --debug mode but it doesn't help (same error).