71 lines
No EOL
63 KiB
HTML
71 lines
No EOL
63 KiB
HTML
<!doctype html><html lang=en class=no-js> <head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link href=https://kubernetes.github.io/ingress-nginx/deploy/ rel=canonical><link href=../kubectl-plugin/ rel=prev><link href=baremetal/ rel=next><link rel=icon href=../assets/images/favicon.png><meta name=generator content="mkdocs-1.5.3, mkdocs-material-9.4.5"><title>Installation Guide - Ingress-Nginx Controller</title><link rel=stylesheet href=../assets/stylesheets/main.6a10b989.min.css><link rel=stylesheet href=../assets/stylesheets/palette.356b1318.min.css><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback"><style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style><link rel=stylesheet href=../extra.css><script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script></head> <body dir=ltr data-md-color-scheme=default data-md-color-primary=teal data-md-color-accent=green> <input class=md-toggle data-md-toggle=drawer type=checkbox id=__drawer autocomplete=off> <input class=md-toggle data-md-toggle=search type=checkbox id=__search autocomplete=off> <label class=md-overlay for=__drawer></label> <div data-md-component=skip> <a href=#installation-guide class=md-skip> Skip to content </a> </div> <div data-md-component=announce> </div> <header class="md-header md-header--shadow md-header--lifted" data-md-component=header> <nav class="md-header__inner md-grid" aria-label=Header> <a href=.. title="Ingress-Nginx Controller" class="md-header__button md-logo" aria-label="Ingress-Nginx Controller" data-md-component=logo> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg> </a> <label class="md-header__button md-icon" for=__drawer> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg> </label> <div class=md-header__title data-md-component=header-title> <div class=md-header__ellipsis> <div class=md-header__topic> <span class=md-ellipsis> Ingress-Nginx Controller </span> </div> <div class=md-header__topic data-md-component=header-topic> <span class=md-ellipsis> Installation Guide </span> </div> </div> </div> <label class="md-header__button md-icon" for=__search> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg> </label> <div class=md-search data-md-component=search role=dialog> <label class=md-search__overlay for=__search></label> <div class=md-search__inner role=search> <form class=md-search__form name=search> <input type=text class=md-search__input name=query aria-label=Search placeholder=Search autocapitalize=off autocorrect=off autocomplete=off spellcheck=false data-md-component=search-query required> <label class="md-search__icon md-icon" for=__search> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg> </label> <nav class=md-search__options aria-label=Search> <button type=reset class="md-search__icon md-icon" title=Clear aria-label=Clear tabindex=-1> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg> </button> </nav> </form> <div class=md-search__output> <div class=md-search__scrollwrap data-md-scrollfix> <div class=md-search-result data-md-component=search-result> <div class=md-search-result__meta> Initializing search </div> <ol class=md-search-result__list role=presentation></ol> </div> </div> </div> </div> </div> <div class=md-header__source> <a href=https://github.com/kubernetes/ingress-nginx title="Go to repository" class=md-source data-md-component=source> <div class="md-source__icon md-icon"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 448 512"><!-- Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg> </div> <div class=md-source__repository> kubernetes/ingress-nginx </div> </a> </div> </nav> <nav class=md-tabs aria-label=Tabs data-md-component=tabs> <div class=md-grid> <ul class=md-tabs__list> <li class=md-tabs__item> <a href=.. class=md-tabs__link> Welcome </a> </li> <li class="md-tabs__item md-tabs__item--active"> <a href=./ class=md-tabs__link> Deployment </a> </li> <li class=md-tabs__item> <a href=../user-guide/nginx-configuration/ class=md-tabs__link> User Guide </a> </li> <li class=md-tabs__item> <a href=../examples/ class=md-tabs__link> Examples </a> </li> <li class=md-tabs__item> <a href=../developer-guide/getting-started/ class=md-tabs__link> Developer Guide </a> </li> <li class=md-tabs__item> <a href=../faq/ class=md-tabs__link> FAQ </a> </li> </ul> </div> </nav> </header> <div class=md-container data-md-component=container> <main class=md-main data-md-component=main> <div class="md-main__inner md-grid"> <div class="md-sidebar md-sidebar--primary" data-md-component=sidebar data-md-type=navigation> <div class=md-sidebar__scrollwrap> <div class=md-sidebar__inner> <nav class="md-nav md-nav--primary md-nav--lifted" aria-label=Navigation data-md-level=0> <label class=md-nav__title for=__drawer> <a href=.. title="Ingress-Nginx Controller" class="md-nav__button md-logo" aria-label="Ingress-Nginx Controller" data-md-component=logo> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg> </a> Ingress-Nginx Controller </label> <div class=md-nav__source> <a href=https://github.com/kubernetes/ingress-nginx title="Go to repository" class=md-source data-md-component=source> <div class="md-source__icon md-icon"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 448 512"><!-- Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg> </div> <div class=md-source__repository> kubernetes/ingress-nginx </div> </a> </div> <ul class=md-nav__list data-md-scrollfix> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_1> <label class=md-nav__link for=__nav_1 id=__nav_1_label tabindex> <span class=md-ellipsis> Welcome </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=1 aria-labelledby=__nav_1_label aria-expanded=false> <label class=md-nav__title for=__nav_1> <span class="md-nav__icon md-icon"></span> Welcome </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=.. class=md-nav__link> <span class=md-ellipsis> Welcome </span> </a> </li> <li class=md-nav__item> <a href=../how-it-works/ class=md-nav__link> <span class=md-ellipsis> How it works </span> </a> </li> <li class=md-nav__item> <a href=../troubleshooting/ class=md-nav__link> <span class=md-ellipsis> Troubleshooting </span> </a> </li> <li class=md-nav__item> <a href=../kubectl-plugin/ class=md-nav__link> <span class=md-ellipsis> kubectl plugin </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_2 checked> <label class=md-nav__link for=__nav_2 id=__nav_2_label tabindex> <span class=md-ellipsis> Deployment </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=1 aria-labelledby=__nav_2_label aria-expanded=true> <label class=md-nav__title for=__nav_2> <span class="md-nav__icon md-icon"></span> Deployment </label> <ul class=md-nav__list data-md-scrollfix> <li class="md-nav__item md-nav__item--active"> <input class="md-nav__toggle md-toggle" type=checkbox id=__toc> <label class="md-nav__link md-nav__link--active" for=__toc> <span class=md-ellipsis> Installation Guide </span> <span class="md-nav__icon md-icon"></span> </label> <a href=./ class="md-nav__link md-nav__link--active"> <span class=md-ellipsis> Installation Guide </span> </a> <nav class="md-nav md-nav--secondary" aria-label="Table of contents"> <label class=md-nav__title for=__toc> <span class="md-nav__icon md-icon"></span> Table of contents </label> <ul class=md-nav__list data-md-component=toc data-md-scrollfix> <li class=md-nav__item> <a href=#contents class=md-nav__link> Contents </a> </li> <li class=md-nav__item> <a href=#quick-start class=md-nav__link> Quick start </a> <nav class=md-nav aria-label="Quick start"> <ul class=md-nav__list> <li class=md-nav__item> <a href=#firewall-configuration class=md-nav__link> Firewall configuration </a> </li> <li class=md-nav__item> <a href=#pre-flight-check class=md-nav__link> Pre-flight check </a> </li> <li class=md-nav__item> <a href=#local-testing class=md-nav__link> Local testing </a> </li> <li class=md-nav__item> <a href=#online-testing class=md-nav__link> Online testing </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#environment-specific-instructions class=md-nav__link> Environment-specific instructions </a> <nav class=md-nav aria-label="Environment-specific instructions"> <ul class=md-nav__list> <li class=md-nav__item> <a href=#local-development-clusters class=md-nav__link> Local development clusters </a> <nav class=md-nav aria-label="Local development clusters"> <ul class=md-nav__list> <li class=md-nav__item> <a href=#minikube class=md-nav__link> minikube </a> </li> <li class=md-nav__item> <a href=#microk8s class=md-nav__link> MicroK8s </a> </li> <li class=md-nav__item> <a href=#docker-desktop class=md-nav__link> Docker Desktop </a> </li> <li class=md-nav__item> <a href=#rancher-desktop class=md-nav__link> Rancher Desktop </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#cloud-deployments class=md-nav__link> Cloud deployments </a> <nav class=md-nav aria-label="Cloud deployments"> <ul class=md-nav__list> <li class=md-nav__item> <a href=#aws class=md-nav__link> AWS </a> <nav class=md-nav aria-label=AWS> <ul class=md-nav__list> <li class=md-nav__item> <a href=#network-load-balancer-nlb class=md-nav__link> Network Load Balancer (NLB) </a> </li> <li class=md-nav__item> <a href=#tls-termination-in-aws-load-balancer-nlb class=md-nav__link> TLS termination in AWS Load Balancer (NLB) </a> </li> <li class=md-nav__item> <a href=#nlb-idle-timeouts class=md-nav__link> NLB Idle Timeouts </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#gce-gke class=md-nav__link> GCE-GKE </a> </li> <li class=md-nav__item> <a href=#azure class=md-nav__link> Azure </a> </li> <li class=md-nav__item> <a href=#digital-ocean class=md-nav__link> Digital Ocean </a> </li> <li class=md-nav__item> <a href=#scaleway class=md-nav__link> Scaleway </a> </li> <li class=md-nav__item> <a href=#exoscale class=md-nav__link> Exoscale </a> </li> <li class=md-nav__item> <a href=#oracle-cloud-infrastructure class=md-nav__link> Oracle Cloud Infrastructure </a> </li> <li class=md-nav__item> <a href=#ovhcloud class=md-nav__link> OVHcloud </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#bare-metal-clusters class=md-nav__link> Bare metal clusters </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#miscellaneous class=md-nav__link> Miscellaneous </a> <nav class=md-nav aria-label=Miscellaneous> <ul class=md-nav__list> <li class=md-nav__item> <a href=#checking-ingress-controller-version class=md-nav__link> Checking ingress controller version </a> </li> <li class=md-nav__item> <a href=#scope class=md-nav__link> Scope </a> </li> <li class=md-nav__item> <a href=#webhook-network-access class=md-nav__link> Webhook network access </a> </li> <li class=md-nav__item> <a href=#certificate-generation class=md-nav__link> Certificate generation </a> </li> <li class=md-nav__item> <a href=#running-on-kubernetes-versions-older-than-119 class=md-nav__link> Running on Kubernetes versions older than 1.19 </a> </li> </ul> </nav> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=baremetal/ class=md-nav__link> <span class=md-ellipsis> Bare-metal considerations </span> </a> </li> <li class=md-nav__item> <a href=rbac/ class=md-nav__link> <span class=md-ellipsis> Role Based Access Control (RBAC) </span> </a> </li> <li class=md-nav__item> <a href=upgrade/ class=md-nav__link> <span class=md-ellipsis> Upgrade </span> </a> </li> <li class=md-nav__item> <a href=hardening-guide/ class=md-nav__link> <span class=md-ellipsis> Hardening guide </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_3> <label class=md-nav__link for=__nav_3 id=__nav_3_label tabindex> <span class=md-ellipsis> User Guide </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=1 aria-labelledby=__nav_3_label aria-expanded=false> <label class=md-nav__title for=__nav_3> <span class="md-nav__icon md-icon"></span> User Guide </label> <ul class=md-nav__list data-md-scrollfix> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_3_1> <label class=md-nav__link for=__nav_3_1 id=__nav_3_1_label tabindex> <span class=md-ellipsis> NGINX Configuration </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=2 aria-labelledby=__nav_3_1_label aria-expanded=false> <label class=md-nav__title for=__nav_3_1> <span class="md-nav__icon md-icon"></span> NGINX Configuration </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../user-guide/nginx-configuration/ class=md-nav__link> <span class=md-ellipsis> Introduction </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/basic-usage/ class=md-nav__link> <span class=md-ellipsis> Basic usage </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/nginx-configuration/annotations/ class=md-nav__link> <span class=md-ellipsis> Annotations </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/nginx-configuration/annotations-risk/ class=md-nav__link> <span class=md-ellipsis> Annotations Risks </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/nginx-configuration/configmap/ class=md-nav__link> <span class=md-ellipsis> ConfigMap </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/nginx-configuration/custom-template/ class=md-nav__link> <span class=md-ellipsis> Custom NGINX template </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/nginx-configuration/log-format/ class=md-nav__link> <span class=md-ellipsis> Log format </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=../user-guide/cli-arguments/ class=md-nav__link> <span class=md-ellipsis> Command line arguments </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/custom-errors/ class=md-nav__link> <span class=md-ellipsis> Custom errors </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/default-backend/ class=md-nav__link> <span class=md-ellipsis> Default backend </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/exposing-tcp-udp-services/ class=md-nav__link> <span class=md-ellipsis> Exposing TCP and UDP services </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/fcgi-services/ class=md-nav__link> <span class=md-ellipsis> Exposing FCGI services </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/ingress-path-matching/ class=md-nav__link> <span class=md-ellipsis> Regular expressions in paths </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/external-articles/ class=md-nav__link> <span class=md-ellipsis> External Articles </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/miscellaneous/ class=md-nav__link> <span class=md-ellipsis> Miscellaneous </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/monitoring/ class=md-nav__link> <span class=md-ellipsis> Prometheus and Grafana installation </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/multiple-ingress/ class=md-nav__link> <span class=md-ellipsis> Multiple Ingress controllers </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/tls/ class=md-nav__link> <span class=md-ellipsis> TLS/HTTPS </span> </a> </li> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_3_13> <label class=md-nav__link for=__nav_3_13 id=__nav_3_13_label tabindex> <span class=md-ellipsis> Third party addons </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=2 aria-labelledby=__nav_3_13_label aria-expanded=false> <label class=md-nav__title for=__nav_3_13> <span class="md-nav__icon md-icon"></span> Third party addons </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../user-guide/third-party-addons/modsecurity/ class=md-nav__link> <span class=md-ellipsis> ModSecurity Web Application Firewall </span> </a> </li> <li class=md-nav__item> <a href=../user-guide/third-party-addons/opentelemetry/ class=md-nav__link> <span class=md-ellipsis> OpenTelemetry </span> </a> </li> </ul> </nav> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_4> <label class=md-nav__link for=__nav_4 id=__nav_4_label tabindex> <span class=md-ellipsis> Examples </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=1 aria-labelledby=__nav_4_label aria-expanded=false> <label class=md-nav__title for=__nav_4> <span class="md-nav__icon md-icon"></span> Examples </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../examples/ class=md-nav__link> <span class=md-ellipsis> Introduction </span> </a> </li> <li class=md-nav__item> <a href=../examples/PREREQUISITES/ class=md-nav__link> <span class=md-ellipsis> Prerequisites </span> </a> </li> <li class=md-nav__item> <a href=../examples/affinity/cookie/ class=md-nav__link> <span class=md-ellipsis> Sticky Sessions </span> </a> </li> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_4_4> <label class=md-nav__link for=__nav_4_4 id=__nav_4_4_label tabindex> <span class=md-ellipsis> Auth </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=2 aria-labelledby=__nav_4_4_label aria-expanded=false> <label class=md-nav__title for=__nav_4_4> <span class="md-nav__icon md-icon"></span> Auth </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../examples/auth/basic/ class=md-nav__link> <span class=md-ellipsis> Basic Authentication </span> </a> </li> <li class=md-nav__item> <a href=../examples/auth/client-certs/ class=md-nav__link> <span class=md-ellipsis> Client Certificate Authentication </span> </a> </li> <li class=md-nav__item> <a href=../examples/auth/external-auth/ class=md-nav__link> <span class=md-ellipsis> External Basic Authentication </span> </a> </li> <li class=md-nav__item> <a href=../examples/auth/oauth-external-auth/ class=md-nav__link> <span class=md-ellipsis> External OAUTH Authentication </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_4_5> <label class=md-nav__link for=__nav_4_5 id=__nav_4_5_label tabindex> <span class=md-ellipsis> Customization </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=2 aria-labelledby=__nav_4_5_label aria-expanded=false> <label class=md-nav__title for=__nav_4_5> <span class="md-nav__icon md-icon"></span> Customization </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../examples/customization/configuration-snippets/ class=md-nav__link> <span class=md-ellipsis> Configuration Snippets </span> </a> </li> <li class=md-nav__item> <a href=../examples/customization/custom-configuration/ class=md-nav__link> <span class=md-ellipsis> Custom Configuration </span> </a> </li> <li class=md-nav__item> <a href=../examples/customization/custom-errors/ class=md-nav__link> <span class=md-ellipsis> Custom Errors </span> </a> </li> <li class=md-nav__item> <a href=../examples/customization/custom-headers/ class=md-nav__link> <span class=md-ellipsis> Custom Headers </span> </a> </li> <li class=md-nav__item> <a href=../examples/customization/external-auth-headers/ class=md-nav__link> <span class=md-ellipsis> External authentication </span> </a> </li> <li class=md-nav__item> <a href=../examples/customization/ssl-dh-param/ class=md-nav__link> <span class=md-ellipsis> Custom DH parameters for perfect forward secrecy </span> </a> </li> <li class=md-nav__item> <a href=../examples/customization/sysctl/ class=md-nav__link> <span class=md-ellipsis> Sysctl tuning </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=../examples/docker-registry/ class=md-nav__link> <span class=md-ellipsis> Docker registry </span> </a> </li> <li class=md-nav__item> <a href=../examples/grpc/ class=md-nav__link> <span class=md-ellipsis> gRPC </span> </a> </li> <li class=md-nav__item> <a href=../examples/multi-tls/ class=md-nav__link> <span class=md-ellipsis> Multi TLS certificate termination </span> </a> </li> <li class=md-nav__item> <a href=../examples/rewrite/ class=md-nav__link> <span class=md-ellipsis> Rewrite </span> </a> </li> <li class=md-nav__item> <a href=../examples/static-ip/ class=md-nav__link> <span class=md-ellipsis> Static IPs </span> </a> </li> <li class=md-nav__item> <a href=../examples/tls-termination/ class=md-nav__link> <span class=md-ellipsis> TLS termination </span> </a> </li> <li class=md-nav__item> <a href=../examples/openpolicyagent/ class=md-nav__link> <span class=md-ellipsis> Open Policy Agent rules </span> </a> </li> <li class=md-nav__item> <a href=../examples/canary/ class=md-nav__link> <span class=md-ellipsis> Canary Deployments </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_5> <label class=md-nav__link for=__nav_5 id=__nav_5_label tabindex> <span class=md-ellipsis> Developer Guide </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=1 aria-labelledby=__nav_5_label aria-expanded=false> <label class=md-nav__title for=__nav_5> <span class="md-nav__icon md-icon"></span> Developer Guide </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../developer-guide/getting-started/ class=md-nav__link> <span class=md-ellipsis> Getting Started </span> </a> </li> <li class=md-nav__item> <a href=../developer-guide/code-overview/ class=md-nav__link> <span class=md-ellipsis> Code Overview </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=../faq/ class=md-nav__link> <span class=md-ellipsis> FAQ </span> </a> </li> </ul> </nav> </div> </div> </div> <div class="md-sidebar md-sidebar--secondary" data-md-component=sidebar data-md-type=toc> <div class=md-sidebar__scrollwrap> <div class=md-sidebar__inner> <nav class="md-nav md-nav--secondary" aria-label="Table of contents"> <label class=md-nav__title for=__toc> <span class="md-nav__icon md-icon"></span> Table of contents </label> <ul class=md-nav__list data-md-component=toc data-md-scrollfix> <li class=md-nav__item> <a href=#contents class=md-nav__link> Contents </a> </li> <li class=md-nav__item> <a href=#quick-start class=md-nav__link> Quick start </a> <nav class=md-nav aria-label="Quick start"> <ul class=md-nav__list> <li class=md-nav__item> <a href=#firewall-configuration class=md-nav__link> Firewall configuration </a> </li> <li class=md-nav__item> <a href=#pre-flight-check class=md-nav__link> Pre-flight check </a> </li> <li class=md-nav__item> <a href=#local-testing class=md-nav__link> Local testing </a> </li> <li class=md-nav__item> <a href=#online-testing class=md-nav__link> Online testing </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#environment-specific-instructions class=md-nav__link> Environment-specific instructions </a> <nav class=md-nav aria-label="Environment-specific instructions"> <ul class=md-nav__list> <li class=md-nav__item> <a href=#local-development-clusters class=md-nav__link> Local development clusters </a> <nav class=md-nav aria-label="Local development clusters"> <ul class=md-nav__list> <li class=md-nav__item> <a href=#minikube class=md-nav__link> minikube </a> </li> <li class=md-nav__item> <a href=#microk8s class=md-nav__link> MicroK8s </a> </li> <li class=md-nav__item> <a href=#docker-desktop class=md-nav__link> Docker Desktop </a> </li> <li class=md-nav__item> <a href=#rancher-desktop class=md-nav__link> Rancher Desktop </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#cloud-deployments class=md-nav__link> Cloud deployments </a> <nav class=md-nav aria-label="Cloud deployments"> <ul class=md-nav__list> <li class=md-nav__item> <a href=#aws class=md-nav__link> AWS </a> <nav class=md-nav aria-label=AWS> <ul class=md-nav__list> <li class=md-nav__item> <a href=#network-load-balancer-nlb class=md-nav__link> Network Load Balancer (NLB) </a> </li> <li class=md-nav__item> <a href=#tls-termination-in-aws-load-balancer-nlb class=md-nav__link> TLS termination in AWS Load Balancer (NLB) </a> </li> <li class=md-nav__item> <a href=#nlb-idle-timeouts class=md-nav__link> NLB Idle Timeouts </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#gce-gke class=md-nav__link> GCE-GKE </a> </li> <li class=md-nav__item> <a href=#azure class=md-nav__link> Azure </a> </li> <li class=md-nav__item> <a href=#digital-ocean class=md-nav__link> Digital Ocean </a> </li> <li class=md-nav__item> <a href=#scaleway class=md-nav__link> Scaleway </a> </li> <li class=md-nav__item> <a href=#exoscale class=md-nav__link> Exoscale </a> </li> <li class=md-nav__item> <a href=#oracle-cloud-infrastructure class=md-nav__link> Oracle Cloud Infrastructure </a> </li> <li class=md-nav__item> <a href=#ovhcloud class=md-nav__link> OVHcloud </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#bare-metal-clusters class=md-nav__link> Bare metal clusters </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#miscellaneous class=md-nav__link> Miscellaneous </a> <nav class=md-nav aria-label=Miscellaneous> <ul class=md-nav__list> <li class=md-nav__item> <a href=#checking-ingress-controller-version class=md-nav__link> Checking ingress controller version </a> </li> <li class=md-nav__item> <a href=#scope class=md-nav__link> Scope </a> </li> <li class=md-nav__item> <a href=#webhook-network-access class=md-nav__link> Webhook network access </a> </li> <li class=md-nav__item> <a href=#certificate-generation class=md-nav__link> Certificate generation </a> </li> <li class=md-nav__item> <a href=#running-on-kubernetes-versions-older-than-119 class=md-nav__link> Running on Kubernetes versions older than 1.19 </a> </li> </ul> </nav> </li> </ul> </nav> </div> </div> </div> <div class=md-content data-md-component=content> <article class="md-content__inner md-typeset"> <h1 id=installation-guide>Installation Guide<a class=headerlink href=#installation-guide title="Permanent link"> ¶</a></h1> <p>There are multiple ways to install the Ingress-Nginx Controller:</p> <ul> <li>with <a href=https://helm.sh>Helm</a>, using the project repository chart;</li> <li>with <code>kubectl apply</code>, using YAML manifests;</li> <li>with specific addons (e.g. for <a href=#minikube>minikube</a> or <a href=#microk8s>MicroK8s</a>).</li> </ul> <p>On most Kubernetes clusters, the ingress controller will work without requiring any extra configuration. If you want to get started as fast as possible, you can check the <a href=#quick-start>quick start</a> instructions. However, in many environments, you can improve the performance or get better logs by enabling extra features. We recommend that you check the <a href=#environment-specific-instructions>environment-specific instructions</a> for details about optimizing the ingress controller for your particular environment or cloud provider.</p> <h2 id=contents>Contents<a class=headerlink href=#contents title="Permanent link"> ¶</a></h2> <!-- Quick tip: run `grep '^##' index.md` to check that the table of contents is up-to-date. --> <ul> <li> <p><a href=#quick-start>Quick start</a></p> </li> <li> <p><a href=#environment-specific-instructions>Environment-specific instructions</a></p> </li> <li>... <a href=#docker-desktop>Docker Desktop</a></li> <li>... <a href=#rancher-desktop>Rancher Desktop</a></li> <li>... <a href=#minikube>minikube</a></li> <li>... <a href=#microk8s>MicroK8s</a></li> <li>... <a href=#aws>AWS</a></li> <li>... <a href=#gce-gke>GCE - GKE</a></li> <li>... <a href=#azure>Azure</a></li> <li>... <a href=#digital-ocean>Digital Ocean</a></li> <li>... <a href=#scaleway>Scaleway</a></li> <li>... <a href=#exoscale>Exoscale</a></li> <li>... <a href=#oracle-cloud-infrastructure>Oracle Cloud Infrastructure</a></li> <li>... <a href=#ovhcloud>OVHcloud</a></li> <li>... <a href=#bare-metal-clusters>Bare-metal</a></li> <li><a href=#miscellaneous>Miscellaneous</a></li> </ul> <!-- TODO: We have subdirectories for kubernetes versions now because of a PR
|
|
https://github.com/kubernetes/ingress-nginx/pull/8162 . You can see this here
|
|
https://github.com/kubernetes/ingress-nginx/tree/main/deploy/static/provider/cloud .
|
|
We need to add documentation here that is clear and unambiguous in guiding users to pick the deployment manifest
|
|
under a subdirectory, based on the K8S version being used. But until the explicit clear docs land here, users are
|
|
free to use those subdirectories and get the manifest(s) related to their K8S version. --> <h2 id=quick-start>Quick start<a class=headerlink href=#quick-start title="Permanent link"> ¶</a></h2> <p><strong>If you have Helm,</strong> you can deploy the ingress controller with the following command:</p> <div class=highlight><pre><span></span><code><span class=go>helm upgrade --install ingress-nginx ingress-nginx \</span>
|
|
<span class=go> --repo https://kubernetes.github.io/ingress-nginx \</span>
|
|
<span class=go> --namespace ingress-nginx --create-namespace</span>
|
|
</code></pre></div> <p>It will install the controller in the <code>ingress-nginx</code> namespace, creating that namespace if it doesn't already exist.</p> <div class="admonition info"> <p class=admonition-title>Info</p> <p>This command is <em>idempotent</em>:</p> <ul> <li>if the ingress controller is not installed, it will install it,</li> <li>if the ingress controller is already installed, it will upgrade it.</li> </ul> </div> <p><strong>If you want a full list of values that you can set, while installing with Helm,</strong> then run:</p> <div class=highlight><pre><span></span><code><span class=go>helm show values ingress-nginx --repo https://kubernetes.github.io/ingress-nginx</span>
|
|
</code></pre></div> <div class="admonition attention"> <p class=admonition-title>Helm install on AWS/GCP/Azure/Other providers</p> <p>The <em>ingress-nginx-controller helm-chart is a generic install out of the box</em>. The default set of helm values is <strong>not</strong> configured for installation on any infra provider. The annotations that are applicable to the cloud provider must be customized by the users.<br> See <a href=https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.2/guide/service/annotations/ >AWS LB Controller</a>.<br> Examples of some annotations recommended (healthecheck ones are required for target-type IP) for the service resource of <code>--type LoadBalancer</code> on AWS are below: <div class=highlight><pre><span></span><code><span class=w> </span><span class=nt>annotations</span><span class=p>:</span>
|
|
<span class=w> </span><span class=nt>service.beta.kubernetes.io/aws-load-balancer-target-group-attributes</span><span class=p>:</span><span class=w> </span><span class="l l-Scalar l-Scalar-Plain">deregistration_delay.timeout_seconds=270</span>
|
|
<span class=w> </span><span class=nt>service.beta.kubernetes.io/aws-load-balancer-nlb-target-type</span><span class=p>:</span><span class=w> </span><span class="l l-Scalar l-Scalar-Plain">ip</span>
|
|
<span class=w> </span><span class=nt>service.beta.kubernetes.io/aws-load-balancer-healthcheck-path</span><span class=p>:</span><span class=w> </span><span class="l l-Scalar l-Scalar-Plain">/healthz</span>
|
|
<span class=w> </span><span class=nt>service.beta.kubernetes.io/aws-load-balancer-healthcheck-port</span><span class=p>:</span><span class=w> </span><span class=s>"10254"</span>
|
|
<span class=w> </span><span class=nt>service.beta.kubernetes.io/aws-load-balancer-healthcheck-protocol</span><span class=p>:</span><span class=w> </span><span class="l l-Scalar l-Scalar-Plain">http</span>
|
|
<span class=w> </span><span class=nt>service.beta.kubernetes.io/aws-load-balancer-healthcheck-success-codes</span><span class=p>:</span><span class=w> </span><span class="l l-Scalar l-Scalar-Plain">200-299</span>
|
|
<span class=w> </span><span class=nt>service.beta.kubernetes.io/aws-load-balancer-scheme</span><span class=p>:</span><span class=w> </span><span class=s>"internet-facing"</span>
|
|
<span class=w> </span><span class=nt>service.beta.kubernetes.io/aws-load-balancer-backend-protocol</span><span class=p>:</span><span class=w> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span>
|
|
<span class=w> </span><span class=nt>service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled</span><span class=p>:</span><span class=w> </span><span class=s>"true"</span>
|
|
<span class=w> </span><span class=nt>service.beta.kubernetes.io/aws-load-balancer-type</span><span class=p>:</span><span class=w> </span><span class="l l-Scalar l-Scalar-Plain">nlb</span>
|
|
<span class=w> </span><span class=nt>service.beta.kubernetes.io/aws-load-balancer-manage-backend-security-group-rules</span><span class=p>:</span><span class=w> </span><span class=s>"true"</span>
|
|
<span class=w> </span><span class=nt>service.beta.kubernetes.io/aws-load-balancer-access-log-enabled</span><span class=p>:</span><span class=w> </span><span class=s>"true"</span>
|
|
<span class=w> </span><span class=nt>service.beta.kubernetes.io/aws-load-balancer-security-groups</span><span class=p>:</span><span class=w> </span><span class=s>"sg-something1</span><span class=nv> </span><span class=s>sg-something2"</span>
|
|
<span class=w> </span><span class=nt>service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name</span><span class=p>:</span><span class=w> </span><span class=s>"somebucket"</span>
|
|
<span class=w> </span><span class=nt>service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix</span><span class=p>:</span><span class=w> </span><span class=s>"ingress-nginx"</span>
|
|
<span class=w> </span><span class=nt>service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval</span><span class=p>:</span><span class=w> </span><span class=s>"5"</span>
|
|
</code></pre></div></p> </div> <p><strong>If you don't have Helm</strong> or if you prefer to use a YAML manifest, you can run the following command instead:</p> <div class=highlight><pre><span></span><code><span class=go>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.12.0/deploy/static/provider/cloud/deploy.yaml</span>
|
|
</code></pre></div> <div class="admonition info"> <p class=admonition-title>Info</p> <p>The YAML manifest in the command above was generated with <code>helm template</code>, so you will end up with almost the same resources as if you had used Helm to install the controller.</p> </div> <div class="admonition attention"> <p class=admonition-title>Attention</p> <p>If you are running an old version of Kubernetes (1.18 or earlier), please read <a href=#running-on-Kubernetes-versions-older-than-1.19>this paragraph</a> for specific instructions. Because of api deprecations, the default manifest may not work on your cluster. Specific manifests for supported Kubernetes versions are available within a sub-folder of each provider.</p> </div> <h3 id=firewall-configuration>Firewall configuration<a class=headerlink href=#firewall-configuration title="Permanent link"> ¶</a></h3> <p>To check which ports are used by your installation of ingress-nginx, look at the output of <code>kubectl -n ingress-nginx get pod -o yaml</code>. In general, you need:</p> <ul> <li>Port 8443 open between all hosts on which the kubernetes nodes are running. This is used for the ingress-nginx <a href=https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/ >admission controller</a>.</li> <li>Port 80 (for HTTP) and/or 443 (for HTTPS) open to the public on the kubernetes nodes to which the DNS of your apps are pointing.</li> </ul> <h3 id=pre-flight-check>Pre-flight check<a class=headerlink href=#pre-flight-check title="Permanent link"> ¶</a></h3> <p>A few pods should start in the <code>ingress-nginx</code> namespace:</p> <div class=highlight><pre><span></span><code><span class=go>kubectl get pods --namespace=ingress-nginx</span>
|
|
</code></pre></div> <p>After a while, they should all be running. The following command will wait for the ingress controller pod to be up, running, and ready:</p> <div class=highlight><pre><span></span><code><span class=go>kubectl wait --namespace ingress-nginx \</span>
|
|
<span class=go> --for=condition=ready pod \</span>
|
|
<span class=go> --selector=app.kubernetes.io/component=controller \</span>
|
|
<span class=go> --timeout=120s</span>
|
|
</code></pre></div> <h3 id=local-testing>Local testing<a class=headerlink href=#local-testing title="Permanent link"> ¶</a></h3> <p>Let's create a simple web server and the associated service:</p> <div class=highlight><pre><span></span><code><span class=go>kubectl create deployment demo --image=httpd --port=80</span>
|
|
<span class=go>kubectl expose deployment demo</span>
|
|
</code></pre></div> <p>Then create an ingress resource. The following example uses a host that maps to <code>localhost</code>:</p> <div class=highlight><pre><span></span><code><span class=go>kubectl create ingress demo-localhost --class=nginx \</span>
|
|
<span class=go> --rule="demo.localdev.me/*=demo:80"</span>
|
|
</code></pre></div> <p>Now, forward a local port to the ingress controller:</p> <div class=highlight><pre><span></span><code><span class=go>kubectl port-forward --namespace=ingress-nginx service/ingress-nginx-controller 8080:80</span>
|
|
</code></pre></div> <div class="admonition info"> <p class=admonition-title>Info</p> <p>A note on DNS & network-connection. This documentation assumes that a user has awareness of the DNS and the network routing aspects involved in using ingress. The port-forwarding mentioned above, is the easiest way to demo the working of ingress. The "kubectl port-forward..." command above has forwarded the port number 8080, on the localhost's tcp/ip stack, where the command was typed, to the port number 80, of the service created by the installation of ingress-nginx controller. So now, the traffic sent to port number 8080 on localhost will reach the port number 80, of the ingress-controller's service. Port-forwarding is not for a production environment use-case. But here we use port-forwarding, to simulate a HTTP request, originating from outside the cluster, to reach the service of the ingress-nginx controller, that is exposed to receive traffic from outside the cluster.</p> </div> <p><a href=https://github.com/kubernetes/ingress-nginx/issues/10014#issuecomment-1567791549described>This issue</a> shows a typical DNS problem and its solution.</p> <p>At this point, you can access your deployment using curl ;</p> <div class=highlight><pre><span></span><code><span class=go>curl --resolve demo.localdev.me:8080:127.0.0.1 http://demo.localdev.me:8080</span>
|
|
</code></pre></div> <p>You should see a HTML response containing text like <strong>"It works!"</strong>.</p> <h3 id=online-testing>Online testing<a class=headerlink href=#online-testing title="Permanent link"> ¶</a></h3> <p>If your Kubernetes cluster is a "real" cluster that supports services of type <code>LoadBalancer</code>, it will have allocated an external IP address or FQDN to the ingress controller.</p> <p>You can see that IP address or FQDN with the following command:</p> <div class=highlight><pre><span></span><code><span class=go>kubectl get service ingress-nginx-controller --namespace=ingress-nginx</span>
|
|
</code></pre></div> <p>It will be the <code>EXTERNAL-IP</code> field. If that field shows <code><pending></code>, this means that your Kubernetes cluster wasn't able to provision the load balancer (generally, this is because it doesn't support services of type <code>LoadBalancer</code>).</p> <p>Once you have the external IP address (or FQDN), set up a DNS record pointing to it. Then you can create an ingress resource. The following example assumes that you have set up a DNS record for <code>www.demo.io</code>:</p> <div class=highlight><pre><span></span><code><span class=go>kubectl create ingress demo --class=nginx \</span>
|
|
<span class=go> --rule="www.demo.io/*=demo:80"</span>
|
|
</code></pre></div> <p>Alternatively, the above command can be rewritten as follows for the <code>--rule</code> command and below.</p> <div class=highlight><pre><span></span><code><span class=go>kubectl create ingress demo --class=nginx \</span>
|
|
<span class=go> --rule www.demo.io/=demo:80</span>
|
|
</code></pre></div> <p>You should then be able to see the "It works!" page when you connect to <a href=http://www.demo.io/ >http://www.demo.io/</a>. Congratulations, you are serving a public website hosted on a Kubernetes cluster! 🎉</p> <h2 id=environment-specific-instructions>Environment-specific instructions<a class=headerlink href=#environment-specific-instructions title="Permanent link"> ¶</a></h2> <h3 id=local-development-clusters>Local development clusters<a class=headerlink href=#local-development-clusters title="Permanent link"> ¶</a></h3> <h4 id=minikube>minikube<a class=headerlink href=#minikube title="Permanent link"> ¶</a></h4> <p>The ingress controller can be installed through minikube's addons system:</p> <div class=highlight><pre><span></span><code><span class=go>minikube addons enable ingress</span>
|
|
</code></pre></div> <h4 id=microk8s>MicroK8s<a class=headerlink href=#microk8s title="Permanent link"> ¶</a></h4> <p>The ingress controller can be installed through MicroK8s's addons system:</p> <div class=highlight><pre><span></span><code><span class=go>microk8s enable ingress</span>
|
|
</code></pre></div> <p>Please check the MicroK8s <a href=https://microk8s.io/docs/addon-ingress>documentation page</a> for details.</p> <h4 id=docker-desktop>Docker Desktop<a class=headerlink href=#docker-desktop title="Permanent link"> ¶</a></h4> <p>Kubernetes is available in Docker Desktop:</p> <ul> <li>Mac, from <a href=https://docs.docker.com/docker-for-mac/release-notes/#stable-releases-of-2018>version 18.06.0-ce</a></li> <li>Windows, from <a href=https://docs.docker.com/docker-for-windows/release-notes/#docker-community-edition-18060-ce-win70-2018-07-25>version 18.06.0-ce</a></li> </ul> <p>First, make sure that Kubernetes is enabled in the Docker settings. The command <code>kubectl get nodes</code> should show a single node called <code>docker-desktop</code>.</p> <p>The ingress controller can be installed on Docker Desktop using the default <a href=#quick-start>quick start</a> instructions.</p> <p>On most systems, if you don't have any other service of type <code>LoadBalancer</code> bound to port 80, the ingress controller will be assigned the <code>EXTERNAL-IP</code> of <code>localhost</code>, which means that it will be reachable on localhost:80. If that doesn't work, you might have to fall back to the <code>kubectl port-forward</code> method described in the <a href=#local-testing>local testing section</a>.</p> <h4 id=rancher-desktop>Rancher Desktop<a class=headerlink href=#rancher-desktop title="Permanent link"> ¶</a></h4> <p>Rancher Desktop provides Kubernetes and Container Management on the desktop. Kubernetes is enabled by default in Rancher Desktop.</p> <p>Rancher Desktop uses K3s under the hood, which in turn uses Traefik as the default ingress controller for the Kubernetes cluster. To use Ingress-Nginx Controller in place of the default Traefik, disable Traefik from Preference > Kubernetes menu.</p> <p>Once traefik is disabled, the Ingress-Nginx Controller can be installed on Rancher Desktop using the default <a href=#quick-start>quick start</a> instructions. Follow the instructions described in the <a href=#local-testing>local testing section</a> to try a sample.</p> <h3 id=cloud-deployments>Cloud deployments<a class=headerlink href=#cloud-deployments title="Permanent link"> ¶</a></h3> <p>If the load balancers of your cloud provider do active healthchecks on their backends (most do), you can change the <code>externalTrafficPolicy</code> of the ingress controller Service to <code>Local</code> (instead of the default <code>Cluster</code>) to save an extra hop in some cases. If you're installing with Helm, this can be done by adding <code>--set controller.service.externalTrafficPolicy=Local</code> to the <code>helm install</code> or <code>helm upgrade</code> command.</p> <p>Furthermore, if the load balancers of your cloud provider support the PROXY protocol, you can enable it, and it will let the ingress controller see the real IP address of the clients. Otherwise, it will generally see the IP address of the upstream load balancer. This must be done both in the ingress controller (with e.g. <code>--set controller.config.use-proxy-protocol=true</code>) and in the cloud provider's load balancer configuration to function correctly.</p> <p>In the following sections, we provide YAML manifests that enable these options when possible, using the specific options of various cloud providers.</p> <h4 id=aws>AWS<a class=headerlink href=#aws title="Permanent link"> ¶</a></h4> <p>In AWS, we use a Network load balancer (NLB) to expose the Ingress-Nginx Controller behind a Service of <code>Type=LoadBalancer</code>.</p> <div class="admonition info"> <p class=admonition-title>Info</p> <p>The provided templates illustrate the setup for legacy in-tree service load balancer for AWS NLB. AWS provides the documentation on how to use <a href=https://docs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html>Network load balancing on Amazon EKS</a> with <a href=https://github.com/kubernetes-sigs/aws-load-balancer-controller>AWS Load Balancer Controller</a>.</p> </div> <h5 id=network-load-balancer-nlb>Network Load Balancer (NLB)<a class=headerlink href=#network-load-balancer-nlb title="Permanent link"> ¶</a></h5> <div class=highlight><pre><span></span><code><span class=go>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.12.0/deploy/static/provider/aws/deploy.yaml</span>
|
|
</code></pre></div> <h5 id=tls-termination-in-aws-load-balancer-nlb>TLS termination in AWS Load Balancer (NLB)<a class=headerlink href=#tls-termination-in-aws-load-balancer-nlb title="Permanent link"> ¶</a></h5> <p>By default, TLS is terminated in the ingress controller. But it is also possible to terminate TLS in the Load Balancer. This section explains how to do that on AWS using an NLB.</p> <ol> <li>Download the <a href=https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.12.0/deploy/static/provider/aws/nlb-with-tls-termination/deploy.yaml>deploy.yaml</a> template</li> </ol> <div class=highlight><pre><span></span><code><span class=go>wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.12.0/deploy/static/provider/aws/nlb-with-tls-termination/deploy.yaml</span>
|
|
</code></pre></div> <ol> <li>Edit the file and change the VPC CIDR in use for the Kubernetes cluster:</li> </ol> <div class=highlight><pre><span></span><code>proxy-real-ip-cidr: XXX.XXX.XXX/XX
|
|
</code></pre></div> <ol> <li>Change the AWS Certificate Manager (ACM) ID as well:</li> </ol> <div class=highlight><pre><span></span><code>arn:aws:acm:us-west-2:XXXXXXXX:certificate/XXXXXX-XXXXXXX-XXXXXXX-XXXXXXXX
|
|
</code></pre></div> <ol> <li>Deploy the manifest:</li> </ol> <div class=highlight><pre><span></span><code><span class=go>kubectl apply -f deploy.yaml</span>
|
|
</code></pre></div> <h5 id=nlb-idle-timeouts>NLB Idle Timeouts<a class=headerlink href=#nlb-idle-timeouts title="Permanent link"> ¶</a></h5> <p>Idle timeout value for TCP flows is 350 seconds and <a href=https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-load-balancers.html#connection-idle-timeout>cannot be modified</a>.</p> <p>For this reason, you need to ensure the <a href=https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout>keepalive_timeout</a> value is configured less than 350 seconds to work as expected.</p> <p>By default, NGINX <code>keepalive_timeout</code> is set to <code>75s</code>.</p> <p>More information with regard to timeouts can be found in the <a href=https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-load-balancers.html#connection-idle-timeout>official AWS documentation</a></p> <h4 id=gce-gke>GCE-GKE<a class=headerlink href=#gce-gke title="Permanent link"> ¶</a></h4> <p>First, your user needs to have <code>cluster-admin</code> permissions on the cluster. This can be done with the following command:</p> <div class=highlight><pre><span></span><code><span class=go>kubectl create clusterrolebinding cluster-admin-binding \</span>
|
|
<span class=go> --clusterrole cluster-admin \</span>
|
|
<span class=go> --user $(gcloud config get-value account)</span>
|
|
</code></pre></div> <p>Then, the ingress controller can be installed like this:</p> <div class=highlight><pre><span></span><code><span class=go>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.12.0/deploy/static/provider/cloud/deploy.yaml</span>
|
|
</code></pre></div> <div class="admonition warning"> <p class=admonition-title>Warning</p> <p>For private clusters, you will need to either add a firewall rule that allows master nodes access to port <code>8443/tcp</code> on worker nodes, or change the existing rule that allows access to port <code>80/tcp</code>, <code>443/tcp</code> and <code>10254/tcp</code> to also allow access to port <code>8443/tcp</code>. More information can be found in the <a href=https://cloud.google.com/load-balancing/docs/tcp/setting-up-tcp#config-hc-firewall>Official GCP Documentation</a>.</p> <p>See the <a href=https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#add_firewall_rules>GKE documentation</a> on adding rules and the <a href=https://github.com/kubernetes/kubernetes/issues/79739>Kubernetes issue</a> for more detail.</p> </div> <p>Proxy-protocol is supported in GCE check the <a href=https://cloud.google.com/load-balancing/docs/tcp/setting-up-tcp#proxy-protocol>Official Documentations on how to enable.</a></p> <h4 id=azure>Azure<a class=headerlink href=#azure title="Permanent link"> ¶</a></h4> <div class=highlight><pre><span></span><code><span class=go>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.12.0/deploy/static/provider/cloud/deploy.yaml</span>
|
|
</code></pre></div> <p>More information with regard to Azure annotations for ingress controller can be found in the <a href=https://docs.microsoft.com/en-us/azure/aks/ingress-internal-ip#create-an-ingress-controller>official AKS documentation</a>.</p> <h4 id=digital-ocean>Digital Ocean<a class=headerlink href=#digital-ocean title="Permanent link"> ¶</a></h4> <div class=highlight><pre><span></span><code><span class=go>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.12.0/deploy/static/provider/do/deploy.yaml</span>
|
|
</code></pre></div> <ul> <li>By default the service object of the ingress-nginx-controller for Digital-Ocean, only configures one annotation. Its this one <code>service.beta.kubernetes.io/do-loadbalancer-enable-proxy-protocol: "true"</code>. While this makes the service functional, it was reported that the Digital-Ocean LoadBalancer graphs shows <code>no data</code>, unless a few other annotations are also configured. Some of these other annotations require values that can not be generic and hence not forced in a out-of-the-box installation. These annotations and a discussion on them is well documented in <a href=https://github.com/kubernetes/ingress-nginx/issues/8965>this issue</a>. Please refer to the issue to add annotations, with values specific to user, to get graphs of the DO-LB populated with data.</li> </ul> <h4 id=scaleway>Scaleway<a class=headerlink href=#scaleway title="Permanent link"> ¶</a></h4> <div class=highlight><pre><span></span><code><span class=go>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.12.0/deploy/static/provider/scw/deploy.yaml</span>
|
|
</code></pre></div> <p>Refer to the <a href=https://www.scaleway.com/en/docs/tutorials/proxy-protocol-v2-load-balancer/#configuring-proxy-protocol-for-ingress-nginx>dedicated tutorial</a> in the Scaleway documentation for configuring the proxy protocol for ingress-nginx with the Scaleway load balancer.</p> <h4 id=exoscale>Exoscale<a class=headerlink href=#exoscale title="Permanent link"> ¶</a></h4> <div class=highlight><pre><span></span><code><span class=go>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/exoscale/deploy.yaml</span>
|
|
</code></pre></div> <p>The full list of annotations supported by Exoscale is available in the Exoscale Cloud Controller Manager <a href=https://github.com/exoscale/exoscale-cloud-controller-manager/blob/master/docs/service-loadbalancer.md>documentation</a>.</p> <h4 id=oracle-cloud-infrastructure>Oracle Cloud Infrastructure<a class=headerlink href=#oracle-cloud-infrastructure title="Permanent link"> ¶</a></h4> <div class=highlight><pre><span></span><code><span class=go>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.12.0/deploy/static/provider/cloud/deploy.yaml</span>
|
|
</code></pre></div> <p>A <a href=https://github.com/oracle/oci-cloud-controller-manager/blob/master/docs/load-balancer-annotations.md>complete list of available annotations for Oracle Cloud Infrastructure</a> can be found in the <a href=https://github.com/oracle/oci-cloud-controller-manager>OCI Cloud Controller Manager</a> documentation.</p> <h4 id=ovhcloud>OVHcloud<a class=headerlink href=#ovhcloud title="Permanent link"> ¶</a></h4> <div class=highlight><pre><span></span><code><span class=go>helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx</span>
|
|
<span class=go>helm repo update</span>
|
|
<span class=go>helm -n ingress-nginx install ingress-nginx ingress-nginx/ingress-nginx --create-namespace</span>
|
|
</code></pre></div> <p>You can find the <a href=https://docs.ovh.com/gb/en/kubernetes/installing-nginx-ingress/ >complete tutorial</a>.</p> <h3 id=bare-metal-clusters>Bare metal clusters<a class=headerlink href=#bare-metal-clusters title="Permanent link"> ¶</a></h3> <p>This section is applicable to Kubernetes clusters deployed on bare metal servers, as well as "raw" VMs where Kubernetes was installed manually, using generic Linux distros (like CentOS, Ubuntu...)</p> <p>For quick testing, you can use a <a href=https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport>NodePort</a>. This should work on almost every cluster, but it will typically use a port in the range 30000-32767.</p> <div class=highlight><pre><span></span><code><span class=go>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.12.0/deploy/static/provider/baremetal/deploy.yaml</span>
|
|
</code></pre></div> <p>For more information about bare metal deployments (and how to use port 80 instead of a random port in the 30000-32767 range), see <a href=baremetal/ >bare-metal considerations</a>.</p> <h2 id=miscellaneous>Miscellaneous<a class=headerlink href=#miscellaneous title="Permanent link"> ¶</a></h2> <h3 id=checking-ingress-controller-version>Checking ingress controller version<a class=headerlink href=#checking-ingress-controller-version title="Permanent link"> ¶</a></h3> <p>Run <code>/nginx-ingress-controller --version</code> within the pod, for instance with <code>kubectl exec</code>:</p> <div class=highlight><pre><span></span><code><span class=go>POD_NAMESPACE=ingress-nginx</span>
|
|
<span class=go>POD_NAME=$(kubectl get pods -n $POD_NAMESPACE -l app.kubernetes.io/name=ingress-nginx --field-selector=status.phase=Running -o name)</span>
|
|
<span class=go>kubectl exec $POD_NAME -n $POD_NAMESPACE -- /nginx-ingress-controller --version</span>
|
|
</code></pre></div> <h3 id=scope>Scope<a class=headerlink href=#scope title="Permanent link"> ¶</a></h3> <p>By default, the controller watches Ingress objects from all namespaces. If you want to change this behavior, use the flag <code>--watch-namespace</code> or check the Helm chart value <code>controller.scope</code> to limit the controller to a single namespace. Although the use of this flag is not popular, one important fact to note is that the secret containing the default-ssl-certificate needs to also be present in the watched namespace(s).</p> <p>See also <a href=https://kubernetes.github.io/ingress-nginx/#how-to-easily-install-multiple-instances-of-the-ingress-nginx-controller-in-the-same-cluster>“How to easily install multiple instances of the Ingress NGINX controller in the same cluster”</a> for more details.</p> <h3 id=webhook-network-access>Webhook network access<a class=headerlink href=#webhook-network-access title="Permanent link"> ¶</a></h3> <div class="admonition warning"> <p class=admonition-title>Warning</p> <p>The controller uses an <a href=https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/ >admission webhook</a> to validate Ingress definitions. Make sure that you don't have <a href=https://kubernetes.io/docs/concepts/services-networking/network-policies/ >Network policies</a> or additional firewalls preventing connections from the API server to the <code>ingress-nginx-controller-admission</code> service.</p> </div> <h3 id=certificate-generation>Certificate generation<a class=headerlink href=#certificate-generation title="Permanent link"> ¶</a></h3> <div class="admonition attention"> <p class=admonition-title>Attention</p> <p>The first time the ingress controller starts, two <a href=https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ >Jobs</a> create the SSL Certificate used by the admission webhook.</p> </div> <p>This can cause an initial delay of up to two minutes until it is possible to create and validate Ingress definitions.</p> <p>You can wait until it is ready to run the next command:</p> <div class=highlight><pre><span></span><code><span class=w> </span><span class="l l-Scalar l-Scalar-Plain">kubectl wait --namespace ingress-nginx \</span>
|
|
<span class=w> </span><span class="l l-Scalar l-Scalar-Plain">--for=condition=ready pod \</span>
|
|
<span class=w> </span><span class="l l-Scalar l-Scalar-Plain">--selector=app.kubernetes.io/component=controller \</span>
|
|
<span class=w> </span><span class="l l-Scalar l-Scalar-Plain">--timeout=120s</span>
|
|
</code></pre></div> <h3 id=running-on-kubernetes-versions-older-than-119>Running on Kubernetes versions older than 1.19<a class=headerlink href=#running-on-kubernetes-versions-older-than-119 title="Permanent link"> ¶</a></h3> <p>Ingress resources evolved over time. They started with <code>apiVersion: extensions/v1beta1</code>, then moved to <code>apiVersion: networking.k8s.io/v1beta1</code> and more recently to <code>apiVersion: networking.k8s.io/v1</code>.</p> <p>Here is how these Ingress versions are supported in Kubernetes:</p> <ul> <li>before Kubernetes 1.19, only <code>v1beta1</code> Ingress resources are supported</li> <li>from Kubernetes 1.19 to 1.21, both <code>v1beta1</code> and <code>v1</code> Ingress resources are supported</li> <li>in Kubernetes 1.22 and above, only <code>v1</code> Ingress resources are supported</li> </ul> <p>And here is how these Ingress versions are supported in Ingress-Nginx Controller:</p> <ul> <li>before version 1.0, only <code>v1beta1</code> Ingress resources are supported</li> <li>in version 1.0 and above, only <code>v1</code> Ingress resources are</li> </ul> <p>As a result, if you're running Kubernetes 1.19 or later, you should be able to use the latest version of the NGINX Ingress Controller; but if you're using an old version of Kubernetes (1.18 or earlier) you will have to use version 0.X of the Ingress-Nginx Controller (e.g. version 0.49).</p> <p>The Helm chart of the Ingress-Nginx Controller switched to version 1 in version 4 of the chart. In other words, if you're running Kubernetes 1.19 or earlier, you should use version 3.X of the chart (this can be done by adding <code>--version='<4'</code> to the <code>helm install</code> command ).</p> </article> </div> </div> </main> <footer class=md-footer> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class=md-copyright> Made with <a href=https://squidfunk.github.io/mkdocs-material/ target=_blank rel=noopener> Material for MkDocs </a> </div> </div> </div> </footer> </div> <div class=md-dialog data-md-component=dialog> <div class="md-dialog__inner md-typeset"></div> </div> <script id=__config type=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> <script src=../assets/javascripts/bundle.aecac24b.min.js></script> </body> </html> |