traefik-helm-chart icon indicating copy to clipboard operation
traefik-helm-chart copied to clipboard

Templates have wrong indentation?

Open david-garcia-garcia opened this issue 1 year ago • 2 comments

Welcome!

  • [X] Yes, I've searched similar issues on GitHub and didn't find any.
  • [X] Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What version of the Traefik's Helm Chart are you using?

28.3.0

What version of Traefik are you using?

2.11.5

What did you do?

Apply the helm chart, using this as values:

additionalVolumes:
  - name: static-config
    configMap:
      name: traefik-config

additionalVolumeMounts:
  - name: static-config
    mountPath: /etc/traefik/traefik.yml
    subPath: traefik-config.yaml

What did you see instead?

* Deployment.apps "traefik" is invalid: spec.template.spec.containers[0].volumeMounts[2].name: Not found: "static-config"

What is your environment & configuration?

Using terraform

Additional Information

No response

david-garcia-garcia avatar Jul 02 '24 13:07 david-garcia-garcia

Should this in the templates:

          {{- if .Values.additionalVolumeMounts }}
            {{- toYaml .Values.additionalVolumeMounts | nindent 10 }}
          {{- end }}

be

          {{- if .Values.additionalVolumeMounts }}
{{- toYaml .Values.additionalVolumeMounts | nindent 10 }}
          {{- end }}

?

david-garcia-garcia avatar Jul 02 '24 13:07 david-garcia-garcia

With those values, it will add the volume:

deployment:
  additionalVolumes:
  - name: static-config
    configMap:
      name: traefik-config

additionalVolumeMounts:
  - name: static-config
    mountPath: /etc/traefik/traefik.yml
    subPath: traefik-config.yaml

mloiseleur avatar Jul 02 '24 15:07 mloiseleur