<p>I want to set wildcard subdomain for my project, using k8s, nginx ingress controller, helm chart:</p>
<p>In <code>ingress.yaml</code> file:</p>
<pre><code>...
rules:
  - host: {{ .Values.ingress.host }}
...
</code></pre>
<p>In <code>values.yaml</code> file, I change host <code>example.local</code> to <code>*.example.local</code>:</p>
<pre><code>...
ingress:
  enabled: true
  host: &quot;*.example.local&quot;
...
</code></pre>
<p>Then, when I install chart using helm chart:</p>
<pre><code>Error: YAML parse error on example/templates/ingress.yaml: error converting YAML to JSON: yaml: line 15: did not find expected alphabetic or numeric character
</code></pre>
<p>How can I fix it?</p>
<p>Thank for your support.</p>

<p>YAML treats strings starting with asterisk in a special way - that's why the hostname with wildcards like <code>*.example.local</code>  breaks the ingress on <code>helm install</code>.
In order to be recognized as strings, the values in <code>ingress.yaml</code> file should be quoted with  <code>&quot; &quot;</code> characters:</p>
<pre class="lang-yaml prettyprint-override"><code>...
rules:
  - host: &quot;{{ .Values.ingress.host }}&quot;
...
</code></pre>
<p>One more option here - adding <code>| quote</code> :</p>
<pre class="lang-yaml prettyprint-override"><code>...
rules:
  - host: {{ .Values.ingress.host | quote }}
...
</code></pre>
<p>I've reproduced your issue, both these options worked correctly. More information on quoting special characters for YAML is <a href="https://yaml.org/spec/1.2.2/#53-indicator-characters" rel="noreferrer">here</a>.</p>
