Helm: Cannot overwrite table with non table for tls

8/7/2018

this is most likely really simple but I can't figure it out for 2 hours now. I have the following Consul Ingress that I want to parameterize through a parent chart:

spec:
  rules:
  {{- range .Values.uiIngress.hosts }}
    - host: {{ . }}
      http:
        paths:
          - backend:
              serviceName: {{ $serviceName }}
              servicePort: {{ $servicePort }}
  {{- end -}}
  {{- if .Values.uiIngress.tls }}
  tls:
{{ toYaml .Values.uiIngress.tls | indent 4 }}
  {{- end -}}
{{- end }}

I want to parameterize spec.tls in the above.

In the values.yaml file for Consul we have the following template for it:

uiIngress:
  enabled: false
  annotations: {}
  hosts: []
  tls: {}

The closest I got to parameterizing it is the following:

  uiIngress:
    tls:
    - hosts:
      - "some.domain.com"
    secretName: "ssl-default"

When I do that I get this error though:

warning: cannot overwrite table with non table for tls (map[])

Can someone please help, I tried a million things.

-- Neekoy
kubernetes
kubernetes-helm

1 Answer

8/8/2018

Check your helm version. I think there were some issues in the old version. This one is fine:

$ helm version
Client: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}

I followed exactly the step you mentioned:

  1. Added consul as a subchart (in charts/consul)
  2. In the parent chart created values.yaml with:

    consul:
      uiIngress:
        tls:
        - hosts:
          - "some.domain.com"
        secretName: "ssl-default"
  3. Helm install the parent chart

-- RafaƂ Leszko
Source: StackOverflow