</code></pre></div><p>Then use the same value in the IngressClass:</p><divclass=highlight><pre><span></span><code><spanclass=c1># ingress-nginx IngressClass</span>
</code></pre></div><p>And refer to that IngressClass in your Ingress:</p><divclass=highlight><pre><span></span><code><spanclass=nt>apiVersion</span><spanclass=p>:</span><spanclass="l l-Scalar l-Scalar-Plain">networking.k8s.io/v1</span>
</code></pre></div><divclass="admonition important"><pclass=admonition-title>Important</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>--controller-class</code> value (see <code>IsValid</code> method in <code>internal/ingress/annotations/class/main.go</code>), otherwise the class annotation becomes required.</p><p>If <code>--controller-class</code> is set to the default value of <code>k8s.io/ingress-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>--controller-class</code>, to ensure that the controller only satisfied the specific class of Ingresses.</p></div><h2id=using-the-kubernetesioingressclass-annotation-in-deprecation>Using the kubernetes.io/ingress.class annotation (in deprecation)<aclass=headerlinkhref=#using-the-kubernetesioingressclass-annotation-in-deprecationtitle="Permanent link"> ¶</a></h2><p>If you're running multiple ingress controllers where one or more do not support IngressClasses, you must specify the annotation <code>kubernetes.io/ingress.class: "nginx"</code> in all ingresses that you would like ingress-nginx to claim.</p><p>For instance,</p><divclass=highlight><pre><span></span><code><spanclass=nt>metadata</span><spanclass=p>:</span>
</code></pre></div><p>will target the GCE controller, forcing the Ingress-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 Ingress-NGINX controller, forcing the GCE controller to ignore it.</p><p>You can change the value "nginx" to something else by setting the <code>--ingress-class</code> flag:</p><divclass=highlight><pre><span></span><code><spanclass=nt>spec</span><spanclass=p>:</span>
</code></pre></div><p>then setting the corresponding <code>kubernetes.io/ingress.class: "internal-nginx"</code> annotation on your Ingresses.</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></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>