Problem with ingress and custom helm chart


I created my own helm chart that I deploy on Rancher 2 using a custom catalog, but I experience some problems (i used wordpress chart as example).

When I try to deploy I see this as result:

Failed to install app ezp-legacy-xxnps. Error: release ezp-legacy-xxnps failed: Ingress.extensions "ezp-legacy-xxnps" is invalid: spec.rules[0].host: Invalid value: "map[]": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. '', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

It is interesting that or whatever i set as domain doesn’t work. It always complains with the error above.

I hope that someone can give me some idea how to solve this problem.

Thanks and regards,


{{- if .Values.ingress.enabled -}}
{{- $fullName := include "ezp-legacy.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: extensions/v1beta1
kind: Ingress
  name: "{{- printf "%s-%s" .name $.Release.Name | trunc 63 | trimSuffix "-" -}}"
  labels: {{ include "" . }} {{ include "ezp-legacy.chart" . }} {{ .Release.Name }} {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- if .Values.ingress.tls }}
  {{- range .Values.ingress.tls }}
    - hosts:
      {{- range .hosts }}
        - {{ . | quote }}
      {{- end }}
      secretName: {{ .secretName }}
  {{- end }}
{{- end }}
  {{- range .Values.ingress.hosts }}
    - host: {{ . | quote }}
          - path: {{ $ingressPath }}
              serviceName: {{ $fullName }}
              servicePort: http
  {{- end }}
{{- end }}


## Configure the ingress resource that allows you to access the
## ezPublish installation. Set up the URL
## ref:
  ## Set to true to enable ingress record generation
  enabled: false
  ## Set this to true in order to add the corresponding annotations for cert-manager
  certManager: false

  ## The list of hostnames to be covered with this ingress record.
  ## Most likely this will be just one host, but in the event more hosts are needed, this is an array
  ## Please make sure to change the name and tlsSecret to your own settings
  - name: domain.tld

    ## Set this to true in order to enable TLS on the ingress record
    ## A side effect of this will be that the backend wordpress service will be connected at port 443
    tls: false

    ## Ingress annotations done as key:value pairs
    ## For a full list of possible ingress annotations, please see
    ## ref:
    ## If tls is set to true, annotation "true" will automatically be set
    ## If certManager is set to true, annotation "true" will automatically be set
      # nginx
      # true


- variable: ingress.enabled
  default: false
  description: "Expose app using Layer 7 Load Balancer - ingress"
  type: boolean
  label: Expose app using Layer 7 Load Balancer
  show_subquestion_if: true
  group: "Services and Load Balancing"
  - variable: ingress.hosts[0].name
    default: "domain.tld"
    description: "Hostname to your ezPublish installation"
    type: hostname
    required: true
    label: Hostname

Hosts is an array of maps but you’re treating it like it were an array of strings when you range over it (both times). So when you try to use the first host as a string, it gets turned into one, “map[…contents…]”, which is an invalid hostname regardless of what the contents are.

Thank you very much for explanation.

I am still new with helm and all the config. I would like to support entering multiple hosts in Rancher fields, how should I change the config in this case?

From what I understand I have it wrong in questions file. I changed
variable: ingress.hosts[0].name
variable: ingress.hosts[0]

And it seems like working, but correct me if I am wrong :slight_smile:

I still need to learn how to define and pass multiple hostnames. Can you give me some advice for this?