</code></pre></div><p>will target the GCE controller, forcing the nginx controller to ignore it, while an annotation like</p><divclass=highlight><pre><span></span><code><spanclass=nt>metadata</span><spanclass=p>:</span>
</code></pre></div><p>will target the nginx controller, forcing the GCE controller to ignore it.</p><p>To reiterate, setting the annotation to any value which does not match a valid ingress class will force the NGINX Ingress controller to ignore your Ingress. If you are only running a single NGINX ingress controller, this can be achieved by setting the annotation to any value except "nginx" or an empty string.</p><p>Do this if you wish to use one of the other Ingress controllers at the same time as the NGINX controller.</p><h2id=multiple-ingress-nginx-controllers>Multiple ingress-nginx controllers<aclass=headerlinkhref=#multiple-ingress-nginx-controllerstitle="Permanent link"> ¶</a></h2><p>This mechanism also provides users the ability to run <em>multiple</em> NGINX ingress controllers (e.g. one which serves public traffic, one which serves "internal" traffic). To do this, the option <code>--ingress-class</code> must be changed to a value unique for the cluster within the definition of the replication controller. Here is a partial example:</p><divclass=highlight><pre><span></span><code><spanclass=nt>spec</span><spanclass=p>:</span>
</code></pre></div><divclass="admonition important"><pclass=admonition-title>Important</p><p>Deploying multiple Ingress controllers, of different types (e.g., <code>ingress-nginx</code>&<code>gce</code>), and not specifying a class annotation will result in both or all controllers fighting to satisfy the Ingress, and all of them racing to update Ingress status field in confusing ways.</p><p>When running multiple ingress-nginx controllers, it will only process an unset class annotation if one of the controllers uses the default <code>--ingress-class</code> value (see <code>IsValid</code> method in <code>internal/ingress/annotations/class/main.go</code>), otherwise the class annotation become required.</p><p>If <code>--ingress-class</code> is set to the default value of <code>nginx</code>, the controller will monitor Ingresses with no class annotation <em>and</em> Ingresses with annotation class set to <code>nginx</code>. Use a non-default value for <code>--ingress-class</code>, to ensure that the controller only satisfied the specific class of Ingresses.</p></div></article></div></div></main><footerclass=md-footer><divclass=md-footer-nav><navclass="md-footer-nav__inner md-grid"aria-label=Footer><ahref=../monitoring/class="md-footer-nav__link md-footer-nav__link--prev"rel=prev><divclass="md-footer-nav__button md-icon"><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg></div><divclass=md-footer-nav__title><divclass=md-ellipsis><spanclass=md-footer-nav__direction> Previous </span> Prometheus and Grafana installation </div></div></a><ahref=../tls/class="md-footer-nav__link md-footer-nav__link--next"rel=next><divclass=md-footer-nav__title><divclass=md-ellipsis><spanclass=md-footer-nav__direction> Next </span> TLS/HTTPS </div></div><divclass="md-footer-nav__button md-icon"><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg></div></a></nav></div><divclass="md-footer-meta md-typeset"><divclass="md-footer-meta__inner md-grid"><divclass=md-footer-copyright> Made with <ahref=https://squidfunk.github.io/mkdocs-material/target=_blankrel=noopener> Material for MkDocs </a></div></div></div></footer></div><scriptsrc=../../assets/javascripts/vendor.93c04032.min.js></script><scriptsrc=../../assets/javascripts/bundle.83e5331e.min.js></script><scriptid=__langtype=application/json>{"clipboard.copy":"Copy to clipboard","clipboard.copied":"Copied to clipboard","search.config.lang":"en","search.config.pipeline":"trimmer, stopWordFilter","search.config.separator":"[\\s\\-]+","search.placeholder":"Search","search.result.placeholder":"Type to start searching","search.result.none":"No matching documents","search.result.one":"1 matching document","search.result.other":"# matching documents","search.result.more.one":"1 more on this page","search.result.more.other":"# more on this page","search.result.term.missing":"Missing"}</script><script>