<p>I get an error when I install the helm chart I created.</p>
<p>helm install -f values.yaml --dry-run  testbb ./</p>
<p>I change the indent and make it like yamls. I use &quot;kubectl get -o yaml&quot; many times, but it doesn't work.</p>
<p>Line 50 in yaml file contains volume <strong>name: frontend-http</strong></p>
<p>Does anyone know how to solve this, please?
Here is the entire yaml template file:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include &quot;frontend-nginx.fullname&quot; . }}
  labels:
    {{- include &quot;frontend-nginx.labels&quot; . | nindent 4 }}
spec:
  {{- if not .Values.autoscaling.enabled }}
  replicas: {{ .Values.replicaCount }}
  {{- end }}
  selector:
    matchLabels:
      {{- include &quot;frontend-nginx.selectorLabels&quot; . | nindent 6 }}
  template:
    metadata:
      {{- with .Values.podAnnotations }}
      annotations:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      labels:
        {{- include &quot;frontend-nginx.selectorLabels&quot; . | nindent 8 }}
    spec:
      {{- with .Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      serviceAccountName: {{ include &quot;frontend-nginx.serviceAccountName&quot; . }}
      securityContext:
        {{- toYaml .Values.podSecurityContext | nindent 8 }}
      containers:
      - name: {{ .Chart.Name }}
        securityContext:
          {{- toYaml .Values.securityContext | nindent 12 }}
        image: &quot;{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}&quot;
        imagePullPolicy: {{ .Values.image.pullPolicy }}
        ports:
        - name: http
          containerPort: 80
          protocol: TCP
        volumeMounts:
          - mountPath: /usr/local/nginx/conf/nginx.conf
            name: {{ .Values.nginxconfig.nginxcm }}-volume
            subPath: nginx.conf
          - mountPath: /usr/local/nginx/html/app
            name: data-storage
      volumes: 
      - configMap:
          defaultMode: 420
          name: frontend-http
        name: frontend-http-volume
      {{- if .Values.persistentVolume.enabled }}
      - name: data-storage
        persistentVolumeClaim:
          claimName: {{ .Values.persistentVolume.existingClaim | default (include &quot;frontend-nginx.fullname&quot; .) }}
      {{- else }}
      - name: data-storage
        emptyDir: {}
      {{- end }}            
{{- if .Values.persistentVolume.mountPaths }}
{{ toYaml .Values.persistentVolume.mountPaths | indent 12 }}
{{- end }}            
      {{- with .Values.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with .Values.affinity }}
      affinity:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with .Values.tolerations }}
      tolerations:
        {{- toYaml . | nindent 8 }}
      {{- end }}
</code></pre>

<p>Try swapping &quot;configMap&quot; and &quot;name&quot;:</p>
<pre><code>      volumes: 
      - name: frontend-http-volume
        configMap:
          defaultMode: 420
          name: frontend-http
      {{- if .Values.persistentVolume.enabled }}
      - name: data-storage
        persistentVolumeClaim:
          claimName: {{ .Values.persistentVolume.existingClaim | default (include &quot;frontend-nginx.fullname&quot; .) }}
      {{- else }}
      - name: data-storage
        emptyDir: {}
      {{- end }} 

</code></pre>
