<p>I have the following in my ingress</p>

<pre><code>spec:
  tls:
    - hosts:
      - domain.com
      - www.domain.com
      secretName: secret-prod
      - stage.domain.com
      - www.stage.domain.com
      secretName: secret-stage
</code></pre>

<p>The format for this I've copied from various examples, but it throws the following error when I try to apply the file in kubectl</p>

<blockquote>
  <p>error: error parsing nginx/ingress.yml: error converting YAML to JSON: yaml: line 13: did not find expected key</p>
</blockquote>

<p>Line 13 is where it says secretName: secret-prod</p>

<p>What's wrong with this format?</p>

Ben Gannaway
<p>You need to separate them like that:</p>

<pre><code>tls:
- secretName: secret-prod
  hosts:
  - domain.com
  - www.domain.com
- secretName: secret-stage
  hosts:
  - stage.domain.com
  - www.stage.domain.com
</code></pre>

<p>See <a href="https://github.com/kubernetes/contrib/blob/master/ingress/controllers/nginx/examples/multi-tls/multi-tls.yaml" rel="nofollow noreferrer">https://github.com/kubernetes/contrib/blob/master/ingress/controllers/nginx/examples/multi-tls/multi-tls.yaml</a> for a complete example.</p>
