<p>I have a catch all ingress rule for a domain <code>*.foo.com</code>, and then I have one specific rule for a domain <code>a.foo.com</code>. According to the documentation, the ingress rule for <code>a.foo.com</code> must take priority over the one with a wildcard (because it's a better match than the wildcard). However, this isn't happening. How do I set priorities explicitly? What am I doing wrong?</p>

<p>Here's my generic ingress rule:</p>

<pre><code>$ kubectl describe ing foo
Name:             foo
Namespace:        foo
Address:          x.x.x.x
Default backend:  default-http-backend:80 (x.x.x.x:8080)
TLS:
  foo.com terminates *.foo.com
Rules:
  Host             Path  Backends
  ----             ----  --------
  *.foo.com
                   /   foo:8888 (&lt;none&gt;)
</code></pre>

<p>Here's the domain specific rule:</p>

<pre><code>$ kubectl describe ing foo-a
Name:             foo-a
Namespace:        foo
Address:          x.x.x.x
Default backend:  default-http-backend:80 (x.x.x.x:8080)
TLS:
  foo.com terminates a.foo.com
Rules:
  Host                                Path  Backends
  ----                                ----  --------
  a.foo.com
                                      /hello   foo-a:8080 (&lt;none&gt;)
</code></pre>

judepereira
<p>You will need to configure each of your nginx-ingress controllers to have a different <code>ingress-class</code> name. Then in your ingress definition, you should specify the <code>kubernetes.io/ingress.class: "my-ingress"</code> to point to the ingress controller you want to use for that particular ingress. </p>

<p>Setup details are included in the [nginx-ingress docs].(<a href="https://kubernetes.github.io/ingress-nginx/user-guide/multiple-ingress/" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/user-guide/multiple-ingress/</a>)</p>

<p>Hope this helps!</p>
