<p>Assume I have have two ingresses <strong>ingress-a</strong> and <strong>ingress-b</strong> for the same host but with different paths:</p>

<p><strong>ingress-a</strong>:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
  name: app-a
  namespace: namespace-a
spec:
  rules:
  - host: myhost.com
    http:
      paths:
      - backend:
          serviceName: app-a
          servicePort: 8080
        path: /path-a
  tls:
  - hosts:
    - myhost.com
    secretName: tls-a
</code></pre>

<p><strong>ingress-b</strong>:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
  name: app-b
  namespace: namespace-b
spec:
  rules:
  - host: myhost.com
    http:
      paths:
      - backend:
          serviceName: app-b
          servicePort: 8080
        path: /path-b
  tls:
  - hosts:
    - myhost.com
    secretName: tls-b
</code></pre>

<p>Now I need to update the certificate. Assume I create the new secret in <strong>tls-new</strong> but only update <strong>ingress-a</strong> to point to that. Which of the two ingresses would <em>win</em>?</p>

<p>I guess I should simply overwrite the existing secret but I am trying to understand how the rules for ingresses would work in the above scenario where two different tls secrets are being referenced for the same host.</p>

<p>NGINX and NGINX Plus <a href="https://github.com/nginxinc/kubernetes-ingress" rel="nofollow noreferrer">Ingress controller</a> for Kubernetes has support for mergeable Ingress Types.</p>

<p>A Master is declared using <code>nginx.org/mergeable-ingress-type: master</code>. A Master will process all configurations at the host level, which includes the TLS configuration, and any annotations which will be applied for the complete host. There can only be one ingress resource on a unique host that contains the master value. Paths cannot be part of the ingress resource.</p>

<p>A Minion is declared using <code>nginx.org/mergeable-ingress-type: minion</code>. A Minion will be used to append different locations to an ingress resource with the Master value. TLS configurations are not allowed. Multiple minions can be applied per master as long as they do not have conflicting paths. If a conflicting path is present then the path defined on the oldest minion will be used.</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: cafe-ingress-master
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.org/mergeable-ingress-type: "master"
spec:
  tls:
  - hosts:
    - cafe.example.com
    secretName: cafe-secret
  rules:
  - host: cafe.example.com

---

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: cafe-ingress-coffee-minion
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.org/mergeable-ingress-type: "minion"
spec:
  rules:
  - host: cafe.example.com
    http:
      paths:
      - path: /coffee
        backend:
          serviceName: coffee-svc
          servicePort: 80
</code></pre>

<p><strong>The minion can not have TLS, only the master can have TLS and you change TLS in master.</strong></p>
