</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=w></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 Ingress-Nginx Controller to ignore your Ingress. If you are only running a single Ingress-Nginx 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-meta md-typeset"><divclass="md-footer-meta__inner md-grid"><divclass=md-copyright> Made with <ahref=https://squidfunk.github.io/mkdocs-material/target=_blankrel=noopener> Material for MkDocs </a></div></div></div></footer></div><divclass=md-dialogdata-md-component=dialog><divclass="md-dialog__inner md-typeset"></div></div><scriptid=__configtype=application/json>{"base":"../..","features":["navigation.tabs","navigation.tabs.sticky","navigation.instant","navigation.sections"],"search":"../../assets/javascripts/workers/search.f886a092.min.js","translations":{"clipboard.copied":"Copied to clipboard","clipboard.copy":"Copy to clipboard","search.result.more.one":"1 more on this page","search.result.more.other":"# more on this page","search.result.none":"No matching documents","search.result.one":"1 matching document","search.result.other":"# matching documents","search.result.placeholder":"Type to start searching","search.result.term.missing":"Missing","select.version":"Select version"}}</script><scriptsrc=../../assets/javascripts/bundle.aecac24b.min.js></script></body></html>