2

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.

2 Answers 2

4

If your default configuration values for this chart that are defined in the values.yaml file for Consul has this structure:

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

And when you are executing helm command you are sending values like this:

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

The error warning: cannot overwrite table with non table for tls (map[]) is happening because of the fact that tls is defined as a dict {} in the values.yaml and you are trying to set value with the type list [](- hosts:) to it. To fix the warning you can change provided values.yaml format to:

uiIngress:
  enabled: false
  annotations: {}
  tls:
  - hosts: []
2
  • tls: should not have an empty array on it, if it is a dict. uiIngress.tls.hosts is an array... uiIngress.tls is a dict. uiIngress.tls.secretName otherwise cannot be set yesterday
  • 1
    In the question uiIngress.tls is expected to be an array. secretName is the key of uiIngress dict. yesterday
1

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

1
  • Ah, it's a live production cluster so upgrading it will be a bit tricky but since it's working on 2.9.1 we'll look into that. Thank you :)
    – Neekoy
    Aug 8, 2018 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.