Deploy GitHub Pages

This commit is contained in:
Travis Bot 2020-02-09 23:53:05 +00:00
parent ec2af1dbc3
commit 006cda8fee
62 changed files with 1885 additions and 1843 deletions

View file

@ -32,7 +32,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="/ingress-nginx/assets/images/favicon.png"> <link rel="shortcut icon" href="/ingress-nginx/assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -40,7 +40,7 @@
<link rel="stylesheet" href="/ingress-nginx/assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="/ingress-nginx/assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="/ingress-nginx/assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="/ingress-nginx/assets/stylesheets/application-palette.a8b3c06d.css">
@ -51,12 +51,12 @@
<script src="/ingress-nginx/assets/javascripts/modernizr.74668098.js"></script> <script src="/ingress-nginx/assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -117,7 +117,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -148,7 +148,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1130,9 +1130,9 @@
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1142,7 +1142,7 @@
</div> </div>
<script src="/ingress-nginx/assets/javascripts/application.ac79c3b0.js"></script> <script src="/ingress-nginx/assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"/ingress-nginx"}})</script> <script>app.initialize({version:"1.0.4",url:{base:"/ingress-nginx"}})</script>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#bare-metal-considerations" tabindex="1" class="md-skip"> <a href="#bare-metal-considerations" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1263,7 +1263,7 @@ Kubernetes cluster running on bare-metal.</p>
supported cloud provider, effectively allowing the usage of LoadBalancer Services within any cluster.</p> supported cloud provider, effectively allowing the usage of LoadBalancer Services within any cluster.</p>
<p>This section demonstrates how to use the <a href="https://metallb.universe.tf/tutorial/layer2/">Layer 2 configuration mode</a> of MetalLB together with the NGINX <p>This section demonstrates how to use the <a href="https://metallb.universe.tf/tutorial/layer2/">Layer 2 configuration mode</a> of MetalLB together with the NGINX
Ingress controller in a Kubernetes cluster that has <strong>publicly accessible nodes</strong>. In this mode, one node attracts all Ingress controller in a Kubernetes cluster that has <strong>publicly accessible nodes</strong>. In this mode, one node attracts all
the traffic for the <code class="codehilite">ingress-nginx</code> Service IP. See <a href="https://metallb.universe.tf/usage/#traffic-policies">Traffic policies</a> for more details.</p> the traffic for the <code class="codehilite"><span class="err">ingress-nginx</span></code> Service IP. See <a href="https://metallb.universe.tf/usage/#traffic-policies">Traffic policies</a> for more details.</p>
<p><img alt="MetalLB in L2 mode" src="../../images/baremetal/metallb.jpg" /></p> <p><img alt="MetalLB in L2 mode" src="../../images/baremetal/metallb.jpg" /></p>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
@ -1276,22 +1276,22 @@ yourself by reading the official documentation thoroughly.</p>
</div> </div>
<p>MetalLB can be deployed either with a simple Kubernetes manifest or with Helm. The rest of this example assumes MetalLB <p>MetalLB can be deployed either with a simple Kubernetes manifest or with Helm. The rest of this example assumes MetalLB
was deployed following the <a href="https://metallb.universe.tf/installation/">Installation</a> instructions.</p> was deployed following the <a href="https://metallb.universe.tf/installation/">Installation</a> instructions.</p>
<p>MetalLB requires a pool of IP addresses in order to be able to take ownership of the <code class="codehilite">ingress-nginx</code> Service. This pool <p>MetalLB requires a pool of IP addresses in order to be able to take ownership of the <code class="codehilite"><span class="err">ingress-nginx</span></code> Service. This pool
can be defined in a ConfigMap named <code class="codehilite">config</code> located in the same namespace as the MetalLB controller. This pool of IPs <strong>must</strong> be dedicated to MetalLB's use, you can't reuse the Kubernetes node IPs or IPs handed out by a DHCP server.</p> can be defined in a ConfigMap named <code class="codehilite"><span class="err">config</span></code> located in the same namespace as the MetalLB controller. This pool of IPs <strong>must</strong> be dedicated to MetalLB's use, you can't reuse the Kubernetes node IPs or IPs handed out by a DHCP server.</p>
<div class="admonition example"> <div class="admonition example">
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<p>Given the following 3-node Kubernetes cluster (the external IP is added as an example, in most bare-metal <p>Given the following 3-node Kubernetes cluster (the external IP is added as an example, in most bare-metal
environments this value is &lt;None>)</p> environments this value is &lt;None>)</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get node <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get node
<span class="go">NAME STATUS ROLES EXTERNAL-IP</span> <span class="go">NAME STATUS ROLES EXTERNAL-IP</span>
<span class="go">host-1 Ready master 203.0.113.1</span> <span class="go">host-1 Ready master 203.0.113.1</span>
<span class="go">host-2 Ready node 203.0.113.2</span> <span class="go">host-2 Ready node 203.0.113.2</span>
<span class="go">host-3 Ready node 203.0.113.3</span> <span class="go">host-3 Ready node 203.0.113.3</span>
</pre></div> </code></pre></div>
<p>After creating the following ConfigMap, MetalLB takes ownership of one of the IP addresses in the pool and updates <p>After creating the following ConfigMap, MetalLB takes ownership of one of the IP addresses in the pool and updates
the <em>loadBalancer</em> IP field of the <code class="codehilite">ingress-nginx</code> Service accordingly.</p> the <em>loadBalancer</em> IP field of the <code class="codehilite"><span class="err">ingress-nginx</span></code> Service accordingly.</p>
<div class="codehilite"><pre><span></span><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span> <div class="codehilite"><pre><span></span><code><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span>
<span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ConfigMap</span> <span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ConfigMap</span>
<span class="nt">metadata</span><span class="p">:</span> <span class="nt">metadata</span><span class="p">:</span>
<span class="nt">namespace</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">metallb-system</span> <span class="nt">namespace</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">metallb-system</span>
@ -1303,26 +1303,26 @@ the <em>loadBalancer</em> IP field of the <code class="codehilite">ingress-nginx
<span class="no">protocol: layer2</span> <span class="no">protocol: layer2</span>
<span class="no">addresses:</span> <span class="no">addresses:</span>
<span class="no">- 203.0.113.10-203.0.113.15</span> <span class="no">- 203.0.113.10-203.0.113.15</span>
</pre></div> </code></pre></div>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl -n ingress-nginx get svc <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl -n ingress-nginx get svc
<span class="go">NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)</span> <span class="go">NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)</span>
<span class="go">default-http-backend ClusterIP 10.0.64.249 &lt;none&gt; 80/TCP</span> <span class="go">default-http-backend ClusterIP 10.0.64.249 &lt;none&gt; 80/TCP</span>
<span class="go">ingress-nginx LoadBalancer 10.0.220.217 203.0.113.10 80:30100/TCP,443:30101/TCP</span> <span class="go">ingress-nginx LoadBalancer 10.0.220.217 203.0.113.10 80:30100/TCP,443:30101/TCP</span>
</pre></div> </code></pre></div>
</div> </div>
<p>As soon as MetalLB sets the external IP address of the <code class="codehilite">ingress-nginx</code> LoadBalancer Service, the corresponding entries <p>As soon as MetalLB sets the external IP address of the <code class="codehilite"><span class="err">ingress-nginx</span></code> LoadBalancer Service, the corresponding entries
are created in the iptables NAT table and the node with the selected IP address starts responding to HTTP requests on are created in the iptables NAT table and the node with the selected IP address starts responding to HTTP requests on
the ports configured in the LoadBalancer Service:</p> the ports configured in the LoadBalancer Service:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> curl -D- http://203.0.113.3 -H <span class="s1">&#39;Host: myapp.example.com&#39;</span> <div class="codehilite"><pre><span></span><code><span class="gp">$</span> curl -D- http://203.0.113.3 -H <span class="s1">&#39;Host: myapp.example.com&#39;</span>
<span class="go">HTTP/1.1 200 OK</span> <span class="go">HTTP/1.1 200 OK</span>
<span class="go">Server: nginx/1.15.2</span> <span class="go">Server: nginx/1.15.2</span>
</pre></div> </code></pre></div>
<div class="admonition tip"> <div class="admonition tip">
<p class="admonition-title">Tip</p> <p class="admonition-title">Tip</p>
<p>In order to preserve the source IP address in HTTP requests sent to NGINX, it is necessary to use the <code class="codehilite">Local</code> <p>In order to preserve the source IP address in HTTP requests sent to NGINX, it is necessary to use the <code class="codehilite"><span class="err">Local</span></code>
traffic policy. Traffic policies are described in more details in <a href="https://metallb.universe.tf/usage/#traffic-policies">Traffic policies</a> as traffic policy. Traffic policies are described in more details in <a href="https://metallb.universe.tf/usage/#traffic-policies">Traffic policies</a> as
well as in the next section.</p> well as in the next section.</p>
</div> </div>
@ -1331,42 +1331,42 @@ well as in the next section.</p>
<a href="../#bare-metal">installation guide</a>.</p> <a href="../#bare-metal">installation guide</a>.</p>
<div class="admonition info"> <div class="admonition info">
<p class="admonition-title">Info</p> <p class="admonition-title">Info</p>
<p>A Service of type <code class="codehilite">NodePort</code> exposes, via the <code class="codehilite">kube-proxy</code> component, the <strong>same unprivileged</strong> port (default: <p>A Service of type <code class="codehilite"><span class="err">NodePort</span></code> exposes, via the <code class="codehilite"><span class="err">kube-proxy</span></code> component, the <strong>same unprivileged</strong> port (default:
30000-32767) on every Kubernetes node, masters included. For more information, see <a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport">Services</a>.</p> 30000-32767) on every Kubernetes node, masters included. For more information, see <a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport">Services</a>.</p>
</div> </div>
<p>In this configuration, the NGINX container remains isolated from the host network. As a result, it can safely bind to <p>In this configuration, the NGINX container remains isolated from the host network. As a result, it can safely bind to
any port, including the standard HTTP ports 80 and 443. However, due to the container namespace isolation, a client any port, including the standard HTTP ports 80 and 443. However, due to the container namespace isolation, a client
located outside the cluster network (e.g. on the public internet) is not able to access Ingress hosts directly on ports located outside the cluster network (e.g. on the public internet) is not able to access Ingress hosts directly on ports
80 and 443. Instead, the external client must append the NodePort allocated to the <code class="codehilite">ingress-nginx</code> Service to HTTP 80 and 443. Instead, the external client must append the NodePort allocated to the <code class="codehilite"><span class="err">ingress-nginx</span></code> Service to HTTP
requests.</p> requests.</p>
<p><img alt="NodePort request flow" src="../../images/baremetal/nodeport.jpg" /></p> <p><img alt="NodePort request flow" src="../../images/baremetal/nodeport.jpg" /></p>
<div class="admonition example"> <div class="admonition example">
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<p>Given the NodePort <code class="codehilite">30100</code> allocated to the <code class="codehilite">ingress-nginx</code> Service</p> <p>Given the NodePort <code class="codehilite"><span class="err">30100</span></code> allocated to the <code class="codehilite"><span class="err">ingress-nginx</span></code> Service</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl -n ingress-nginx get svc <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl -n ingress-nginx get svc
<span class="go">NAME TYPE CLUSTER-IP PORT(S)</span> <span class="go">NAME TYPE CLUSTER-IP PORT(S)</span>
<span class="go">default-http-backend ClusterIP 10.0.64.249 80/TCP</span> <span class="go">default-http-backend ClusterIP 10.0.64.249 80/TCP</span>
<span class="go">ingress-nginx NodePort 10.0.220.217 80:30100/TCP,443:30101/TCP</span> <span class="go">ingress-nginx NodePort 10.0.220.217 80:30100/TCP,443:30101/TCP</span>
</pre></div> </code></pre></div>
<p>and a Kubernetes node with the public IP address <code class="codehilite">203.0.113.2</code> (the external IP is added as an example, in most <p>and a Kubernetes node with the public IP address <code class="codehilite"><span class="err">203.0.113.2</span></code> (the external IP is added as an example, in most
bare-metal environments this value is &lt;None>)</p> bare-metal environments this value is &lt;None>)</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get node <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get node
<span class="go">NAME STATUS ROLES EXTERNAL-IP</span> <span class="go">NAME STATUS ROLES EXTERNAL-IP</span>
<span class="go">host-1 Ready master 203.0.113.1</span> <span class="go">host-1 Ready master 203.0.113.1</span>
<span class="go">host-2 Ready node 203.0.113.2</span> <span class="go">host-2 Ready node 203.0.113.2</span>
<span class="go">host-3 Ready node 203.0.113.3</span> <span class="go">host-3 Ready node 203.0.113.3</span>
</pre></div> </code></pre></div>
<p>a client would reach an Ingress with <code class="codehilite"><span class="n">host</span><span class="o">:</span> <span class="n">myapp</span><span class="o">.</span><span class="na">example</span><span class="o">.</span><span class="na">com</span></code> at <code class="codehilite">http://myapp.example.com:30100</code>, where the <p>a client would reach an Ingress with <code class="codehilite"><span class="n">host</span><span class="o">:</span> <span class="n">myapp</span><span class="o">.</span><span class="na">example</span><span class="o">.</span><span class="na">com</span></code> at <code class="codehilite"><span class="c">http://myapp.example.com:30100</span></code>, where the
myapp.example.com subdomain resolves to the 203.0.113.2 IP address.</p> myapp.example.com subdomain resolves to the 203.0.113.2 IP address.</p>
</div> </div>
<div class="admonition danger"> <div class="admonition danger">
<p class="admonition-title">Impact on the host system</p> <p class="admonition-title">Impact on the host system</p>
<p>While it may sound tempting to reconfigure the NodePort range using the <code class="codehilite">--service-node-port-range</code> API server flag <p>While it may sound tempting to reconfigure the NodePort range using the <code class="codehilite"><span class="err">--service-node-port-range</span></code> API server flag
to include unprivileged ports and be able to expose ports 80 and 443, doing so may result in unexpected issues to include unprivileged ports and be able to expose ports 80 and 443, doing so may result in unexpected issues
including (but not limited to) the use of ports otherwise reserved to system daemons and the necessity to grant including (but not limited to) the use of ports otherwise reserved to system daemons and the necessity to grant
<code class="codehilite">kube-proxy</code> privileges it may otherwise not require.</p> <code class="codehilite"><span class="err">kube-proxy</span></code> privileges it may otherwise not require.</p>
<p>This practice is therefore <strong>discouraged</strong>. See the other approaches proposed in this page for alternatives.</p> <p>This practice is therefore <strong>discouraged</strong>. See the other approaches proposed in this page for alternatives.</p>
</div> </div>
<p>This approach has a few other limitations one ought to be aware of:</p> <p>This approach has a few other limitations one ought to be aware of:</p>
@ -1376,8 +1376,8 @@ including (but not limited to) the use of ports otherwise reserved to system dae
<p>Services of type NodePort perform <a href="https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-type-nodeport">source address translation</a> by default. This means the source IP of a <p>Services of type NodePort perform <a href="https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-type-nodeport">source address translation</a> by default. This means the source IP of a
HTTP request is always <strong>the IP address of the Kubernetes node that received the request</strong> from the perspective of HTTP request is always <strong>the IP address of the Kubernetes node that received the request</strong> from the perspective of
NGINX.</p> NGINX.</p>
<p>The recommended way to preserve the source IP in a NodePort setup is to set the value of the <code class="codehilite">externalTrafficPolicy</code> <p>The recommended way to preserve the source IP in a NodePort setup is to set the value of the <code class="codehilite"><span class="err">externalTrafficPolicy</span></code>
field of the <code class="codehilite">ingress-nginx</code> Service spec to <code class="codehilite">Local</code> (<a href="https://github.com/kubernetes/ingress-nginx/blob/nginx-0.19.0/deploy/provider/aws/service-nlb.yaml#L12-L14">example</a>).</p> field of the <code class="codehilite"><span class="err">ingress-nginx</span></code> Service spec to <code class="codehilite"><span class="err">Local</span></code> (<a href="https://github.com/kubernetes/ingress-nginx/blob/nginx-0.19.0/deploy/provider/aws/service-nlb.yaml#L12-L14">example</a>).</p>
<div class="admonition warning"> <div class="admonition warning">
<p class="admonition-title">Warning</p> <p class="admonition-title">Warning</p>
<p>This setting effectively <strong>drops packets</strong> sent to Kubernetes nodes which are not running any instance of the NGINX <p>This setting effectively <strong>drops packets</strong> sent to Kubernetes nodes which are not running any instance of the NGINX
@ -1388,40 +1388,40 @@ the NGINX Ingress controller should be scheduled or not scheduled.</p>
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<p>In a Kubernetes cluster composed of 3 nodes (the external IP is added as an example, in most bare-metal environments <p>In a Kubernetes cluster composed of 3 nodes (the external IP is added as an example, in most bare-metal environments
this value is &lt;None>)</p> this value is &lt;None>)</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get node <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get node
<span class="go">NAME STATUS ROLES EXTERNAL-IP</span> <span class="go">NAME STATUS ROLES EXTERNAL-IP</span>
<span class="go">host-1 Ready master 203.0.113.1</span> <span class="go">host-1 Ready master 203.0.113.1</span>
<span class="go">host-2 Ready node 203.0.113.2</span> <span class="go">host-2 Ready node 203.0.113.2</span>
<span class="go">host-3 Ready node 203.0.113.3</span> <span class="go">host-3 Ready node 203.0.113.3</span>
</pre></div> </code></pre></div>
<p>with a <code class="codehilite">nginx-ingress-controller</code> Deployment composed of 2 replicas</p> <p>with a <code class="codehilite"><span class="err">nginx-ingress-controller</span></code> Deployment composed of 2 replicas</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl -n ingress-nginx get pod -o wide <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl -n ingress-nginx get pod -o wide
<span class="go">NAME READY STATUS IP NODE</span> <span class="go">NAME READY STATUS IP NODE</span>
<span class="go">default-http-backend-7c5bc89cc9-p86md 1/1 Running 172.17.1.1 host-2</span> <span class="go">default-http-backend-7c5bc89cc9-p86md 1/1 Running 172.17.1.1 host-2</span>
<span class="go">nginx-ingress-controller-cf9ff8c96-8vvf8 1/1 Running 172.17.0.3 host-3</span> <span class="go">nginx-ingress-controller-cf9ff8c96-8vvf8 1/1 Running 172.17.0.3 host-3</span>
<span class="go">nginx-ingress-controller-cf9ff8c96-pxsds 1/1 Running 172.17.1.4 host-2</span> <span class="go">nginx-ingress-controller-cf9ff8c96-pxsds 1/1 Running 172.17.1.4 host-2</span>
</pre></div> </code></pre></div>
<p>Requests sent to <code class="codehilite">host-2</code> and <code class="codehilite">host-3</code> would be forwarded to NGINX and original client's IP would be preserved, <p>Requests sent to <code class="codehilite"><span class="err">host-2</span></code> and <code class="codehilite"><span class="err">host-3</span></code> would be forwarded to NGINX and original client's IP would be preserved,
while requests to <code class="codehilite">host-1</code> would get dropped because there is no NGINX replica running on that node.</p> while requests to <code class="codehilite"><span class="err">host-1</span></code> would get dropped because there is no NGINX replica running on that node.</p>
</div> </div>
<ul> <ul>
<li><strong>Ingress status</strong></li> <li><strong>Ingress status</strong></li>
</ul> </ul>
<p>Because NodePort Services do not get a LoadBalancerIP assigned by definition, the NGINX Ingress controller <strong>does not <p>Because NodePort Services do not get a LoadBalancerIP assigned by definition, the NGINX Ingress controller <strong>does not
update the status of Ingress objects it manages</strong>.</p> update the status of Ingress objects it manages</strong>.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get ingress <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get ingress
<span class="go">NAME HOSTS ADDRESS PORTS</span> <span class="go">NAME HOSTS ADDRESS PORTS</span>
<span class="go">test-ingress myapp.example.com 80</span> <span class="go">test-ingress myapp.example.com 80</span>
</pre></div> </code></pre></div>
<p>Despite the fact there is no load balancer providing a public IP address to the NGINX Ingress controller, it is possible <p>Despite the fact there is no load balancer providing a public IP address to the NGINX Ingress controller, it is possible
to force the status update of all managed Ingress objects by setting the <code class="codehilite">externalIPs</code> field of the <code class="codehilite">ingress-nginx</code> to force the status update of all managed Ingress objects by setting the <code class="codehilite"><span class="err">externalIPs</span></code> field of the <code class="codehilite"><span class="err">ingress-nginx</span></code>
Service.</p> Service.</p>
<div class="admonition warning"> <div class="admonition warning">
<p class="admonition-title">Warning</p> <p class="admonition-title">Warning</p>
<p>There is more to setting <code class="codehilite">externalIPs</code> than just enabling the NGINX Ingress controller to update the status of <p>There is more to setting <code class="codehilite"><span class="err">externalIPs</span></code> than just enabling the NGINX Ingress controller to update the status of
Ingress objects. Please read about this option in the <a href="https://kubernetes.io/docs/concepts/services-networking/service/#external-ips">Services</a> page of official Kubernetes Ingress objects. Please read about this option in the <a href="https://kubernetes.io/docs/concepts/services-networking/service/#external-ips">Services</a> page of official Kubernetes
documentation as well as the section about <a href="#external-ips">External IPs</a> in this document for more information.</p> documentation as well as the section about <a href="#external-ips">External IPs</a> in this document for more information.</p>
</div> </div>
@ -1429,26 +1429,26 @@ documentation as well as the section about <a href="#external-ips">External IPs<
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<p>Given the following 3-node Kubernetes cluster (the external IP is added as an example, in most bare-metal <p>Given the following 3-node Kubernetes cluster (the external IP is added as an example, in most bare-metal
environments this value is &lt;None>)</p> environments this value is &lt;None>)</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get node <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get node
<span class="go">NAME STATUS ROLES EXTERNAL-IP</span> <span class="go">NAME STATUS ROLES EXTERNAL-IP</span>
<span class="go">host-1 Ready master 203.0.113.1</span> <span class="go">host-1 Ready master 203.0.113.1</span>
<span class="go">host-2 Ready node 203.0.113.2</span> <span class="go">host-2 Ready node 203.0.113.2</span>
<span class="go">host-3 Ready node 203.0.113.3</span> <span class="go">host-3 Ready node 203.0.113.3</span>
</pre></div> </code></pre></div>
<p>one could edit the <code class="codehilite">ingress-nginx</code> Service and add the following field to the object spec</p> <p>one could edit the <code class="codehilite"><span class="err">ingress-nginx</span></code> Service and add the following field to the object spec</p>
<div class="codehilite"><pre><span></span><span class="nt">spec</span><span class="p">:</span> <div class="codehilite"><pre><span></span><code><span class="nt">spec</span><span class="p">:</span>
<span class="nt">externalIPs</span><span class="p">:</span> <span class="nt">externalIPs</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">203.0.113.1</span> <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">203.0.113.1</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">203.0.113.2</span> <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">203.0.113.2</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">203.0.113.3</span> <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">203.0.113.3</span>
</pre></div> </code></pre></div>
<p>which would in turn be reflected on Ingress objects as follows:</p> <p>which would in turn be reflected on Ingress objects as follows:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get ingress -o wide <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get ingress -o wide
<span class="go">NAME HOSTS ADDRESS PORTS</span> <span class="go">NAME HOSTS ADDRESS PORTS</span>
<span class="go">test-ingress myapp.example.com 203.0.113.1,203.0.113.2,203.0.113.3 80</span> <span class="go">test-ingress myapp.example.com 203.0.113.1,203.0.113.2,203.0.113.3 80</span>
</pre></div> </code></pre></div>
</div> </div>
<ul> <ul>
@ -1458,30 +1458,30 @@ environments this value is &lt;None>)</p>
for generating redirect URLs that take into account the URL used by external clients, including the NodePort.</p> for generating redirect URLs that take into account the URL used by external clients, including the NodePort.</p>
<div class="admonition example"> <div class="admonition example">
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<p>Redirects generated by NGINX, for instance HTTP to HTTPS or <code class="codehilite">domain</code> to <code class="codehilite">www.domain</code>, are generated without <p>Redirects generated by NGINX, for instance HTTP to HTTPS or <code class="codehilite"><span class="err">domain</span></code> to <code class="codehilite"><span class="err">www.domain</span></code>, are generated without
NodePort:</p> NodePort:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> curl -D- http://myapp.example.com:30100<span class="sb">`</span> <div class="codehilite"><pre><span></span><code><span class="gp">$</span> curl -D- http://myapp.example.com:30100<span class="sb">`</span>
<span class="go">HTTP/1.1 308 Permanent Redirect</span> <span class="go">HTTP/1.1 308 Permanent Redirect</span>
<span class="go">Server: nginx/1.15.2</span> <span class="go">Server: nginx/1.15.2</span>
<span class="go">Location: https://myapp.example.com/ #-&gt; missing NodePort in HTTPS redirect</span> <span class="go">Location: https://myapp.example.com/ #-&gt; missing NodePort in HTTPS redirect</span>
</pre></div> </code></pre></div>
</div> </div>
<h2 id="via-the-host-network">Via the host network<a class="headerlink" href="#via-the-host-network" title="Permanent link"></a></h2> <h2 id="via-the-host-network">Via the host network<a class="headerlink" href="#via-the-host-network" title="Permanent link"></a></h2>
<p>In a setup where there is no external load balancer available but using NodePorts is not an option, one can configure <p>In a setup where there is no external load balancer available but using NodePorts is not an option, one can configure
<code class="codehilite">ingress-nginx</code> Pods to use the network of the host they run on instead of a dedicated network namespace. The benefit of <code class="codehilite"><span class="err">ingress-nginx</span></code> Pods to use the network of the host they run on instead of a dedicated network namespace. The benefit of
this approach is that the NGINX Ingress controller can bind ports 80 and 443 directly to Kubernetes nodes' network this approach is that the NGINX Ingress controller can bind ports 80 and 443 directly to Kubernetes nodes' network
interfaces, without the extra network translation imposed by NodePort Services.</p> interfaces, without the extra network translation imposed by NodePort Services.</p>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
<p>This approach does not leverage any Service object to expose the NGINX Ingress controller. If the <code class="codehilite">ingress-nginx</code> <p>This approach does not leverage any Service object to expose the NGINX Ingress controller. If the <code class="codehilite"><span class="err">ingress-nginx</span></code>
Service exists in the target cluster, it is <strong>recommended to delete it</strong>.</p> Service exists in the target cluster, it is <strong>recommended to delete it</strong>.</p>
</div> </div>
<p>This can be achieved by enabling the <code class="codehilite">hostNetwork</code> option in the Pods' spec.</p> <p>This can be achieved by enabling the <code class="codehilite"><span class="err">hostNetwork</span></code> option in the Pods' spec.</p>
<div class="codehilite"><pre><span></span><span class="nt">template</span><span class="p">:</span> <div class="codehilite"><pre><span></span><code><span class="nt">template</span><span class="p">:</span>
<span class="nt">spec</span><span class="p">:</span> <span class="nt">spec</span><span class="p">:</span>
<span class="nt">hostNetwork</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">true</span> <span class="nt">hostNetwork</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">true</span>
</pre></div> </code></pre></div>
<div class="admonition danger"> <div class="admonition danger">
<p class="admonition-title">Security considerations</p> <p class="admonition-title">Security considerations</p>
@ -1490,26 +1490,26 @@ including the host's loopback. Please evaluate the impact this may have on the s
</div> </div>
<div class="admonition example"> <div class="admonition example">
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<p>Consider this <code class="codehilite">nginx-ingress-controller</code> Deployment composed of 2 replicas, NGINX Pods inherit from the IP address <p>Consider this <code class="codehilite"><span class="err">nginx-ingress-controller</span></code> Deployment composed of 2 replicas, NGINX Pods inherit from the IP address
of their host instead of an internal Pod IP.</p> of their host instead of an internal Pod IP.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl -n ingress-nginx get pod -o wide <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl -n ingress-nginx get pod -o wide
<span class="go">NAME READY STATUS IP NODE</span> <span class="go">NAME READY STATUS IP NODE</span>
<span class="go">default-http-backend-7c5bc89cc9-p86md 1/1 Running 172.17.1.1 host-2</span> <span class="go">default-http-backend-7c5bc89cc9-p86md 1/1 Running 172.17.1.1 host-2</span>
<span class="go">nginx-ingress-controller-5b4cf5fc6-7lg6c 1/1 Running 203.0.113.3 host-3</span> <span class="go">nginx-ingress-controller-5b4cf5fc6-7lg6c 1/1 Running 203.0.113.3 host-3</span>
<span class="go">nginx-ingress-controller-5b4cf5fc6-lzrls 1/1 Running 203.0.113.2 host-2</span> <span class="go">nginx-ingress-controller-5b4cf5fc6-lzrls 1/1 Running 203.0.113.2 host-2</span>
</pre></div> </code></pre></div>
</div> </div>
<p>One major limitation of this deployment approach is that only <strong>a single NGINX Ingress controller Pod</strong> may be scheduled <p>One major limitation of this deployment approach is that only <strong>a single NGINX Ingress controller Pod</strong> may be scheduled
on each cluster node, because binding the same port multiple times on the same network interface is technically on each cluster node, because binding the same port multiple times on the same network interface is technically
impossible. Pods that are unschedulable due to such situation fail with the following event:</p> impossible. Pods that are unschedulable due to such situation fail with the following event:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl -n ingress-nginx describe pod &lt;unschedulable-nginx-ingress-controller-pod&gt; <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl -n ingress-nginx describe pod &lt;unschedulable-nginx-ingress-controller-pod&gt;
<span class="go">...</span> <span class="go">...</span>
<span class="go">Events:</span> <span class="go">Events:</span>
<span class="go"> Type Reason From Message</span> <span class="go"> Type Reason From Message</span>
<span class="go"> ---- ------ ---- -------</span> <span class="go"> ---- ------ ---- -------</span>
<span class="go"> Warning FailedScheduling default-scheduler 0/3 nodes are available: 3 node(s) didn&#39;t have free ports for the requested pod ports.</span> <span class="go"> Warning FailedScheduling default-scheduler 0/3 nodes are available: 3 node(s) didn&#39;t have free ports for the requested pod ports.</span>
</pre></div> </code></pre></div>
<p>One way to ensure only schedulable Pods are created is to deploy the NGINX Ingress controller as a <em>DaemonSet</em> instead <p>One way to ensure only schedulable Pods are created is to deploy the NGINX Ingress controller as a <em>DaemonSet</em> instead
of a traditional Deployment.</p> of a traditional Deployment.</p>
@ -1526,43 +1526,43 @@ configuration of the corresponding manifest at the user's discretion.</p>
<li><strong>DNS resolution</strong></li> <li><strong>DNS resolution</strong></li>
</ul> </ul>
<p>Pods configured with <code class="codehilite"><span class="n">hostNetwork</span><span class="o">:</span> <span class="kc">true</span></code> do not use the internal DNS resolver (i.e. <em>kube-dns</em> or <em>CoreDNS</em>), unless <p>Pods configured with <code class="codehilite"><span class="n">hostNetwork</span><span class="o">:</span> <span class="kc">true</span></code> do not use the internal DNS resolver (i.e. <em>kube-dns</em> or <em>CoreDNS</em>), unless
their <code class="codehilite">dnsPolicy</code> spec field is set to <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy"><code class="codehilite">ClusterFirstWithHostNet</code></a>. Consider using this setting if NGINX is their <code class="codehilite"><span class="err">dnsPolicy</span></code> spec field is set to <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy"><code class="codehilite"><span class="err">ClusterFirstWithHostNet</span></code></a>. Consider using this setting if NGINX is
expected to resolve internal names for any reason.</p> expected to resolve internal names for any reason.</p>
<ul> <ul>
<li><strong>Ingress status</strong></li> <li><strong>Ingress status</strong></li>
</ul> </ul>
<p>Because there is no Service exposing the NGINX Ingress controller in a configuration using the host network, the default <p>Because there is no Service exposing the NGINX Ingress controller in a configuration using the host network, the default
<code class="codehilite">--publish-service</code> flag used in standard cloud setups <strong>does not apply</strong> and the status of all Ingress objects remains <code class="codehilite"><span class="err">--publish-service</span></code> flag used in standard cloud setups <strong>does not apply</strong> and the status of all Ingress objects remains
blank.</p> blank.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get ingress <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get ingress
<span class="go">NAME HOSTS ADDRESS PORTS</span> <span class="go">NAME HOSTS ADDRESS PORTS</span>
<span class="go">test-ingress myapp.example.com 80</span> <span class="go">test-ingress myapp.example.com 80</span>
</pre></div> </code></pre></div>
<p>Instead, and because bare-metal nodes usually don't have an ExternalIP, one has to enable the <p>Instead, and because bare-metal nodes usually don't have an ExternalIP, one has to enable the
<a href="../../user-guide/cli-arguments/"><code class="codehilite">--report-node-internal-ip-address</code></a> flag, which sets the status of all Ingress objects to the internal IP <a href="../../user-guide/cli-arguments/"><code class="codehilite"><span class="err">--report-node-internal-ip-address</span></code></a> flag, which sets the status of all Ingress objects to the internal IP
address of all nodes running the NGINX Ingress controller.</p> address of all nodes running the NGINX Ingress controller.</p>
<div class="admonition example"> <div class="admonition example">
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<p>Given a <code class="codehilite">nginx-ingress-controller</code> DaemonSet composed of 2 replicas</p> <p>Given a <code class="codehilite"><span class="err">nginx-ingress-controller</span></code> DaemonSet composed of 2 replicas</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl -n ingress-nginx get pod -o wide <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl -n ingress-nginx get pod -o wide
<span class="go">NAME READY STATUS IP NODE</span> <span class="go">NAME READY STATUS IP NODE</span>
<span class="go">default-http-backend-7c5bc89cc9-p86md 1/1 Running 172.17.1.1 host-2</span> <span class="go">default-http-backend-7c5bc89cc9-p86md 1/1 Running 172.17.1.1 host-2</span>
<span class="go">nginx-ingress-controller-5b4cf5fc6-7lg6c 1/1 Running 203.0.113.3 host-3</span> <span class="go">nginx-ingress-controller-5b4cf5fc6-7lg6c 1/1 Running 203.0.113.3 host-3</span>
<span class="go">nginx-ingress-controller-5b4cf5fc6-lzrls 1/1 Running 203.0.113.2 host-2</span> <span class="go">nginx-ingress-controller-5b4cf5fc6-lzrls 1/1 Running 203.0.113.2 host-2</span>
</pre></div> </code></pre></div>
<p>the controller sets the status of all Ingress objects it manages to the following value:</p> <p>the controller sets the status of all Ingress objects it manages to the following value:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get ingress -o wide <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get ingress -o wide
<span class="go">NAME HOSTS ADDRESS PORTS</span> <span class="go">NAME HOSTS ADDRESS PORTS</span>
<span class="go">test-ingress myapp.example.com 203.0.113.2,203.0.113.3 80</span> <span class="go">test-ingress myapp.example.com 203.0.113.2,203.0.113.3 80</span>
</pre></div> </code></pre></div>
</div> </div>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
<p>Alternatively, it is possible to override the address written to Ingress objects using the <p>Alternatively, it is possible to override the address written to Ingress objects using the
<code class="codehilite">--publish-status-address</code> flag. See <a href="../../user-guide/cli-arguments/">Command line arguments</a>.</p> <code class="codehilite"><span class="err">--publish-status-address</span></code> flag. See <a href="../../user-guide/cli-arguments/">Command line arguments</a>.</p>
</div> </div>
<h2 id="using-a-self-provisioned-edge">Using a self-provisioned edge<a class="headerlink" href="#using-a-self-provisioned-edge" title="Permanent link"></a></h2> <h2 id="using-a-self-provisioned-edge">Using a self-provisioned edge<a class="headerlink" href="#using-a-self-provisioned-edge" title="Permanent link"></a></h2>
<p>Similarly to cloud environments, this deployment approach requires an edge network component providing a public <p>Similarly to cloud environments, this deployment approach requires an edge network component providing a public
@ -1581,43 +1581,43 @@ on the target nodes as shown in the diagram below:</p>
<p>This method does not allow preserving the source IP of HTTP requests in any manner, it is therefore <strong>not <p>This method does not allow preserving the source IP of HTTP requests in any manner, it is therefore <strong>not
recommended</strong> to use it despite its apparent simplicity.</p> recommended</strong> to use it despite its apparent simplicity.</p>
</div> </div>
<p>The <code class="codehilite">externalIPs</code> Service option was previously mentioned in the <a href="#over-a-nodeport-service">NodePort</a> section.</p> <p>The <code class="codehilite"><span class="err">externalIPs</span></code> Service option was previously mentioned in the <a href="#over-a-nodeport-service">NodePort</a> section.</p>
<p>As per the <a href="https://kubernetes.io/docs/concepts/services-networking/service/#external-ips">Services</a> page of the official Kubernetes documentation, the <code class="codehilite">externalIPs</code> option causes <p>As per the <a href="https://kubernetes.io/docs/concepts/services-networking/service/#external-ips">Services</a> page of the official Kubernetes documentation, the <code class="codehilite"><span class="err">externalIPs</span></code> option causes
<code class="codehilite">kube-proxy</code> to route traffic sent to arbitrary IP addresses <strong>and on the Service ports</strong> to the endpoints of that <code class="codehilite"><span class="err">kube-proxy</span></code> to route traffic sent to arbitrary IP addresses <strong>and on the Service ports</strong> to the endpoints of that
Service. These IP addresses <strong>must belong to the target node</strong>.</p> Service. These IP addresses <strong>must belong to the target node</strong>.</p>
<div class="admonition example"> <div class="admonition example">
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<p>Given the following 3-node Kubernetes cluster (the external IP is added as an example, in most bare-metal <p>Given the following 3-node Kubernetes cluster (the external IP is added as an example, in most bare-metal
environments this value is &lt;None>)</p> environments this value is &lt;None>)</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get node <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get node
<span class="go">NAME STATUS ROLES EXTERNAL-IP</span> <span class="go">NAME STATUS ROLES EXTERNAL-IP</span>
<span class="go">host-1 Ready master 203.0.113.1</span> <span class="go">host-1 Ready master 203.0.113.1</span>
<span class="go">host-2 Ready node 203.0.113.2</span> <span class="go">host-2 Ready node 203.0.113.2</span>
<span class="go">host-3 Ready node 203.0.113.3</span> <span class="go">host-3 Ready node 203.0.113.3</span>
</pre></div> </code></pre></div>
<p>and the following <code class="codehilite">ingress-nginx</code> NodePort Service</p> <p>and the following <code class="codehilite"><span class="err">ingress-nginx</span></code> NodePort Service</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl -n ingress-nginx get svc <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl -n ingress-nginx get svc
<span class="go">NAME TYPE CLUSTER-IP PORT(S)</span> <span class="go">NAME TYPE CLUSTER-IP PORT(S)</span>
<span class="go">ingress-nginx NodePort 10.0.220.217 80:30100/TCP,443:30101/TCP</span> <span class="go">ingress-nginx NodePort 10.0.220.217 80:30100/TCP,443:30101/TCP</span>
</pre></div> </code></pre></div>
<p>One could set the following external IPs in the Service spec, and NGINX would become available on both the NodePort <p>One could set the following external IPs in the Service spec, and NGINX would become available on both the NodePort
and the Service port:</p> and the Service port:</p>
<div class="codehilite"><pre><span></span><span class="nt">spec</span><span class="p">:</span> <div class="codehilite"><pre><span></span><code><span class="nt">spec</span><span class="p">:</span>
<span class="nt">externalIPs</span><span class="p">:</span> <span class="nt">externalIPs</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">203.0.113.2</span> <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">203.0.113.2</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">203.0.113.3</span> <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">203.0.113.3</span>
</pre></div> </code></pre></div>
<div class="codehilite"><pre><span></span><span class="gp">$</span> curl -D- http://myapp.example.com:30100 <div class="codehilite"><pre><span></span><code><span class="gp">$</span> curl -D- http://myapp.example.com:30100
<span class="go">HTTP/1.1 200 OK</span> <span class="go">HTTP/1.1 200 OK</span>
<span class="go">Server: nginx/1.15.2</span> <span class="go">Server: nginx/1.15.2</span>
<span class="gp">$</span> curl -D- http://myapp.example.com <span class="gp">$</span> curl -D- http://myapp.example.com
<span class="go">HTTP/1.1 200 OK</span> <span class="go">HTTP/1.1 200 OK</span>
<span class="go">Server: nginx/1.15.2</span> <span class="go">Server: nginx/1.15.2</span>
</pre></div> </code></pre></div>
<p>We assume the myapp.example.com subdomain above resolves to both 203.0.113.2 and 203.0.113.3 IP addresses.</p> <p>We assume the myapp.example.com subdomain above resolves to both 203.0.113.2 and 203.0.113.3 IP addresses.</p>
</div> </div>
@ -1630,6 +1630,7 @@ and the Service port:</p>
</article> </article>
</div> </div>
</div> </div>
@ -1678,9 +1679,9 @@ and the Service port:</p>
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1690,7 +1691,7 @@ and the Service port:</p>
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../assets/images/favicon.png"> <link rel="shortcut icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../assets/javascripts/modernizr.74668098.js"></script> <script src="../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#installation-guide" tabindex="1" class="md-skip"> <a href="#installation-guide" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1446,7 +1446,7 @@
<div class="admonition attention"> <div class="admonition attention">
<p class="admonition-title">Attention</p> <p class="admonition-title">Attention</p>
<p>The default configuration watches Ingress object from <em>all the namespaces</em>. <p>The default configuration watches Ingress object from <em>all the namespaces</em>.
To change this behavior use the flag <code class="codehilite">--watch-namespace</code> to limit the scope to a particular namespace.</p> To change this behavior use the flag <code class="codehilite"><span class="err">--watch-namespace</span></code> to limit the scope to a particular namespace.</p>
</div> </div>
<div class="admonition warning"> <div class="admonition warning">
<p class="admonition-title">Warning</p> <p class="admonition-title">Warning</p>
@ -1455,51 +1455,51 @@ To change this behavior use the flag <code class="codehilite">--watch-namespace<
<div class="admonition attention"> <div class="admonition attention">
<p class="admonition-title">Attention</p> <p class="admonition-title">Attention</p>
<p>If you're using GKE you need to initialize your user as a cluster-admin with the following command: <p>If you're using GKE you need to initialize your user as a cluster-admin with the following command:
<div class="codehilite"><pre><span></span><span class="go">kubectl create clusterrolebinding cluster-admin-binding \</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl create clusterrolebinding cluster-admin-binding \</span>
<span class="go"> --clusterrole cluster-admin \</span> <span class="go"> --clusterrole cluster-admin \</span>
<span class="go"> --user $(gcloud config get-value account)</span> <span class="go"> --user $(gcloud config get-value account)</span>
</pre></div></p> </code></pre></div></p>
</div> </div>
<p>The following <strong>Mandatory Command</strong> is required for all deployments.</p> <p>The following <strong>Mandatory Command</strong> is required for all deployments.</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/mandatory.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/mandatory.yaml</span>
</pre></div> </code></pre></div>
<div class="admonition tip"> <div class="admonition tip">
<p class="admonition-title">Tip</p> <p class="admonition-title">Tip</p>
<p>If you are using a Kubernetes version previous to 1.14, you need to change <code class="codehilite">kubernetes.io/os</code> to <code class="codehilite">beta.kubernetes.io/os</code> at line 217 of <a href="https://github.com/kubernetes/ingress-nginx/blob/master/deploy/static/mandatory.yaml#L217">mandatory.yaml</a>, see <a href="https://kubernetes.io/docs/reference/kubernetes-api/labels-annotations-taints/">Labels details</a>.</p> <p>If you are using a Kubernetes version previous to 1.14, you need to change <code class="codehilite"><span class="err">kubernetes.io/os</span></code> to <code class="codehilite"><span class="err">beta.kubernetes.io/os</span></code> at line 217 of <a href="https://github.com/kubernetes/ingress-nginx/blob/master/deploy/static/mandatory.yaml#L217">mandatory.yaml</a>, see <a href="https://kubernetes.io/docs/reference/kubernetes-api/labels-annotations-taints/">Labels details</a>.</p>
</div> </div>
<h3 id="provider-specific-steps">Provider Specific Steps<a class="headerlink" href="#provider-specific-steps" title="Permanent link"></a></h3> <h3 id="provider-specific-steps">Provider Specific Steps<a class="headerlink" href="#provider-specific-steps" title="Permanent link"></a></h3>
<p>There are cloud provider specific yaml files.</p> <p>There are cloud provider specific yaml files.</p>
<h4 id="docker-for-mac">Docker for Mac<a class="headerlink" href="#docker-for-mac" title="Permanent link"></a></h4> <h4 id="docker-for-mac">Docker for Mac<a class="headerlink" href="#docker-for-mac" title="Permanent link"></a></h4>
<p>Kubernetes is available in Docker for Mac (from <a href="https://docs.docker.com/docker-for-mac/release-notes/#stable-releases-of-2018">version 18.06.0-ce</a>)</p> <p>Kubernetes is available in Docker for Mac (from <a href="https://docs.docker.com/docker-for-mac/release-notes/#stable-releases-of-2018">version 18.06.0-ce</a>)</p>
<p>Create a service</p> <p>Create a service</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/cloud-generic.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/cloud-generic.yaml</span>
</pre></div> </code></pre></div>
<h4 id="minikube">minikube<a class="headerlink" href="#minikube" title="Permanent link"></a></h4> <h4 id="minikube">minikube<a class="headerlink" href="#minikube" title="Permanent link"></a></h4>
<p>For standard usage:</p> <p>For standard usage:</p>
<div class="codehilite"><pre><span></span><span class="go">minikube addons enable ingress</span> <div class="codehilite"><pre><span></span><code><span class="go">minikube addons enable ingress</span>
</pre></div> </code></pre></div>
<p>For development:</p> <p>For development:</p>
<ol> <ol>
<li>Disable the ingress addon:</li> <li>Disable the ingress addon:</li>
</ol> </ol>
<div class="codehilite"><pre><span></span><span class="go">minikube addons disable ingress</span> <div class="codehilite"><pre><span></span><code><span class="go">minikube addons disable ingress</span>
</pre></div> </code></pre></div>
<ol> <ol>
<li>Execute <code class="codehilite">make dev-env</code></li> <li>Execute <code class="codehilite"><span class="err">make dev-env</span></code></li>
<li>Confirm the <code class="codehilite">nginx-ingress-controller</code> deployment exists:</li> <li>Confirm the <code class="codehilite"><span class="err">nginx-ingress-controller</span></code> deployment exists:</li>
</ol> </ol>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get pods -n ingress-nginx <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get pods -n ingress-nginx
<span class="go">NAME READY STATUS RESTARTS AGE</span> <span class="go">NAME READY STATUS RESTARTS AGE</span>
<span class="go">default-http-backend-66b447d9cf-rrlf9 1/1 Running 0 12s</span> <span class="go">default-http-backend-66b447d9cf-rrlf9 1/1 Running 0 12s</span>
<span class="go">nginx-ingress-controller-fdcdcd6dd-vvpgs 1/1 Running 0 11s</span> <span class="go">nginx-ingress-controller-fdcdcd6dd-vvpgs 1/1 Running 0 11s</span>
</pre></div> </code></pre></div>
<h4 id="aws">AWS<a class="headerlink" href="#aws" title="Permanent link"></a></h4> <h4 id="aws">AWS<a class="headerlink" href="#aws" title="Permanent link"></a></h4>
<p>In AWS we use an Elastic Load Balancer (ELB) to expose the NGINX Ingress controller behind a Service of <code class="codehilite">Type=LoadBalancer</code>. <p>In AWS we use an Elastic Load Balancer (ELB) to expose the NGINX Ingress controller behind a Service of <code class="codehilite"><span class="err">Type=LoadBalancer</span></code>.
Since Kubernetes v1.9.0 it is possible to use a classic load balancer (ELB) or network load balancer (NLB) Since Kubernetes v1.9.0 it is possible to use a classic load balancer (ELB) or network load balancer (NLB)
Please check the <a href="https://aws.amazon.com/elasticloadbalancing/details/">elastic load balancing AWS details page</a></p> Please check the <a href="https://aws.amazon.com/elasticloadbalancing/details/">elastic load balancing AWS details page</a></p>
<h5 id="elastic-load-balancer-elb">Elastic Load Balancer - ELB<a class="headerlink" href="#elastic-load-balancer-elb" title="Permanent link"></a></h5> <h5 id="elastic-load-balancer-elb">Elastic Load Balancer - ELB<a class="headerlink" href="#elastic-load-balancer-elb" title="Permanent link"></a></h5>
@ -1509,45 +1509,45 @@ Please check the <a href="https://aws.amazon.com/elasticloadbalancing/details/">
<li><a href="https://en.wikipedia.org/wiki/OSI_model#Layer_7:_Application_Layer">Layer 7</a>: use HTTP as the listener protocol for port 80 and terminate TLS in the ELB</li> <li><a href="https://en.wikipedia.org/wiki/OSI_model#Layer_7:_Application_Layer">Layer 7</a>: use HTTP as the listener protocol for port 80 and terminate TLS in the ELB</li>
</ul> </ul>
<p>For L4:</p> <p>For L4:</p>
<p>Check that no change is necessary with regards to the ELB idle timeout. In some scenarios, users may want to modify the ELB idle timeout, so please check the <a href="#elb-idle-timeouts">ELB Idle Timeouts section</a> for additional information. If a change is required, users will need to update the value of <code class="codehilite">service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout</code> in <code class="codehilite">provider/aws/service-l4.yaml</code></p> <p>Check that no change is necessary with regards to the ELB idle timeout. In some scenarios, users may want to modify the ELB idle timeout, so please check the <a href="#elb-idle-timeouts">ELB Idle Timeouts section</a> for additional information. If a change is required, users will need to update the value of <code class="codehilite"><span class="err">service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout</span></code> in <code class="codehilite"><span class="err">provider/aws/service-l4.yaml</span></code></p>
<p>Then execute:</p> <p>Then execute:</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/aws/service-l4.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/aws/service-l4.yaml</span>
<span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/aws/patch-configmap-l4.yaml</span> <span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/aws/patch-configmap-l4.yaml</span>
</pre></div> </code></pre></div>
<p>For L7:</p> <p>For L7:</p>
<p>Change line of the file <code class="codehilite">provider/aws/service-l7.yaml</code> replacing the dummy id with a valid one <code class="codehilite">&quot;arn:aws:acm:us-west-2:XXXXXXXX:certificate/XXXXXX-XXXXXXX-XXXXXXX-XXXXXXXX&quot;</code></p> <p>Change line of the file <code class="codehilite"><span class="err">provider/aws/service-l7.yaml</span></code> replacing the dummy id with a valid one <code class="codehilite"><span class="err">&quot;arn:aws:acm:us-west-2:XXXXXXXX:certificate/XXXXXX-XXXXXXX-XXXXXXX-XXXXXXXX&quot;</span></code></p>
<p>Check that no change is necessary with regards to the ELB idle timeout. In some scenarios, users may want to modify the ELB idle timeout, so please check the <a href="#elb-idle-timeouts">ELB Idle Timeouts section</a> for additional information. If a change is required, users will need to update the value of <code class="codehilite">service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout</code> in <code class="codehilite">provider/aws/service-l7.yaml</code></p> <p>Check that no change is necessary with regards to the ELB idle timeout. In some scenarios, users may want to modify the ELB idle timeout, so please check the <a href="#elb-idle-timeouts">ELB Idle Timeouts section</a> for additional information. If a change is required, users will need to update the value of <code class="codehilite"><span class="err">service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout</span></code> in <code class="codehilite"><span class="err">provider/aws/service-l7.yaml</span></code></p>
<p>Then execute:</p> <p>Then execute:</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/aws/service-l7.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/aws/service-l7.yaml</span>
<span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/aws/patch-configmap-l7.yaml</span> <span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/aws/patch-configmap-l7.yaml</span>
</pre></div> </code></pre></div>
<p>This example creates an ELB with just two listeners, one in port 80 and another in port 443</p> <p>This example creates an ELB with just two listeners, one in port 80 and another in port 443</p>
<p><img alt="Listeners" src="../images/elb-l7-listener.png" /></p> <p><img alt="Listeners" src="../images/elb-l7-listener.png" /></p>
<h5 id="elb-idle-timeouts">ELB Idle Timeouts<a class="headerlink" href="#elb-idle-timeouts" title="Permanent link"></a></h5> <h5 id="elb-idle-timeouts">ELB Idle Timeouts<a class="headerlink" href="#elb-idle-timeouts" title="Permanent link"></a></h5>
<p>In some scenarios users will need to modify the value of the ELB idle timeout. Users need to ensure the idle timeout is less than the <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout">keepalive_timeout</a> that is configured for NGINX. By default NGINX <code class="codehilite">keepalive_timeout</code> is set to <code class="codehilite">75s</code>.</p> <p>In some scenarios users will need to modify the value of the ELB idle timeout. Users need to ensure the idle timeout is less than the <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout">keepalive_timeout</a> that is configured for NGINX. By default NGINX <code class="codehilite"><span class="err">keepalive_timeout</span></code> is set to <code class="codehilite"><span class="err">75s</span></code>.</p>
<p>The default ELB idle timeout will work for most scenarios, unless the NGINX <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout">keepalive_timeout</a> has been modified, in which case <code class="codehilite">service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout</code> will need to be modified to ensure it is less than the <code class="codehilite">keepalive_timeout</code> the user has configured.</p> <p>The default ELB idle timeout will work for most scenarios, unless the NGINX <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout">keepalive_timeout</a> has been modified, in which case <code class="codehilite"><span class="err">service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout</span></code> will need to be modified to ensure it is less than the <code class="codehilite"><span class="err">keepalive_timeout</span></code> the user has configured.</p>
<p><em>Please Note: An idle timeout of <code class="codehilite">3600s</code> is recommended when using WebSockets.</em></p> <p><em>Please Note: An idle timeout of <code class="codehilite"><span class="err">3600s</span></code> is recommended when using WebSockets.</em></p>
<p>More information with regards to idle timeouts for your Load Balancer can be found in the <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html">official AWS documentation</a>.</p> <p>More information with regards to idle timeouts for your Load Balancer can be found in the <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html">official AWS documentation</a>.</p>
<h5 id="network-load-balancer-nlb">Network Load Balancer (NLB)<a class="headerlink" href="#network-load-balancer-nlb" title="Permanent link"></a></h5> <h5 id="network-load-balancer-nlb">Network Load Balancer (NLB)<a class="headerlink" href="#network-load-balancer-nlb" title="Permanent link"></a></h5>
<p>This type of load balancer is supported since v1.10.0 as an ALPHA feature.</p> <p>This type of load balancer is supported since v1.10.0 as an ALPHA feature.</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/aws/service-nlb.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/aws/service-nlb.yaml</span>
</pre></div> </code></pre></div>
<h4 id="gce-gke">GCE-GKE<a class="headerlink" href="#gce-gke" title="Permanent link"></a></h4> <h4 id="gce-gke">GCE-GKE<a class="headerlink" href="#gce-gke" title="Permanent link"></a></h4>
<div class="codehilite"><pre><span></span><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/cloud-generic.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/cloud-generic.yaml</span>
</pre></div> </code></pre></div>
<p><strong>Important Note:</strong> proxy protocol is not supported in GCE/GKE</p> <p><strong>Important Note:</strong> proxy protocol is not supported in GCE/GKE</p>
<h4 id="azure">Azure<a class="headerlink" href="#azure" title="Permanent link"></a></h4> <h4 id="azure">Azure<a class="headerlink" href="#azure" title="Permanent link"></a></h4>
<div class="codehilite"><pre><span></span><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/cloud-generic.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/cloud-generic.yaml</span>
</pre></div> </code></pre></div>
<h4 id="bare-metal">Bare-metal<a class="headerlink" href="#bare-metal" title="Permanent link"></a></h4> <h4 id="bare-metal">Bare-metal<a class="headerlink" href="#bare-metal" title="Permanent link"></a></h4>
<p>Using <a href="https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport">NodePort</a>:</p> <p>Using <a href="https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport">NodePort</a>:</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/baremetal/service-nodeport.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/baremetal/service-nodeport.yaml</span>
</pre></div> </code></pre></div>
<div class="admonition tip"> <div class="admonition tip">
<p class="admonition-title">Tip</p> <p class="admonition-title">Tip</p>
@ -1555,39 +1555,40 @@ Please check the <a href="https://aws.amazon.com/elasticloadbalancing/details/">
</div> </div>
<h3 id="verify-installation">Verify installation<a class="headerlink" href="#verify-installation" title="Permanent link"></a></h3> <h3 id="verify-installation">Verify installation<a class="headerlink" href="#verify-installation" title="Permanent link"></a></h3>
<p>To check if the ingress controller pods have started, run the following command:</p> <p>To check if the ingress controller pods have started, run the following command:</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl get pods --all-namespaces -l app.kubernetes.io/name=ingress-nginx --watch</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl get pods --all-namespaces -l app.kubernetes.io/name=ingress-nginx --watch</span>
</pre></div> </code></pre></div>
<p>Once the operator pods are running, you can cancel the above command by typing <code class="codehilite">Ctrl+C</code>. <p>Once the operator pods are running, you can cancel the above command by typing <code class="codehilite"><span class="err">Ctrl+C</span></code>.
Now, you are ready to create your first ingress.</p> Now, you are ready to create your first ingress.</p>
<h3 id="detect-installed-version">Detect installed version<a class="headerlink" href="#detect-installed-version" title="Permanent link"></a></h3> <h3 id="detect-installed-version">Detect installed version<a class="headerlink" href="#detect-installed-version" title="Permanent link"></a></h3>
<p>To detect which version of the ingress controller is running, exec into the pod and run <code class="codehilite">nginx-ingress-controller version</code> command.</p> <p>To detect which version of the ingress controller is running, exec into the pod and run <code class="codehilite"><span class="err">nginx-ingress-controller version</span></code> command.</p>
<div class="codehilite"><pre><span></span><span class="go">POD_NAMESPACE=ingress-nginx</span> <div class="codehilite"><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 -o jsonpath=&#39;{.items[0].metadata.name}&#39;)</span> <span class="go">POD_NAME=$(kubectl get pods -n $POD_NAMESPACE -l app.kubernetes.io/name=ingress-nginx -o jsonpath=&#39;{.items[0].metadata.name}&#39;)</span>
<span class="go">kubectl exec -it $POD_NAME -n $POD_NAMESPACE -- /nginx-ingress-controller --version</span> <span class="go">kubectl exec -it $POD_NAME -n $POD_NAMESPACE -- /nginx-ingress-controller --version</span>
</pre></div> </code></pre></div>
<h2 id="using-helm">Using Helm<a class="headerlink" href="#using-helm" title="Permanent link"></a></h2> <h2 id="using-helm">Using Helm<a class="headerlink" href="#using-helm" title="Permanent link"></a></h2>
<p>NGINX Ingress controller can be installed via <a href="https://helm.sh/">Helm</a> using the chart <a href="https://github.com/kubernetes/charts/tree/master/stable/nginx-ingress">stable/nginx-ingress</a> from the official charts repository. <p>NGINX Ingress controller can be installed via <a href="https://helm.sh/">Helm</a> using the chart <a href="https://github.com/kubernetes/charts/tree/master/stable/nginx-ingress">stable/nginx-ingress</a> from the official charts repository.
To install the chart with the release name <code class="codehilite">my-nginx</code>:</p> To install the chart with the release name <code class="codehilite"><span class="err">my-nginx</span></code>:</p>
<div class="codehilite"><pre><span></span><span class="go">helm install my-nginx stable/nginx-ingress</span> <div class="codehilite"><pre><span></span><code><span class="go">helm install my-nginx stable/nginx-ingress</span>
</pre></div> </code></pre></div>
<p>If the kubernetes cluster has RBAC enabled, then run:</p> <p>If the kubernetes cluster has RBAC enabled, then run:</p>
<div class="codehilite"><pre><span></span><span class="go">helm install my-nginx stable/nginx-ingress --set rbac.create=true</span> <div class="codehilite"><pre><span></span><code><span class="go">helm install my-nginx stable/nginx-ingress --set rbac.create=true</span>
</pre></div> </code></pre></div>
<p>If you are using <a href="https://v2.helm.sh/">Helm 2</a> then specify release name using <code class="codehilite">--name</code> flag</p> <p>If you are using <a href="https://v2.helm.sh/">Helm 2</a> then specify release name using <code class="codehilite"><span class="err">--name</span></code> flag</p>
<p><div class="codehilite"><pre><span></span><span class="go">helm install stable/nginx-ingress --name my-nginx</span> <p><div class="codehilite"><pre><span></span><code><span class="go">helm install stable/nginx-ingress --name my-nginx</span>
</pre></div> </code></pre></div>
or or
<div class="codehilite"><pre><span></span><span class="go">helm install stable/nginx-ingress --name my-nginx --set rbac.create=true</span> <div class="codehilite"><pre><span></span><code><span class="go">helm install stable/nginx-ingress --name my-nginx --set rbac.create=true</span>
</pre></div></p> </code></pre></div></p>
<p>Detect installed version:</p> <p>Detect installed version:</p>
<div class="codehilite"><pre><span></span><span class="go">POD_NAME=$(kubectl get pods -l app.kubernetes.io/name=ingress-nginx -o jsonpath=&#39;{.items[0].metadata.name}&#39;)</span> <div class="codehilite"><pre><span></span><code><span class="go">POD_NAME=$(kubectl get pods -l app.kubernetes.io/name=ingress-nginx -o jsonpath=&#39;{.items[0].metadata.name}&#39;)</span>
<span class="go">kubectl exec -it $POD_NAME -- /nginx-ingress-controller --version</span> <span class="go">kubectl exec -it $POD_NAME -- /nginx-ingress-controller --version</span>
</pre></div> </code></pre></div>
@ -1645,9 +1646,9 @@ or
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1657,7 +1658,7 @@ or
</div> </div>
<script src="../assets/javascripts/application.ac79c3b0.js"></script> <script src="../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script> <script>app.initialize({version:"1.0.4",url:{base:".."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#role-based-access-control-rbac" tabindex="1" class="md-skip"> <a href="#role-based-access-control-rbac" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1280,40 +1280,40 @@
<p>This example applies to nginx-ingress-controllers being deployed in an environment with RBAC enabled.</p> <p>This example applies to nginx-ingress-controllers being deployed in an environment with RBAC enabled.</p>
<p>Role Based Access Control is comprised of four layers:</p> <p>Role Based Access Control is comprised of four layers:</p>
<ol> <ol>
<li><code class="codehilite">ClusterRole</code> - permissions assigned to a role that apply to an entire cluster</li> <li><code class="codehilite"><span class="err">ClusterRole</span></code> - permissions assigned to a role that apply to an entire cluster</li>
<li><code class="codehilite">ClusterRoleBinding</code> - binding a ClusterRole to a specific account</li> <li><code class="codehilite"><span class="err">ClusterRoleBinding</span></code> - binding a ClusterRole to a specific account</li>
<li><code class="codehilite">Role</code> - permissions assigned to a role that apply to a specific namespace</li> <li><code class="codehilite"><span class="err">Role</span></code> - permissions assigned to a role that apply to a specific namespace</li>
<li><code class="codehilite">RoleBinding</code> - binding a Role to a specific account</li> <li><code class="codehilite"><span class="err">RoleBinding</span></code> - binding a Role to a specific account</li>
</ol> </ol>
<p>In order for RBAC to be applied to an nginx-ingress-controller, that controller <p>In order for RBAC to be applied to an nginx-ingress-controller, that controller
should be assigned to a <code class="codehilite">ServiceAccount</code>. That <code class="codehilite">ServiceAccount</code> should be should be assigned to a <code class="codehilite"><span class="err">ServiceAccount</span></code>. That <code class="codehilite"><span class="err">ServiceAccount</span></code> should be
bound to the <code class="codehilite">Role</code>s and <code class="codehilite">ClusterRole</code>s defined for the nginx-ingress-controller.</p> bound to the <code class="codehilite"><span class="err">Role</span></code>s and <code class="codehilite"><span class="err">ClusterRole</span></code>s defined for the nginx-ingress-controller.</p>
<h2 id="service-accounts-created-in-this-example">Service Accounts created in this example<a class="headerlink" href="#service-accounts-created-in-this-example" title="Permanent link"></a></h2> <h2 id="service-accounts-created-in-this-example">Service Accounts created in this example<a class="headerlink" href="#service-accounts-created-in-this-example" title="Permanent link"></a></h2>
<p>One ServiceAccount is created in this example, <code class="codehilite">nginx-ingress-serviceaccount</code>.</p> <p>One ServiceAccount is created in this example, <code class="codehilite"><span class="err">nginx-ingress-serviceaccount</span></code>.</p>
<h2 id="permissions-granted-in-this-example">Permissions Granted in this example<a class="headerlink" href="#permissions-granted-in-this-example" title="Permanent link"></a></h2> <h2 id="permissions-granted-in-this-example">Permissions Granted in this example<a class="headerlink" href="#permissions-granted-in-this-example" title="Permanent link"></a></h2>
<p>There are two sets of permissions defined in this example. Cluster-wide <p>There are two sets of permissions defined in this example. Cluster-wide
permissions defined by the <code class="codehilite">ClusterRole</code> named <code class="codehilite">nginx-ingress-clusterrole</code>, and permissions defined by the <code class="codehilite"><span class="err">ClusterRole</span></code> named <code class="codehilite"><span class="err">nginx-ingress-clusterrole</span></code>, and
namespace specific permissions defined by the <code class="codehilite">Role</code> named <code class="codehilite">nginx-ingress-role</code>.</p> namespace specific permissions defined by the <code class="codehilite"><span class="err">Role</span></code> named <code class="codehilite"><span class="err">nginx-ingress-role</span></code>.</p>
<h3 id="cluster-permissions">Cluster Permissions<a class="headerlink" href="#cluster-permissions" title="Permanent link"></a></h3> <h3 id="cluster-permissions">Cluster Permissions<a class="headerlink" href="#cluster-permissions" title="Permanent link"></a></h3>
<p>These permissions are granted in order for the nginx-ingress-controller to be <p>These permissions are granted in order for the nginx-ingress-controller to be
able to function as an ingress across the cluster. These permissions are able to function as an ingress across the cluster. These permissions are
granted to the ClusterRole named <code class="codehilite">nginx-ingress-clusterrole</code></p> granted to the ClusterRole named <code class="codehilite"><span class="err">nginx-ingress-clusterrole</span></code></p>
<ul> <ul>
<li><code class="codehilite">configmaps</code>, <code class="codehilite">endpoints</code>, <code class="codehilite">nodes</code>, <code class="codehilite">pods</code>, <code class="codehilite">secrets</code>: list, watch</li> <li><code class="codehilite"><span class="err">configmaps</span></code>, <code class="codehilite"><span class="err">endpoints</span></code>, <code class="codehilite"><span class="err">nodes</span></code>, <code class="codehilite"><span class="err">pods</span></code>, <code class="codehilite"><span class="err">secrets</span></code>: list, watch</li>
<li><code class="codehilite">nodes</code>: get</li> <li><code class="codehilite"><span class="err">nodes</span></code>: get</li>
<li><code class="codehilite">services</code>, <code class="codehilite">ingresses</code>: get, list, watch</li> <li><code class="codehilite"><span class="err">services</span></code>, <code class="codehilite"><span class="err">ingresses</span></code>: get, list, watch</li>
<li><code class="codehilite">events</code>: create, patch</li> <li><code class="codehilite"><span class="err">events</span></code>: create, patch</li>
<li><code class="codehilite">ingresses/status</code>: update</li> <li><code class="codehilite"><span class="err">ingresses/status</span></code>: update</li>
</ul> </ul>
<h3 id="namespace-permissions">Namespace Permissions<a class="headerlink" href="#namespace-permissions" title="Permanent link"></a></h3> <h3 id="namespace-permissions">Namespace Permissions<a class="headerlink" href="#namespace-permissions" title="Permanent link"></a></h3>
<p>These permissions are granted specific to the nginx-ingress namespace. These <p>These permissions are granted specific to the nginx-ingress namespace. These
permissions are granted to the Role named <code class="codehilite">nginx-ingress-role</code></p> permissions are granted to the Role named <code class="codehilite"><span class="err">nginx-ingress-role</span></code></p>
<ul> <ul>
<li><code class="codehilite">configmaps</code>, <code class="codehilite">pods</code>, <code class="codehilite">secrets</code>: get</li> <li><code class="codehilite"><span class="err">configmaps</span></code>, <code class="codehilite"><span class="err">pods</span></code>, <code class="codehilite"><span class="err">secrets</span></code>: get</li>
<li><code class="codehilite">endpoints</code>: get</li> <li><code class="codehilite"><span class="err">endpoints</span></code>: get</li>
</ul> </ul>
<p>Furthermore to support leader-election, the nginx-ingress-controller needs to <p>Furthermore to support leader-election, the nginx-ingress-controller needs to
have access to a <code class="codehilite">configmap</code> using the resourceName <code class="codehilite">ingress-controller-leader-nginx</code></p> have access to a <code class="codehilite"><span class="err">configmap</span></code> using the resourceName <code class="codehilite"><span class="err">ingress-controller-leader-nginx</span></code></p>
<blockquote> <blockquote>
<p>Note that resourceNames can NOT be used to limit requests using the “create” <p>Note that resourceNames can NOT be used to limit requests using the “create”
verb because authorizers only have access to information that can be obtained verb because authorizers only have access to information that can be obtained
@ -1321,21 +1321,21 @@ from the request URL, method, and headers (resource names in a “create” requ
are part of the request body).</p> are part of the request body).</p>
</blockquote> </blockquote>
<ul> <ul>
<li><code class="codehilite">configmaps</code>: get, update (for resourceName <code class="codehilite">ingress-controller-leader-nginx</code>)</li> <li><code class="codehilite"><span class="err">configmaps</span></code>: get, update (for resourceName <code class="codehilite"><span class="err">ingress-controller-leader-nginx</span></code>)</li>
<li><code class="codehilite">configmaps</code>: create</li> <li><code class="codehilite"><span class="err">configmaps</span></code>: create</li>
</ul> </ul>
<p>This resourceName is the concatenation of the <code class="codehilite">election-id</code> and the <p>This resourceName is the concatenation of the <code class="codehilite"><span class="err">election-id</span></code> and the
<code class="codehilite">ingress-class</code> as defined by the ingress-controller, which defaults to:</p> <code class="codehilite"><span class="err">ingress-class</span></code> as defined by the ingress-controller, which defaults to:</p>
<ul> <ul>
<li><code class="codehilite">election-id</code>: <code class="codehilite">ingress-controller-leader</code></li> <li><code class="codehilite"><span class="err">election-id</span></code>: <code class="codehilite"><span class="err">ingress-controller-leader</span></code></li>
<li><code class="codehilite">ingress-class</code>: <code class="codehilite">nginx</code></li> <li><code class="codehilite"><span class="err">ingress-class</span></code>: <code class="codehilite"><span class="err">nginx</span></code></li>
<li><code class="codehilite">resourceName</code> : <code class="codehilite">&lt;election-id&gt;-&lt;ingress-class&gt;</code></li> <li><code class="codehilite"><span class="err">resourceName</span></code> : <code class="codehilite"><span class="err">&lt;election-id&gt;-&lt;ingress-class&gt;</span></code></li>
</ul> </ul>
<p>Please adapt accordingly if you overwrite either parameter when launching the <p>Please adapt accordingly if you overwrite either parameter when launching the
nginx-ingress-controller.</p> nginx-ingress-controller.</p>
<h3 id="bindings">Bindings<a class="headerlink" href="#bindings" title="Permanent link"></a></h3> <h3 id="bindings">Bindings<a class="headerlink" href="#bindings" title="Permanent link"></a></h3>
<p>The ServiceAccount <code class="codehilite">nginx-ingress-serviceaccount</code> is bound to the Role <p>The ServiceAccount <code class="codehilite"><span class="err">nginx-ingress-serviceaccount</span></code> is bound to the Role
<code class="codehilite">nginx-ingress-role</code> and the ClusterRole <code class="codehilite">nginx-ingress-clusterrole</code>.</p> <code class="codehilite"><span class="err">nginx-ingress-role</span></code> and the ClusterRole <code class="codehilite"><span class="err">nginx-ingress-clusterrole</span></code>.</p>
<p>The serviceAccountName associated with the containers in the deployment must <p>The serviceAccountName associated with the containers in the deployment must
match the serviceAccount. The namespace references in the Deployment metadata, match the serviceAccount. The namespace references in the Deployment metadata,
container arguments, and POD_NAMESPACE should be in the nginx-ingress namespace.</p> container arguments, and POD_NAMESPACE should be in the nginx-ingress namespace.</p>
@ -1348,6 +1348,7 @@ container arguments, and POD_NAMESPACE should be in the nginx-ingress namespace.
</article> </article>
</div> </div>
</div> </div>
@ -1396,9 +1397,9 @@ container arguments, and POD_NAMESPACE should be in the nginx-ingress namespace.
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1408,7 +1409,7 @@ container arguments, and POD_NAMESPACE should be in the nginx-ingress namespace.
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#upgrading" tabindex="1" class="md-skip"> <a href="#upgrading" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1217,7 +1217,7 @@ make sure your templates are compatible with the new version of ingress-nginx</e
<p>To upgrade your ingress-nginx installation, it should be enough to change the version of the image <p>To upgrade your ingress-nginx installation, it should be enough to change the version of the image
in the controller Deployment.</p> in the controller Deployment.</p>
<p>I.e. if your deployment resource looks like (partial example):</p> <p>I.e. if your deployment resource looks like (partial example):</p>
<div class="codehilite"><pre><span></span><span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Deployment</span> <div class="codehilite"><pre><span></span><code><span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Deployment</span>
<span class="nt">metadata</span><span class="p">:</span> <span class="nt">metadata</span><span class="p">:</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">nginx-ingress-controller</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">nginx-ingress-controller</span>
<span class="nt">namespace</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress-nginx</span> <span class="nt">namespace</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress-nginx</span>
@ -1231,20 +1231,21 @@ in the controller Deployment.</p>
<span class="p p-Indicator">-</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">nginx-ingress-controller</span> <span class="p p-Indicator">-</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">nginx-ingress-controller</span>
<span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.9.0</span> <span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.9.0</span>
<span class="nt">args</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">...</span> <span class="nt">args</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">...</span>
</pre></div> </code></pre></div>
<p>simply change the <code class="codehilite">0.9.0</code> tag to the version you wish to upgrade to. <p>simply change the <code class="codehilite"><span class="err">0.9.0</span></code> tag to the version you wish to upgrade to.
The easiest way to do this is e.g. (do note you may need to change the name parameter according to your installation):</p> The easiest way to do this is e.g. (do note you may need to change the name parameter according to your installation):</p>
<div class="codehilite"><pre><span></span>kubectl set image deployment/nginx-ingress-controller \ <div class="codehilite"><pre><span></span><code><span class="err">kubectl set image deployment/nginx-ingress-controller \</span>
nginx-ingress-controller=quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.28.0 <span class="err"> nginx-ingress-controller=quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.28.0</span>
</pre></div> </code></pre></div>
<p>For interactive editing, use <code class="codehilite">kubectl edit deployment nginx-ingress-controller</code>.</p> <p>For interactive editing, use <code class="codehilite"><span class="err">kubectl edit deployment nginx-ingress-controller</span></code>.</p>
<h2 id="with-helm">With Helm<a class="headerlink" href="#with-helm" title="Permanent link"></a></h2> <h2 id="with-helm">With Helm<a class="headerlink" href="#with-helm" title="Permanent link"></a></h2>
<p>If you installed ingress-nginx using the Helm command in the deployment docs so its name is <code class="codehilite">ngx-ingress</code>, <p>If you installed ingress-nginx using the Helm command in the deployment docs so its name is <code class="codehilite"><span class="err">ngx-ingress</span></code>,
you should be able to upgrade using</p> you should be able to upgrade using</p>
<div class="codehilite"><pre><span></span>helm upgrade --reuse-values ngx-ingress stable/nginx-ingress <div class="codehilite"><pre><span></span><code>helm upgrade --reuse-values ngx-ingress stable/nginx-ingress
</pre></div> </code></pre></div>
@ -1302,9 +1303,9 @@ you should be able to upgrade using</p>
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1314,7 +1315,7 @@ you should be able to upgrade using</p>
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#validating-webhook-admission-controller" tabindex="1" class="md-skip"> <a href="#validating-webhook-admission-controller" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1352,16 +1352,16 @@
<p>Validating webhook must be served using TLS, you need to generate a certificate. Note that kube API server is checking the hostname of the certificate, the common name of your certificate will need to match the service name.</p> <p>Validating webhook must be served using TLS, you need to generate a certificate. Note that kube API server is checking the hostname of the certificate, the common name of your certificate will need to match the service name.</p>
<div class="admonition example"> <div class="admonition example">
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<p>To run the validating webhook with a service named <code class="codehilite">ingress-validation-webhook</code> in the namespace <code class="codehilite">ingress-nginx</code>, run</p> <p>To run the validating webhook with a service named <code class="codehilite"><span class="err">ingress-validation-webhook</span></code> in the namespace <code class="codehilite"><span class="err">ingress-nginx</span></code>, run</p>
<div class="codehilite"><pre><span></span>openssl req -x509 -newkey rsa:2048 -keyout certificate.pem -out key.pem -days <span class="m">365</span> -nodes -subj <span class="s2">&quot;/CN=ingress-validation-webhook.ingress-nginx.svc&quot;</span> <div class="codehilite"><pre><span></span><code>openssl req -x509 -newkey rsa:2048 -keyout certificate.pem -out key.pem -days <span class="m">365</span> -nodes -subj <span class="s2">&quot;/CN=ingress-validation-webhook.ingress-nginx.svc&quot;</span>
</pre></div> </code></pre></div>
</div> </div>
<h5 id="using-kubernetes-ca">Using Kubernetes CA<a class="headerlink" href="#using-kubernetes-ca" title="Permanent link"></a></h5> <h5 id="using-kubernetes-ca">Using Kubernetes CA<a class="headerlink" href="#using-kubernetes-ca" title="Permanent link"></a></h5>
<p>Kubernetes also provides primitives to sign a certificate request. Here is an example on how to use it</p> <p>Kubernetes also provides primitives to sign a certificate request. Here is an example on how to use it</p>
<div class="admonition example"> <div class="admonition example">
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<div class="codehilite"><pre><span></span><span class="ch">#!/bin/bash</span> <div class="codehilite"><pre><span></span><code><span class="ch">#!/bin/bash</span>
<span class="nv">SERVICE_NAME</span><span class="o">=</span>ingress-nginx <span class="nv">SERVICE_NAME</span><span class="o">=</span>ingress-nginx
<span class="nv">NAMESPACE</span><span class="o">=</span>ingress-nginx <span class="nv">NAMESPACE</span><span class="o">=</span>ingress-nginx
@ -1423,17 +1423,17 @@ kubectl create secret generic ingress-nginx.svc <span class="se">\</span>
--from-file<span class="o">=</span>key.pem<span class="o">=</span><span class="si">${</span><span class="nv">TEMP_DIRECTORY</span><span class="si">}</span>/server-key.pem <span class="se">\</span> --from-file<span class="o">=</span>key.pem<span class="o">=</span><span class="si">${</span><span class="nv">TEMP_DIRECTORY</span><span class="si">}</span>/server-key.pem <span class="se">\</span>
--from-file<span class="o">=</span>cert.pem<span class="o">=</span><span class="si">${</span><span class="nv">TEMP_DIRECTORY</span><span class="si">}</span>/server-cert.pem <span class="se">\</span> --from-file<span class="o">=</span>cert.pem<span class="o">=</span><span class="si">${</span><span class="nv">TEMP_DIRECTORY</span><span class="si">}</span>/server-cert.pem <span class="se">\</span>
-n <span class="si">${</span><span class="nv">NAMESPACE</span><span class="si">}</span> -n <span class="si">${</span><span class="nv">NAMESPACE</span><span class="si">}</span>
</pre></div> </code></pre></div>
</div> </div>
<h4 id="using-helm">Using helm<a class="headerlink" href="#using-helm" title="Permanent link"></a></h4> <h4 id="using-helm">Using helm<a class="headerlink" href="#using-helm" title="Permanent link"></a></h4>
<p>To generate the certificate using helm, you can use the following snippet</p> <p>To generate the certificate using helm, you can use the following snippet</p>
<div class="admonition example"> <div class="admonition example">
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<div class="codehilite"><pre><span></span><span class="cp">{{</span><span class="o">-</span> <span class="err">$</span><span class="nv">cn</span> <span class="o">:=</span> <span class="nv">printf</span> <span class="s2">&quot;%s.%s.svc&quot;</span> <span class="o">(</span> <span class="nv">include</span> <span class="s2">&quot;nginx-ingress.validatingWebhook.fullname&quot;</span> <span class="err">.</span> <span class="o">)</span> <span class="nv">.Release.Namespace</span> <span class="cp">}}</span><span class="x"></span> <div class="codehilite"><pre><span></span><code><span class="cp">{{</span><span class="o">-</span> <span class="err">$</span><span class="nv">cn</span> <span class="o">:=</span> <span class="nv">printf</span> <span class="s2">&quot;%s.%s.svc&quot;</span> <span class="o">(</span> <span class="nv">include</span> <span class="s2">&quot;nginx-ingress.validatingWebhook.fullname&quot;</span> <span class="err">.</span> <span class="o">)</span> <span class="nv">.Release.Namespace</span> <span class="cp">}}</span><span class="x"></span>
<span class="cp">{{</span><span class="o">-</span> <span class="err">$</span><span class="nv">ca</span> <span class="o">:=</span> <span class="nv">genCA</span> <span class="o">(</span><span class="nv">printf</span> <span class="s2">&quot;%s-ca&quot;</span> <span class="o">(</span> <span class="nv">include</span> <span class="s2">&quot;nginx-ingress.validatingWebhook.fullname&quot;</span> <span class="err">.</span> <span class="o">))</span> <span class="nv">.Values.validatingWebhook.certificateValidity</span> -<span class="cp">}}</span><span class="x"></span> <span class="cp">{{</span><span class="o">-</span> <span class="err">$</span><span class="nv">ca</span> <span class="o">:=</span> <span class="nv">genCA</span> <span class="o">(</span><span class="nv">printf</span> <span class="s2">&quot;%s-ca&quot;</span> <span class="o">(</span> <span class="nv">include</span> <span class="s2">&quot;nginx-ingress.validatingWebhook.fullname&quot;</span> <span class="err">.</span> <span class="o">))</span> <span class="nv">.Values.validatingWebhook.certificateValidity</span> -<span class="cp">}}</span><span class="x"></span>
<span class="cp">{{</span><span class="o">-</span> <span class="err">$</span><span class="nv">cert</span> <span class="o">:=</span> <span class="nv">genSignedCert</span> <span class="err">$</span><span class="nv">cn</span> <span class="nv">nil</span> <span class="nv">nil</span> <span class="nv">.Values.validatingWebhook.certificateValidity</span> <span class="err">$</span><span class="nv">ca</span> -<span class="cp">}}</span><span class="x"></span> <span class="cp">{{</span><span class="o">-</span> <span class="err">$</span><span class="nv">cert</span> <span class="o">:=</span> <span class="nv">genSignedCert</span> <span class="err">$</span><span class="nv">cn</span> <span class="nv">nil</span> <span class="nv">nil</span> <span class="nv">.Values.validatingWebhook.certificateValidity</span> <span class="err">$</span><span class="nv">ca</span> -<span class="cp">}}</span><span class="x"></span>
</pre></div> </code></pre></div>
</div> </div>
<h3 id="ingress-controller-flags">Ingress controller flags<a class="headerlink" href="#ingress-controller-flags" title="Permanent link"></a></h3> <h3 id="ingress-controller-flags">Ingress controller flags<a class="headerlink" href="#ingress-controller-flags" title="Permanent link"></a></h3>
@ -1448,19 +1448,19 @@ kubectl create secret generic ingress-nginx.svc <span class="se">\</span>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td><code class="codehilite">--validating-webhook</code></td> <td><code class="codehilite"><span class="err">--validating-webhook</span></code></td>
<td>The address to start an admission controller on</td> <td>The address to start an admission controller on</td>
<td><code class="codehilite">:8080</code></td> <td><code class="codehilite"><span class="err">:8080</span></code></td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--validating-webhook-certificate</code></td> <td><code class="codehilite"><span class="err">--validating-webhook-certificate</span></code></td>
<td>The certificate the webhook is using for its TLS handling</td> <td>The certificate the webhook is using for its TLS handling</td>
<td><code class="codehilite">/usr/local/certificates/validating-webhook.pem</code></td> <td><code class="codehilite"><span class="err">/usr/local/certificates/validating-webhook.pem</span></code></td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--validating-webhook-key</code></td> <td><code class="codehilite"><span class="err">--validating-webhook-key</span></code></td>
<td>The key the webhook is using for its TLS handling</td> <td>The key the webhook is using for its TLS handling</td>
<td><code class="codehilite">/usr/local/certificates/validating-webhook-key.pem</code></td> <td><code class="codehilite"><span class="err">/usr/local/certificates/validating-webhook-key.pem</span></code></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -1469,7 +1469,7 @@ kubectl create secret generic ingress-nginx.svc <span class="se">\</span>
To check that your kube API server runs with the required flags, please refer to the <a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#validatingadmissionwebhook">kubernetes</a> documentation.</p> To check that your kube API server runs with the required flags, please refer to the <a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#validatingadmissionwebhook">kubernetes</a> documentation.</p>
<h3 id="additional-kubernetes-objects">Additional kubernetes objects<a class="headerlink" href="#additional-kubernetes-objects" title="Permanent link"></a></h3> <h3 id="additional-kubernetes-objects">Additional kubernetes objects<a class="headerlink" href="#additional-kubernetes-objects" title="Permanent link"></a></h3>
<p>Once both the ingress controller and the kube API server are configured to serve the webhook, add the you can configure the webhook with the following objects:</p> <p>Once both the ingress controller and the kube API server are configured to serve the webhook, add the you can configure the webhook with the following objects:</p>
<div class="codehilite"><pre><span></span><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span> <div class="codehilite"><pre><span></span><code><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span>
<span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Service</span> <span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Service</span>
<span class="nt">metadata</span><span class="p">:</span> <span class="nt">metadata</span><span class="p">:</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress-validation-webhook</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress-validation-webhook</span>
@ -1507,7 +1507,8 @@ To check that your kube API server runs with the required flags, please refer to
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress-validation-webhook</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress-validation-webhook</span>
<span class="nt">path</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">/networking.k8s.io/v1beta1/ingress</span> <span class="nt">path</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">/networking.k8s.io/v1beta1/ingress</span>
<span class="nt">caBundle</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">&lt;pem encoded ca cert that signs the server cert used by the webhook&gt;</span> <span class="nt">caBundle</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">&lt;pem encoded ca cert that signs the server cert used by the webhook&gt;</span>
</pre></div> </code></pre></div>
@ -1565,9 +1566,9 @@ To check that your kube API server runs with the required flags, please refer to
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1577,7 +1578,7 @@ To check that your kube API server runs with the required flags, please refer to
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../assets/images/favicon.png"> <link rel="shortcut icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../assets/javascripts/modernizr.74668098.js"></script> <script src="../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#developing-for-nginx-ingress-controller" tabindex="1" class="md-skip"> <a href="#developing-for-nginx-ingress-controller" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1363,112 +1363,112 @@ It includes how to build, test, and release ingress controllers.</p>
<h2 id="quick-start">Quick Start<a class="headerlink" href="#quick-start" title="Permanent link"></a></h2> <h2 id="quick-start">Quick Start<a class="headerlink" href="#quick-start" title="Permanent link"></a></h2>
<h3 id="getting-the-code">Getting the code<a class="headerlink" href="#getting-the-code" title="Permanent link"></a></h3> <h3 id="getting-the-code">Getting the code<a class="headerlink" href="#getting-the-code" title="Permanent link"></a></h3>
<p>The code must be checked out as a subdirectory of k8s.io, and not github.com.</p> <p>The code must be checked out as a subdirectory of k8s.io, and not github.com.</p>
<div class="codehilite"><pre><span></span>mkdir -p $GOPATH/src/k8s.io <div class="codehilite"><pre><span></span><code><span class="err">mkdir -p $GOPATH/src/k8s.io</span>
cd $GOPATH/src/k8s.io <span class="err">cd $GOPATH/src/k8s.io</span>
# Replace &quot;$YOUR_GITHUB_USERNAME&quot; below with your github username <span class="err"># Replace &quot;$YOUR_GITHUB_USERNAME&quot; below with your github username</span>
git clone https://github.com/$YOUR_GITHUB_USERNAME/ingress-nginx.git <span class="err">git clone https://github.com/$YOUR_GITHUB_USERNAME/ingress-nginx.git</span>
cd ingress-nginx <span class="err">cd ingress-nginx</span>
</pre></div> </code></pre></div>
<h3 id="initial-developer-environment-build">Initial developer environment build<a class="headerlink" href="#initial-developer-environment-build" title="Permanent link"></a></h3> <h3 id="initial-developer-environment-build">Initial developer environment build<a class="headerlink" href="#initial-developer-environment-build" title="Permanent link"></a></h3>
<blockquote> <blockquote>
<p><strong>Prequisites</strong>: Minikube must be installed. <p><strong>Prequisites</strong>: Minikube must be installed.
See <a href="https://github.com/kubernetes/minikube/releases">releases</a> for installation instructions.</p> See <a href="https://github.com/kubernetes/minikube/releases">releases</a> for installation instructions.</p>
</blockquote> </blockquote>
<p>If you are using <strong>MacOS</strong> and deploying to <strong>minikube</strong>, the following command will build the local nginx controller container image and deploy the ingress controller onto a minikube cluster with RBAC enabled in the namespace <code class="codehilite">ingress-nginx</code>:</p> <p>If you are using <strong>MacOS</strong> and deploying to <strong>minikube</strong>, the following command will build the local nginx controller container image and deploy the ingress controller onto a minikube cluster with RBAC enabled in the namespace <code class="codehilite"><span class="err">ingress-nginx</span></code>:</p>
<div class="codehilite"><pre><span></span>$ make dev-env <div class="codehilite"><pre><span></span><code>$ make dev-env
</pre></div> </code></pre></div>
<h3 id="updating-the-deployment">Updating the deployment<a class="headerlink" href="#updating-the-deployment" title="Permanent link"></a></h3> <h3 id="updating-the-deployment">Updating the deployment<a class="headerlink" href="#updating-the-deployment" title="Permanent link"></a></h3>
<p>The nginx controller container image can be rebuilt using: <p>The nginx controller container image can be rebuilt using:
<div class="codehilite"><pre><span></span>$ <span class="nv">ARCH</span><span class="o">=</span>amd64 <span class="nv">TAG</span><span class="o">=</span>dev <span class="nv">REGISTRY</span><span class="o">=</span><span class="nv">$USER</span>/ingress-controller make build container <div class="codehilite"><pre><span></span><code>$ <span class="nv">ARCH</span><span class="o">=</span>amd64 <span class="nv">TAG</span><span class="o">=</span>dev <span class="nv">REGISTRY</span><span class="o">=</span><span class="nv">$USER</span>/ingress-controller make build container
</pre></div></p> </code></pre></div></p>
<p>The image will only be used by pods created after the rebuild. To delete old pods which will cause new ones to spin up: <p>The image will only be used by pods created after the rebuild. To delete old pods which will cause new ones to spin up:
<div class="codehilite"><pre><span></span>$ kubectl get pods -n ingress-nginx <div class="codehilite"><pre><span></span><code>$ kubectl get pods -n ingress-nginx
$ kubectl delete pod -n ingress-nginx nginx-ingress-controller-&lt;unique-pod-id&gt; $ kubectl delete pod -n ingress-nginx nginx-ingress-controller-&lt;unique-pod-id&gt;
</pre></div></p> </code></pre></div></p>
<h2 id="dependencies">Dependencies<a class="headerlink" href="#dependencies" title="Permanent link"></a></h2> <h2 id="dependencies">Dependencies<a class="headerlink" href="#dependencies" title="Permanent link"></a></h2>
<p>The build uses dependencies in the <code class="codehilite">vendor</code> directory, which <p>The build uses dependencies in the <code class="codehilite"><span class="err">vendor</span></code> directory, which
must be installed before building a binary/image. Occasionally, you must be installed before building a binary/image. Occasionally, you
might need to update the dependencies.</p> might need to update the dependencies.</p>
<p>This guide requires you to install go 1.13 or newer.</p> <p>This guide requires you to install go 1.13 or newer.</p>
<p>This will automatically save the dependencies to the <code class="codehilite">vendor/</code> directory.</p> <p>This will automatically save the dependencies to the <code class="codehilite"><span class="err">vendor/</span></code> directory.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> go get <div class="codehilite"><pre><span></span><code><span class="gp">$</span> go get
<span class="gp">$</span> make dep-ensure <span class="gp">$</span> make dep-ensure
</pre></div> </code></pre></div>
<h2 id="building">Building<a class="headerlink" href="#building" title="Permanent link"></a></h2> <h2 id="building">Building<a class="headerlink" href="#building" title="Permanent link"></a></h2>
<p>All ingress controllers are built through a Makefile. Depending on your <p>All ingress controllers are built through a Makefile. Depending on your
requirements you can build a raw server binary, a local container image, requirements you can build a raw server binary, a local container image,
or push an image to a remote repository.</p> or push an image to a remote repository.</p>
<p>In order to use your local Docker, you may need to set the following environment variables:</p> <p>In order to use your local Docker, you may need to set the following environment variables:</p>
<div class="codehilite"><pre><span></span><span class="gp">#</span> <span class="s2">&quot;gcloud docker&quot;</span> <span class="o">(</span>default<span class="o">)</span> or <span class="s2">&quot;docker&quot;</span> <div class="codehilite"><pre><span></span><code><span class="gp">#</span> <span class="s2">&quot;gcloud docker&quot;</span> <span class="o">(</span>default<span class="o">)</span> or <span class="s2">&quot;docker&quot;</span>
<span class="gp">$</span> <span class="nb">export</span> <span class="nv">DOCKER</span><span class="o">=</span>&lt;docker&gt; <span class="gp">$</span> <span class="nb">export</span> <span class="nv">DOCKER</span><span class="o">=</span>&lt;docker&gt;
<span class="gp">#</span> <span class="s2">&quot;quay.io/kubernetes-ingress-controller&quot;</span> <span class="o">(</span>default<span class="o">)</span>, <span class="s2">&quot;index.docker.io&quot;</span>, or your own registry <span class="gp">#</span> <span class="s2">&quot;quay.io/kubernetes-ingress-controller&quot;</span> <span class="o">(</span>default<span class="o">)</span>, <span class="s2">&quot;index.docker.io&quot;</span>, or your own registry
<span class="gp">$</span> <span class="nb">export</span> <span class="nv">REGISTRY</span><span class="o">=</span>&lt;your-docker-registry&gt; <span class="gp">$</span> <span class="nb">export</span> <span class="nv">REGISTRY</span><span class="o">=</span>&lt;your-docker-registry&gt;
</pre></div> </code></pre></div>
<p>To find the registry simply run: <code class="codehilite">docker system info | grep Registry</code></p> <p>To find the registry simply run: <code class="codehilite"><span class="err">docker system info | grep Registry</span></code></p>
<h3 id="building-the-e2e-test-image">Building the e2e test image<a class="headerlink" href="#building-the-e2e-test-image" title="Permanent link"></a></h3> <h3 id="building-the-e2e-test-image">Building the e2e test image<a class="headerlink" href="#building-the-e2e-test-image" title="Permanent link"></a></h3>
<p>The e2e test image can also be built through the Makefile.</p> <p>The e2e test image can also be built through the Makefile.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> make e2e-test-image <div class="codehilite"><pre><span></span><code><span class="gp">$</span> make e2e-test-image
</pre></div> </code></pre></div>
<p>You can then make this image available on your minikube host by exporting the image and loading it with the minikube docker context:</p> <p>You can then make this image available on your minikube host by exporting the image and loading it with the minikube docker context:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> docker save nginx-ingress-controller:e2e <span class="p">|</span> <span class="o">(</span><span class="nb">eval</span> <span class="k">$(</span>minikube docker-env<span class="k">)</span> <span class="o">&amp;&amp;</span> docker load<span class="o">)</span> <div class="codehilite"><pre><span></span><code><span class="gp">$</span> docker save nginx-ingress-controller:e2e <span class="p">|</span> <span class="o">(</span><span class="nb">eval</span> <span class="k">$(</span>minikube docker-env<span class="k">)</span> <span class="o">&amp;&amp;</span> docker load<span class="o">)</span>
</pre></div> </code></pre></div>
<h3 id="nginx-controller">Nginx Controller<a class="headerlink" href="#nginx-controller" title="Permanent link"></a></h3> <h3 id="nginx-controller">Nginx Controller<a class="headerlink" href="#nginx-controller" title="Permanent link"></a></h3>
<p>Build a raw server binary <p>Build a raw server binary
<div class="codehilite"><pre><span></span><span class="gp">$</span> make build <div class="codehilite"><pre><span></span><code><span class="gp">$</span> make build
</pre></div></p> </code></pre></div></p>
<p><a href="https://github.com/kubernetes/ingress-nginx/issues/387">TODO</a>: add more specific instructions needed for raw server binary.</p> <p><a href="https://github.com/kubernetes/ingress-nginx/issues/387">TODO</a>: add more specific instructions needed for raw server binary.</p>
<p>Build a local container image</p> <p>Build a local container image</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> <span class="nv">TAG</span><span class="o">=</span>&lt;tag&gt; <span class="nv">REGISTRY</span><span class="o">=</span><span class="nv">$USER</span>/ingress-controller make container <div class="codehilite"><pre><span></span><code><span class="gp">$</span> <span class="nv">TAG</span><span class="o">=</span>&lt;tag&gt; <span class="nv">REGISTRY</span><span class="o">=</span><span class="nv">$USER</span>/ingress-controller make container
</pre></div> </code></pre></div>
<p>Push the container image to a remote repository</p> <p>Push the container image to a remote repository</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> <span class="nv">TAG</span><span class="o">=</span>&lt;tag&gt; <span class="nv">REGISTRY</span><span class="o">=</span><span class="nv">$USER</span>/ingress-controller make push <div class="codehilite"><pre><span></span><code><span class="gp">$</span> <span class="nv">TAG</span><span class="o">=</span>&lt;tag&gt; <span class="nv">REGISTRY</span><span class="o">=</span><span class="nv">$USER</span>/ingress-controller make push
</pre></div> </code></pre></div>
<h2 id="deploying">Deploying<a class="headerlink" href="#deploying" title="Permanent link"></a></h2> <h2 id="deploying">Deploying<a class="headerlink" href="#deploying" title="Permanent link"></a></h2>
<p>There are several ways to deploy the ingress controller onto a cluster. <p>There are several ways to deploy the ingress controller onto a cluster.
Please check the <a href="../deploy/">deployment guide</a></p> Please check the <a href="../deploy/">deployment guide</a></p>
<h2 id="testing">Testing<a class="headerlink" href="#testing" title="Permanent link"></a></h2> <h2 id="testing">Testing<a class="headerlink" href="#testing" title="Permanent link"></a></h2>
<p>To run unit-tests, just run</p> <p>To run unit-tests, just run</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> <span class="nb">cd</span> <span class="nv">$GOPATH</span>/src/k8s.io/ingress-nginx <div class="codehilite"><pre><span></span><code><span class="gp">$</span> <span class="nb">cd</span> <span class="nv">$GOPATH</span>/src/k8s.io/ingress-nginx
<span class="gp">$</span> make <span class="nb">test</span> <span class="gp">$</span> make <span class="nb">test</span>
</pre></div> </code></pre></div>
<p>If you have access to a Kubernetes cluster, you can also run e2e tests using ginkgo.</p> <p>If you have access to a Kubernetes cluster, you can also run e2e tests using ginkgo.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> <span class="nb">cd</span> <span class="nv">$GOPATH</span>/src/k8s.io/ingress-nginx <div class="codehilite"><pre><span></span><code><span class="gp">$</span> <span class="nb">cd</span> <span class="nv">$GOPATH</span>/src/k8s.io/ingress-nginx
<span class="gp">$</span> make e2e-test <span class="gp">$</span> make e2e-test
</pre></div> </code></pre></div>
<p>NOTE: if your e2e pod keeps hanging in an ImagePullBackoff, make sure you've made your e2e nginx-ingress-controller image available to minikube as explained in the <strong>Building the e2e test image</strong> section</p> <p>NOTE: if your e2e pod keeps hanging in an ImagePullBackoff, make sure you've made your e2e nginx-ingress-controller image available to minikube as explained in the <strong>Building the e2e test image</strong> section</p>
<p>To run unit-tests for lua code locally, run:</p> <p>To run unit-tests for lua code locally, run:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> <span class="nb">cd</span> <span class="nv">$GOPATH</span>/src/k8s.io/ingress-nginx <div class="codehilite"><pre><span></span><code><span class="gp">$</span> <span class="nb">cd</span> <span class="nv">$GOPATH</span>/src/k8s.io/ingress-nginx
<span class="gp">$</span> ./rootfs/etc/nginx/lua/test/up.sh <span class="gp">$</span> ./rootfs/etc/nginx/lua/test/up.sh
<span class="gp">$</span> make lua-test <span class="gp">$</span> make lua-test
</pre></div> </code></pre></div>
<p>Lua tests are located in <code class="codehilite">$GOPATH/src/k8s.io/ingress-nginx/rootfs/etc/nginx/lua/test</code>. When creating a new test file it must follow the naming convention <code class="codehilite">&lt;mytest&gt;_test.lua</code> or it will be ignored.</p> <p>Lua tests are located in <code class="codehilite"><span class="err">$GOPATH/src/k8s.io/ingress-nginx/rootfs/etc/nginx/lua/test</span></code>. When creating a new test file it must follow the naming convention <code class="codehilite"><span class="err">&lt;mytest&gt;_test.lua</span></code> or it will be ignored.</p>
<h2 id="releasing">Releasing<a class="headerlink" href="#releasing" title="Permanent link"></a></h2> <h2 id="releasing">Releasing<a class="headerlink" href="#releasing" title="Permanent link"></a></h2>
<p>All Makefiles will produce a release binary, as shown above. To publish this <p>All Makefiles will produce a release binary, as shown above. To publish this
to a wider Kubernetes user base, push the image to a container registry, like to a wider Kubernetes user base, push the image to a container registry, like
<a href="https://cloud.google.com/container-registry/">gcr.io</a>. All release images are hosted under <code class="codehilite">gcr.io/google_containers</code> and <a href="https://cloud.google.com/container-registry/">gcr.io</a>. All release images are hosted under <code class="codehilite"><span class="err">gcr.io/google_containers</span></code> and
tagged according to a <a href="http://semver.org/">semver</a> scheme.</p> tagged according to a <a href="http://semver.org/">semver</a> scheme.</p>
<p>An example release might look like: <p>An example release might look like:
<div class="codehilite"><pre><span></span>$ make release <div class="codehilite"><pre><span></span><code>$ make release
</pre></div></p> </code></pre></div></p>
<p>Please follow these guidelines to cut a release:</p> <p>Please follow these guidelines to cut a release:</p>
<ul> <ul>
<li>Update the <a href="https://help.github.com/articles/creating-releases/">release</a> <li>Update the <a href="https://help.github.com/articles/creating-releases/">release</a>
page with a short description of the major changes that correspond to a given page with a short description of the major changes that correspond to a given
image tag.</li> image tag.</li>
<li>Cut a release branch, if appropriate. Release branches follow the format of <li>Cut a release branch, if appropriate. Release branches follow the format of
<code class="codehilite">controller-release-version</code>. Typically, pre-releases are cut from HEAD. <code class="codehilite"><span class="err">controller-release-version</span></code>. Typically, pre-releases are cut from HEAD.
All major feature work is done in HEAD. Specific bug fixes are All major feature work is done in HEAD. Specific bug fixes are
cherry-picked into a release branch.</li> cherry-picked into a release branch.</li>
<li>If you're not confident about the stability of the code, <li>If you're not confident about the stability of the code,
@ -1484,6 +1484,7 @@ Typically, a release branch should have stable code.</li>
</article> </article>
</div> </div>
</div> </div>
@ -1532,9 +1533,9 @@ Typically, a release branch should have stable code.</li>
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1544,7 +1545,7 @@ Typically, a release branch should have stable code.</li>
</div> </div>
<script src="../assets/javascripts/application.ac79c3b0.js"></script> <script src="../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script> <script>app.initialize({version:"1.0.4",url:{base:".."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#remove-static-ssl-configuration-mode" tabindex="1" class="md-skip"> <a href="#remove-static-ssl-configuration-mode" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1240,7 +1240,7 @@
<p>The static configuration implies reloads, something that affects the majority of the users.</p> <p>The static configuration implies reloads, something that affects the majority of the users.</p>
<h3 id="goals">Goals<a class="headerlink" href="#goals" title="Permanent link"></a></h3> <h3 id="goals">Goals<a class="headerlink" href="#goals" title="Permanent link"></a></h3>
<ul> <ul>
<li>Deprecation of the flag <code class="codehilite">--enable-dynamic-certificates</code>.</li> <li>Deprecation of the flag <code class="codehilite"><span class="err">--enable-dynamic-certificates</span></code>.</li>
<li>Cleanup of the codebase.</li> <li>Cleanup of the codebase.</li>
</ul> </ul>
<h3 id="non-goals">Non-Goals<a class="headerlink" href="#non-goals" title="Permanent link"></a></h3> <h3 id="non-goals">Non-Goals<a class="headerlink" href="#non-goals" title="Permanent link"></a></h3>
@ -1253,8 +1253,8 @@
</ul> </ul>
<h3 id="implementation-detailsnotesconstraints">Implementation Details/Notes/Constraints<a class="headerlink" href="#implementation-detailsnotesconstraints" title="Permanent link"></a></h3> <h3 id="implementation-detailsnotesconstraints">Implementation Details/Notes/Constraints<a class="headerlink" href="#implementation-detailsnotesconstraints" title="Permanent link"></a></h3>
<ul> <ul>
<li>Deprecate the flag Move the directives <code class="codehilite">ssl_certificate</code> and <code class="codehilite">ssl_certificate_key</code> from each server block to the <code class="codehilite">http</code> section. These settings are required to avoid NGINX errors in the logs.</li> <li>Deprecate the flag Move the directives <code class="codehilite"><span class="err">ssl_certificate</span></code> and <code class="codehilite"><span class="err">ssl_certificate_key</span></code> from each server block to the <code class="codehilite"><span class="err">http</span></code> section. These settings are required to avoid NGINX errors in the logs.</li>
<li>Remove any action of the flag <code class="codehilite">--enable-dynamic-certificates</code></li> <li>Remove any action of the flag <code class="codehilite"><span class="err">--enable-dynamic-certificates</span></code></li>
</ul> </ul>
<h2 id="drawbacks">Drawbacks<a class="headerlink" href="#drawbacks" title="Permanent link"></a></h2> <h2 id="drawbacks">Drawbacks<a class="headerlink" href="#drawbacks" title="Permanent link"></a></h2>
<h2 id="alternatives">Alternatives<a class="headerlink" href="#alternatives" title="Permanent link"></a></h2> <h2 id="alternatives">Alternatives<a class="headerlink" href="#alternatives" title="Permanent link"></a></h2>
@ -1268,6 +1268,7 @@
</article> </article>
</div> </div>
</div> </div>
@ -1281,9 +1282,9 @@
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1293,7 +1294,7 @@
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#availability-zone-aware-routing" tabindex="1" class="md-skip"> <a href="#availability-zone-aware-routing" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1250,13 +1250,13 @@ if there is no zone-local endpoint then it will fallback to current behaviour.</
<p><strong>How does controller know what zone it runs in?</strong> <p><strong>How does controller know what zone it runs in?</strong>
We can have the pod spec do pass node name using downward API as an environment variable. We can have the pod spec do pass node name using downward API as an environment variable.
Then on start controller can get node details from the API based on node name. Once the node details is obtained Then on start controller can get node details from the API based on node name. Once the node details is obtained
we can extract the zone from <code class="codehilite">failure-domain.beta.kubernetes.io/zone</code> annotation. Then we can pass that value to Lua land through Nginx configuration we can extract the zone from <code class="codehilite"><span class="err">failure-domain.beta.kubernetes.io/zone</span></code> annotation. Then we can pass that value to Lua land through Nginx configuration
when loading <code class="codehilite">lua_ingress.lua</code> module in <code class="codehilite">init_by_lua</code> phase.</p> when loading <code class="codehilite"><span class="err">lua_ingress.lua</span></code> module in <code class="codehilite"><span class="err">init_by_lua</span></code> phase.</p>
<p><strong>How do we extract zones for endpoints?</strong> <p><strong>How do we extract zones for endpoints?</strong>
We can have the controller watch create and update events on nodes in the entire cluster and based on that keep the map of nodes to zones in the memory. We can have the controller watch create and update events on nodes in the entire cluster and based on that keep the map of nodes to zones in the memory.
And when we generate endpoints list, we can access node name using <code class="codehilite"><span class="na">.subsets.addresses</span><span class="p">[</span><span class="no">i</span><span class="p">].</span><span class="no">nodeName</span></code> And when we generate endpoints list, we can access node name using <code class="codehilite"><span class="p">.</span><span class="n">subsets</span><span class="p">.</span><span class="n">addresses</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="p">.</span><span class="n">nodeName</span><span class="w"></span></code>
and based on that fetch zone from the map in memory and store it as a field on the endpoint. and based on that fetch zone from the map in memory and store it as a field on the endpoint.
<strong>This solution assumes <code class="codehilite">failure-domain.beta.kubernetes.io/zone</code></strong> annotation does not change until the end of node's life. Otherwise we have to <strong>This solution assumes <code class="codehilite"><span class="err">failure-domain.beta.kubernetes.io/zone</span></code></strong> annotation does not change until the end of node's life. Otherwise we have to
watch update events as well on the nodes and that'll add even more overhead.</p> watch update events as well on the nodes and that'll add even more overhead.</p>
<p>Alternatively, we can get the list of nodes only when there's no node in the memory for given node name. This is probably a better solution <p>Alternatively, we can get the list of nodes only when there's no node in the memory for given node name. This is probably a better solution
because then we would avoid watching for API changes on node resources. We can eagrly fetch all the nodes and build node name to zone mapping on start. because then we would avoid watching for API changes on node resources. We can eagrly fetch all the nodes and build node name to zone mapping on start.
@ -1285,6 +1285,7 @@ see no endpoints for the backend and therefore we will use general balancer.</p>
</article> </article>
</div> </div>
</div> </div>
@ -1298,9 +1299,9 @@ see no endpoints for the backend and therefore we will use general balancer.</p>
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1310,7 +1311,7 @@ see no endpoints for the backend and therefore we will use general balancer.</p>
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#title" tabindex="1" class="md-skip"> <a href="#title" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1297,11 +1297,11 @@
<p>This is the title of the KEP. <p>This is the title of the KEP.
Keep it simple and descriptive. Keep it simple and descriptive.
A good title can help communicate what the KEP is and should be considered as part of any review.</p> A good title can help communicate what the KEP is and should be considered as part of any review.</p>
<p>The title should be lowercased and spaces/punctuation should be replaced with <code class="codehilite">-</code>.</p> <p>The title should be lowercased and spaces/punctuation should be replaced with <code class="codehilite"><span class="err">-</span></code>.</p>
<p>To get started with this template:</p> <p>To get started with this template:</p>
<ol> <ol>
<li><strong>Make a copy of this template.</strong> <li><strong>Make a copy of this template.</strong>
Create a copy of this template and name it <code class="codehilite">YYYYMMDD-my-title.md</code>, where <code class="codehilite">YYYYMMDD</code> is the date the KEP was first drafted.</li> Create a copy of this template and name it <code class="codehilite"><span class="err">YYYYMMDD-my-title.md</span></code>, where <code class="codehilite"><span class="err">YYYYMMDD</span></code> is the date the KEP was first drafted.</li>
<li><strong>Fill out the "overview" sections.</strong> <li><strong>Fill out the "overview" sections.</strong>
This includes the Summary and Motivation sections. This includes the Summary and Motivation sections.
These should be easy if you've preflighted the idea of the KEP in an issue.</li> These should be easy if you've preflighted the idea of the KEP in an issue.</li>
@ -1312,17 +1312,17 @@ A good title can help communicate what the KEP is and should be considered as pa
<li><strong>Merge early.</strong> <li><strong>Merge early.</strong>
Avoid getting hung up on specific details and instead aim to get the goal of the KEP merged quickly. Avoid getting hung up on specific details and instead aim to get the goal of the KEP merged quickly.
The best way to do this is to just start with the "Overview" sections and fill out details incrementally in follow on PRs. The best way to do this is to just start with the "Overview" sections and fill out details incrementally in follow on PRs.
View anything marked as a <code class="codehilite">provisional</code> as a working document and subject to change. View anything marked as a <code class="codehilite"><span class="err">provisional</span></code> as a working document and subject to change.
Aim for single topic PRs to keep discussions focused. Aim for single topic PRs to keep discussions focused.
If you disagree with what is already in a document, open a new PR with suggested changes.</li> If you disagree with what is already in a document, open a new PR with suggested changes.</li>
</ol> </ol>
<p>The canonical place for the latest set of instructions (and the likely source of this file) is <a href="/keps/YYYYMMDD-kep-template.md">here</a>.</p> <p>The canonical place for the latest set of instructions (and the likely source of this file) is <a href="/keps/YYYYMMDD-kep-template.md">here</a>.</p>
<p>The <code class="codehilite">Metadata</code> section above is intended to support the creation of tooling around the KEP process. <p>The <code class="codehilite"><span class="err">Metadata</span></code> section above is intended to support the creation of tooling around the KEP process.
This will be a YAML section that is fenced as a code block. This will be a YAML section that is fenced as a code block.
See the KEP process for details on each of these items.</p> See the KEP process for details on each of these items.</p>
<h2 id="table-of-contents">Table of Contents<a class="headerlink" href="#table-of-contents" title="Permanent link"></a></h2> <h2 id="table-of-contents">Table of Contents<a class="headerlink" href="#table-of-contents" title="Permanent link"></a></h2>
<p>A table of contents is helpful for quickly jumping to sections of a KEP and for highlighting any additional information provided beyond the standard KEP template.</p> <p>A table of contents is helpful for quickly jumping to sections of a KEP and for highlighting any additional information provided beyond the standard KEP template.</p>
<p>Ensure the TOC is wrapped with <code>&lt;!-- toc --&rt;&lt;!-- /toc --&rt;</code> tags, and then generate with <code class="codehilite">hack/update-toc.sh</code>.</p> <p>Ensure the TOC is wrapped with <code>&lt;!-- toc --&rt;&lt;!-- /toc --&rt;</code> tags, and then generate with <code class="codehilite"><span class="err">hack/update-toc.sh</span></code>.</p>
<!-- toc --> <!-- toc -->
<ul> <ul>
@ -1349,7 +1349,7 @@ See the KEP process for details on each of these items.</p>
<!-- /toc --></li> <!-- /toc --></li>
</ul> </ul>
<h2 id="summary">Summary<a class="headerlink" href="#summary" title="Permanent link"></a></h2> <h2 id="summary">Summary<a class="headerlink" href="#summary" title="Permanent link"></a></h2>
<p>The <code class="codehilite">Summary</code> section is incredibly important for producing high quality user-focused documentation such as release notes or a development roadmap. <p>The <code class="codehilite"><span class="err">Summary</span></code> section is incredibly important for producing high quality user-focused documentation such as release notes or a development roadmap.
It should be possible to collect this information before implementation begins in order to avoid requiring implementors to split their attention between writing release notes and implementing the feature itself.</p> It should be possible to collect this information before implementation begins in order to avoid requiring implementors to split their attention between writing release notes and implementing the feature itself.</p>
<p>A good summary is probably at least a paragraph in length.</p> <p>A good summary is probably at least a paragraph in length.</p>
<h2 id="motivation">Motivation<a class="headerlink" href="#motivation" title="Permanent link"></a></h2> <h2 id="motivation">Motivation<a class="headerlink" href="#motivation" title="Permanent link"></a></h2>
@ -1402,11 +1402,11 @@ Please adhere to the <a href="https://git.k8s.io/community/contributors/devel/si
<li>Deprecate the flag</li> <li>Deprecate the flag</li>
</ul> </ul>
<h2 id="implementation-history">Implementation History<a class="headerlink" href="#implementation-history" title="Permanent link"></a></h2> <h2 id="implementation-history">Implementation History<a class="headerlink" href="#implementation-history" title="Permanent link"></a></h2>
<p>Major milestones in the life cycle of a KEP should be tracked in <code class="codehilite">Implementation History</code>. <p>Major milestones in the life cycle of a KEP should be tracked in <code class="codehilite"><span class="err">Implementation History</span></code>.
Major milestones might include</p> Major milestones might include</p>
<ul> <ul>
<li>the <code class="codehilite">Summary</code> and <code class="codehilite">Motivation</code> sections being merged signaling acceptance</li> <li>the <code class="codehilite"><span class="err">Summary</span></code> and <code class="codehilite"><span class="err">Motivation</span></code> sections being merged signaling acceptance</li>
<li>the <code class="codehilite">Proposal</code> section being merged signaling agreement on a proposed design</li> <li>the <code class="codehilite"><span class="err">Proposal</span></code> section being merged signaling agreement on a proposed design</li>
<li>the date implementation started</li> <li>the date implementation started</li>
<li>the first Kubernetes release where an initial version of the KEP was available</li> <li>the first Kubernetes release where an initial version of the KEP was available</li>
<li>the version of Kubernetes where the KEP graduated to general availability</li> <li>the version of Kubernetes where the KEP graduated to general availability</li>
@ -1415,7 +1415,8 @@ Major milestones might include</p>
<h2 id="drawbacks-optional">Drawbacks [optional]<a class="headerlink" href="#drawbacks-optional" title="Permanent link"></a></h2> <h2 id="drawbacks-optional">Drawbacks [optional]<a class="headerlink" href="#drawbacks-optional" title="Permanent link"></a></h2>
<p>Why should this KEP <em>not</em> be implemented.</p> <p>Why should this KEP <em>not</em> be implemented.</p>
<h2 id="alternatives-optional">Alternatives [optional]<a class="headerlink" href="#alternatives-optional" title="Permanent link"></a></h2> <h2 id="alternatives-optional">Alternatives [optional]<a class="headerlink" href="#alternatives-optional" title="Permanent link"></a></h2>
<p>Similar to the <code class="codehilite">Drawbacks</code> section the <code class="codehilite">Alternatives</code> section is used to highlight and record other possible approaches to delivering the value proposed by a KEP.</p> <p>Similar to the <code class="codehilite"><span class="err">Drawbacks</span></code> section the <code class="codehilite"><span class="err">Alternatives</span></code> section is used to highlight and record other possible approaches to delivering the value proposed by a KEP.</p>
@ -1438,9 +1439,9 @@ Major milestones might include</p>
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1450,7 +1451,7 @@ Major milestones might include</p>
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../assets/images/favicon.png"> <link rel="shortcut icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../assets/javascripts/modernizr.74668098.js"></script> <script src="../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#kubernetes-enhancement-proposals-keps" tabindex="1" class="md-skip"> <a href="#kubernetes-enhancement-proposals-keps" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1172,7 +1172,7 @@
<h1 id="kubernetes-enhancement-proposals-keps">Kubernetes Enhancement Proposals (KEPs)<a class="headerlink" href="#kubernetes-enhancement-proposals-keps" title="Permanent link"></a></h1> <h1 id="kubernetes-enhancement-proposals-keps">Kubernetes Enhancement Proposals (KEPs)<a class="headerlink" href="#kubernetes-enhancement-proposals-keps" title="Permanent link"></a></h1>
<p>A Kubernetes Enhancement Proposal (KEP) is a way to propose, communicate and coordinate on new efforts for the Kubernetes project. For this reason, the <code class="codehilite">ingress-nginx</code> project is adopting it.</p> <p>A Kubernetes Enhancement Proposal (KEP) is a way to propose, communicate and coordinate on new efforts for the Kubernetes project. For this reason, the <code class="codehilite"><span class="err">ingress-nginx</span></code> project is adopting it.</p>
<h2 id="quick-start-for-the-kep-process">Quick start for the KEP process<a class="headerlink" href="#quick-start-for-the-kep-process" title="Permanent link"></a></h2> <h2 id="quick-start-for-the-kep-process">Quick start for the KEP process<a class="headerlink" href="#quick-start-for-the-kep-process" title="Permanent link"></a></h2>
<p>Follow the process outlined in the <a href="YYYYMMDD-kep-template/">KEP template</a></p> <p>Follow the process outlined in the <a href="YYYYMMDD-kep-template/">KEP template</a></p>
<h3 id="do-i-have-to-use-the-kep-process">Do I have to use the KEP process?<a class="headerlink" href="#do-i-have-to-use-the-kep-process" title="Permanent link"></a></h3> <h3 id="do-i-have-to-use-the-kep-process">Do I have to use the KEP process?<a class="headerlink" href="#do-i-have-to-use-the-kep-process" title="Permanent link"></a></h3>
@ -1199,6 +1199,7 @@ As such, we want to build a well curated set of clear proposals in a common form
</article> </article>
</div> </div>
</div> </div>
@ -1212,9 +1213,9 @@ As such, we want to build a well curated set of clear proposals in a common form
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1224,7 +1225,7 @@ As such, we want to build a well curated set of clear proposals in a common form
</div> </div>
<script src="../assets/javascripts/application.ac79c3b0.js"></script> <script src="../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script> <script>app.initialize({version:"1.0.4",url:{base:".."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#prerequisites" tabindex="1" class="md-skip"> <a href="#prerequisites" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1226,7 +1226,7 @@
<h2 id="tls-certificates">TLS certificates<a class="headerlink" href="#tls-certificates" title="Permanent link"></a></h2> <h2 id="tls-certificates">TLS certificates<a class="headerlink" href="#tls-certificates" title="Permanent link"></a></h2>
<p>Unless otherwise mentioned, the TLS secret used in examples is a 2048 bit RSA <p>Unless otherwise mentioned, the TLS secret used in examples is a 2048 bit RSA
key/cert pair with an arbitrarily chosen hostname, created as follows</p> key/cert pair with an arbitrarily chosen hostname, created as follows</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> openssl req -x509 -sha256 -nodes -days <span class="m">365</span> -newkey rsa:2048 -keyout tls.key -out tls.crt -subj <span class="s2">&quot;/CN=nginxsvc/O=nginxsvc&quot;</span> <div class="codehilite"><pre><span></span><code><span class="gp">$</span> openssl req -x509 -sha256 -nodes -days <span class="m">365</span> -newkey rsa:2048 -keyout tls.key -out tls.crt -subj <span class="s2">&quot;/CN=nginxsvc/O=nginxsvc&quot;</span>
<span class="go">Generating a 2048 bit RSA private key</span> <span class="go">Generating a 2048 bit RSA private key</span>
<span class="go">................+++</span> <span class="go">................+++</span>
<span class="go">................+++</span> <span class="go">................+++</span>
@ -1235,7 +1235,7 @@ key/cert pair with an arbitrarily chosen hostname, created as follows</p>
<span class="gp">$</span> kubectl create secret tls tls-secret --key tls.key --cert tls.crt <span class="gp">$</span> kubectl create secret tls tls-secret --key tls.key --cert tls.crt
<span class="go">secret &quot;tls-secret&quot; created</span> <span class="go">secret &quot;tls-secret&quot; created</span>
</pre></div> </code></pre></div>
<p>Note: If using CA Authentication, described below, you will need to sign the server certificate with the CA.</p> <p>Note: If using CA Authentication, described below, you will need to sign the server certificate with the CA.</p>
<h2 id="client-certificate-authentication">Client Certificate Authentication<a class="headerlink" href="#client-certificate-authentication" title="Permanent link"></a></h2> <h2 id="client-certificate-authentication">Client Certificate Authentication<a class="headerlink" href="#client-certificate-authentication" title="Permanent link"></a></h2>
@ -1246,24 +1246,24 @@ both our server certificate and client certificate. Then every time we want to a
pass the client certificate.</p> pass the client certificate.</p>
<p>These instructions are based on the following <a href="https://medium.com/@awkwardferny/configuring-certificate-based-mutual-authentication-with-kubernetes-ingress-nginx-20e7e38fdfca">blog</a></p> <p>These instructions are based on the following <a href="https://medium.com/@awkwardferny/configuring-certificate-based-mutual-authentication-with-kubernetes-ingress-nginx-20e7e38fdfca">blog</a></p>
<p><strong>Generate the CA Key and Certificate:</strong></p> <p><strong>Generate the CA Key and Certificate:</strong></p>
<div class="codehilite"><pre><span></span><span class="go">openssl req -x509 -sha256 -newkey rsa:4096 -keyout ca.key -out ca.crt -days 356 -nodes -subj &#39;/CN=My Cert Authority&#39;</span> <div class="codehilite"><pre><span></span><code><span class="go">openssl req -x509 -sha256 -newkey rsa:4096 -keyout ca.key -out ca.crt -days 356 -nodes -subj &#39;/CN=My Cert Authority&#39;</span>
</pre></div> </code></pre></div>
<p><strong>Generate the Server Key, and Certificate and Sign with the CA Certificate:</strong></p> <p><strong>Generate the Server Key, and Certificate and Sign with the CA Certificate:</strong></p>
<div class="codehilite"><pre><span></span><span class="go">openssl req -new -newkey rsa:4096 -keyout server.key -out server.csr -nodes -subj &#39;/CN=mydomain.com&#39;</span> <div class="codehilite"><pre><span></span><code><span class="go">openssl req -new -newkey rsa:4096 -keyout server.key -out server.csr -nodes -subj &#39;/CN=mydomain.com&#39;</span>
<span class="go">openssl x509 -req -sha256 -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt</span> <span class="go">openssl x509 -req -sha256 -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt</span>
</pre></div> </code></pre></div>
<p><strong>Generate the Client Key, and Certificate and Sign with the CA Certificate:</strong></p> <p><strong>Generate the Client Key, and Certificate and Sign with the CA Certificate:</strong></p>
<div class="codehilite"><pre><span></span><span class="go">openssl req -new -newkey rsa:4096 -keyout client.key -out client.csr -nodes -subj &#39;/CN=My Client&#39;</span> <div class="codehilite"><pre><span></span><code><span class="go">openssl req -new -newkey rsa:4096 -keyout client.key -out client.csr -nodes -subj &#39;/CN=My Client&#39;</span>
<span class="go">openssl x509 -req -sha256 -days 365 -in client.csr -CA ca.crt -CAkey ca.key -set_serial 02 -out client.crt</span> <span class="go">openssl x509 -req -sha256 -days 365 -in client.csr -CA ca.crt -CAkey ca.key -set_serial 02 -out client.crt</span>
</pre></div> </code></pre></div>
<p>Once this is complete you can continue to follow the instructions <a href="../auth/client-certs/#creating-certificate-secrets">here</a></p> <p>Once this is complete you can continue to follow the instructions <a href="../auth/client-certs/#creating-certificate-secrets">here</a></p>
<h2 id="test-http-service">Test HTTP Service<a class="headerlink" href="#test-http-service" title="Permanent link"></a></h2> <h2 id="test-http-service">Test HTTP Service<a class="headerlink" href="#test-http-service" title="Permanent link"></a></h2>
<p>All examples that require a test HTTP Service use the standard http-svc pod, <p>All examples that require a test HTTP Service use the standard http-svc pod,
which you can deploy as follows</p> which you can deploy as follows</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl create -f http-svc.yaml <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl create -f http-svc.yaml
<span class="go">service &quot;http-svc&quot; created</span> <span class="go">service &quot;http-svc&quot; created</span>
<span class="go">replicationcontroller &quot;http-svc&quot; created</span> <span class="go">replicationcontroller &quot;http-svc&quot; created</span>
@ -1274,10 +1274,10 @@ which you can deploy as follows</p>
<span class="gp">$</span> kubectl get svc <span class="gp">$</span> kubectl get svc
<span class="go">NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE</span> <span class="go">NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE</span>
<span class="go">http-svc 10.0.122.116 &lt;pending&gt; 80:30301/TCP 1d</span> <span class="go">http-svc 10.0.122.116 &lt;pending&gt; 80:30301/TCP 1d</span>
</pre></div> </code></pre></div>
<p>You can test that the HTTP Service works by exposing it temporarily</p> <p>You can test that the HTTP Service works by exposing it temporarily</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl patch svc http-svc -p <span class="s1">&#39;{&quot;spec&quot;:{&quot;type&quot;: &quot;LoadBalancer&quot;}}&#39;</span> <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl patch svc http-svc -p <span class="s1">&#39;{&quot;spec&quot;:{&quot;type&quot;: &quot;LoadBalancer&quot;}}&#39;</span>
<span class="go">&quot;http-svc&quot; patched</span> <span class="go">&quot;http-svc&quot; patched</span>
<span class="gp">$</span> kubectl get svc http-svc <span class="gp">$</span> kubectl get svc http-svc
@ -1324,7 +1324,8 @@ which you can deploy as follows</p>
<span class="gp">$</span> kubectl patch svc http-svc -p <span class="s1">&#39;{&quot;spec&quot;:{&quot;type&quot;: &quot;NodePort&quot;}}&#39;</span> <span class="gp">$</span> kubectl patch svc http-svc -p <span class="s1">&#39;{&quot;spec&quot;:{&quot;type&quot;: &quot;NodePort&quot;}}&#39;</span>
<span class="go">&quot;http-svc&quot; patched</span> <span class="go">&quot;http-svc&quot; patched</span>
</pre></div> </code></pre></div>
@ -1382,9 +1383,9 @@ which you can deploy as follows</p>
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1394,7 +1395,7 @@ which you can deploy as follows</p>
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#sticky-sessions" tabindex="1" class="md-skip"> <a href="#sticky-sessions" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1222,18 +1222,18 @@
<tbody> <tbody>
<tr> <tr>
<td>nginx.ingress.kubernetes.io/affinity</td> <td>nginx.ingress.kubernetes.io/affinity</td>
<td>Type of the affinity, set this to <code class="codehilite">cookie</code> to enable session affinity</td> <td>Type of the affinity, set this to <code class="codehilite"><span class="err">cookie</span></code> to enable session affinity</td>
<td>string (NGINX only supports <code class="codehilite">cookie</code>)</td> <td>string (NGINX only supports <code class="codehilite"><span class="err">cookie</span></code>)</td>
</tr> </tr>
<tr> <tr>
<td>nginx.ingress.kubernetes.io/affinity-mode</td> <td>nginx.ingress.kubernetes.io/affinity-mode</td>
<td>The affinity mode defines how sticky a session is. Use <code class="codehilite">balanced</code> to redistribute some sessions when scaling pods or <code class="codehilite">persistent</code> for maximum stickyness.</td> <td>The affinity mode defines how sticky a session is. Use <code class="codehilite"><span class="err">balanced</span></code> to redistribute some sessions when scaling pods or <code class="codehilite"><span class="err">persistent</span></code> for maximum stickyness.</td>
<td><code class="codehilite">balanced</code> (default) or <code class="codehilite">persistent</code></td> <td><code class="codehilite"><span class="err">balanced</span></code> (default) or <code class="codehilite"><span class="err">persistent</span></code></td>
</tr> </tr>
<tr> <tr>
<td>nginx.ingress.kubernetes.io/session-cookie-name</td> <td>nginx.ingress.kubernetes.io/session-cookie-name</td>
<td>Name of the cookie that will be created</td> <td>Name of the cookie that will be created</td>
<td>string (defaults to <code class="codehilite">INGRESSCOOKIE</code>)</td> <td>string (defaults to <code class="codehilite"><span class="err">INGRESSCOOKIE</span></code>)</td>
</tr> </tr>
<tr> <tr>
<td>nginx.ingress.kubernetes.io/session-cookie-path</td> <td>nginx.ingress.kubernetes.io/session-cookie-path</td>
@ -1243,37 +1243,37 @@
<tr> <tr>
<td>nginx.ingress.kubernetes.io/session-cookie-samesite</td> <td>nginx.ingress.kubernetes.io/session-cookie-samesite</td>
<td>SameSite attribute to apply to the cookie</td> <td>SameSite attribute to apply to the cookie</td>
<td>Browser accepted values are <code class="codehilite">None</code>, <code class="codehilite">Lax</code>, and <code class="codehilite">Strict</code></td> <td>Browser accepted values are <code class="codehilite"><span class="err">None</span></code>, <code class="codehilite"><span class="err">Lax</span></code>, and <code class="codehilite"><span class="err">Strict</span></code></td>
</tr> </tr>
<tr> <tr>
<td>nginx.ingress.kubernetes.io/session-cookie-conditional-samesite-none</td> <td>nginx.ingress.kubernetes.io/session-cookie-conditional-samesite-none</td>
<td>Will omit <code class="codehilite">SameSite=None</code> attribute for older browsers which reject the more-recently defined <code class="codehilite">SameSite=None</code> value</td> <td>Will omit <code class="codehilite"><span class="err">SameSite=None</span></code> attribute for older browsers which reject the more-recently defined <code class="codehilite"><span class="err">SameSite=None</span></code> value</td>
<td><code class="codehilite">&quot;true&quot;</code> or <code class="codehilite">&quot;false&quot;</code></td> <td><code class="codehilite"><span class="err">&quot;true&quot;</span></code> or <code class="codehilite"><span class="err">&quot;false&quot;</span></code></td>
</tr> </tr>
<tr> <tr>
<td>nginx.ingress.kubernetes.io/session-cookie-max-age</td> <td>nginx.ingress.kubernetes.io/session-cookie-max-age</td>
<td>Time until the cookie expires, corresponds to the <code class="codehilite">Max-Age</code> cookie directive</td> <td>Time until the cookie expires, corresponds to the <code class="codehilite"><span class="err">Max-Age</span></code> cookie directive</td>
<td>number of seconds</td> <td>number of seconds</td>
</tr> </tr>
<tr> <tr>
<td>nginx.ingress.kubernetes.io/session-cookie-expires</td> <td>nginx.ingress.kubernetes.io/session-cookie-expires</td>
<td>Legacy version of the previous annotation for compatibility with older browsers, generates an <code class="codehilite">Expires</code> cookie directive by adding the seconds to the current date</td> <td>Legacy version of the previous annotation for compatibility with older browsers, generates an <code class="codehilite"><span class="err">Expires</span></code> cookie directive by adding the seconds to the current date</td>
<td>number of seconds</td> <td>number of seconds</td>
</tr> </tr>
<tr> <tr>
<td>nginx.ingress.kubernetes.io/session-cookie-change-on-failure</td> <td>nginx.ingress.kubernetes.io/session-cookie-change-on-failure</td>
<td>When set to <code class="codehilite">false</code> nginx ingress will send request to upstream pointed by sticky cookie even if previous attempt failed. When set to <code class="codehilite">true</code> and previous attempt failed, sticky cookie will be changed to point to another upstream.</td> <td>When set to <code class="codehilite"><span class="err">false</span></code> nginx ingress will send request to upstream pointed by sticky cookie even if previous attempt failed. When set to <code class="codehilite"><span class="err">true</span></code> and previous attempt failed, sticky cookie will be changed to point to another upstream.</td>
<td><code class="codehilite">true</code> or <code class="codehilite">false</code> (defaults to <code class="codehilite">false</code>)</td> <td><code class="codehilite"><span class="err">true</span></code> or <code class="codehilite"><span class="err">false</span></code> (defaults to <code class="codehilite"><span class="err">false</span></code>)</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<p>You can create the <a href="ingress.yaml">example Ingress</a> to test this:</p> <p>You can create the <a href="ingress.yaml">example Ingress</a> to test this:</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl create -f ingress.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl create -f ingress.yaml</span>
</pre></div> </code></pre></div>
<h2 id="validation">Validation<a class="headerlink" href="#validation" title="Permanent link"></a></h2> <h2 id="validation">Validation<a class="headerlink" href="#validation" title="Permanent link"></a></h2>
<p>You can confirm that the Ingress works:</p> <p>You can confirm that the Ingress works:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl describe ing nginx-test <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl describe ing nginx-test
<span class="go">Name: nginx-test</span> <span class="go">Name: nginx-test</span>
<span class="go">Namespace: default</span> <span class="go">Namespace: default</span>
<span class="go">Address:</span> <span class="go">Address:</span>
@ -1305,10 +1305,10 @@
<span class="go">Last-Modified: Tue, 24 Jan 2017 14:02:19 GMT</span> <span class="go">Last-Modified: Tue, 24 Jan 2017 14:02:19 GMT</span>
<span class="go">ETag: &quot;58875e6b-264&quot;</span> <span class="go">ETag: &quot;58875e6b-264&quot;</span>
<span class="go">Accept-Ranges: bytes</span> <span class="go">Accept-Ranges: bytes</span>
</pre></div> </code></pre></div>
<p>In the example above, you can see that the response contains a <code class="codehilite">Set-Cookie</code> header with the settings we have defined. <p>In the example above, you can see that the response contains a <code class="codehilite"><span class="err">Set-Cookie</span></code> header with the settings we have defined.
This cookie is created by NGINX, it contains a randomly generated key corresponding to the upstream used for that request (selected using <a href="https://en.wikipedia.org/wiki/Consistent_hashing">consistent hashing</a>) and has an <code class="codehilite">Expires</code> directive. This cookie is created by NGINX, it contains a randomly generated key corresponding to the upstream used for that request (selected using <a href="https://en.wikipedia.org/wiki/Consistent_hashing">consistent hashing</a>) and has an <code class="codehilite"><span class="err">Expires</span></code> directive.
If the user changes this cookie, NGINX creates a new one and redirects the user to another upstream.</p> If the user changes this cookie, NGINX creates a new one and redirects the user to another upstream.</p>
<p>If the backend pool grows NGINX will keep sending the requests through the same server of the first request, even if it's overloaded.</p> <p>If the backend pool grows NGINX will keep sending the requests through the same server of the first request, even if it's overloaded.</p>
<p>When the backend server is removed, the requests are re-routed to another upstream server. This does not require the cookie to be updated because the key's <a href="https://en.wikipedia.org/wiki/Consistent_hashing">consistent hash</a> will change.</p> <p>When the backend server is removed, the requests are re-routed to another upstream server. This does not require the cookie to be updated because the key's <a href="https://en.wikipedia.org/wiki/Consistent_hashing">consistent hash</a> will change.</p>
@ -1323,6 +1323,7 @@ This means that you can face the situation that you've configured session affini
</article> </article>
</div> </div>
</div> </div>
@ -1371,9 +1372,9 @@ This means that you can face the situation that you've configured session affini
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1383,7 +1384,7 @@ This means that you can face the situation that you've configured session affini
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#basic-authentication" tabindex="1" class="md-skip"> <a href="#basic-authentication" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1151,20 +1151,20 @@
<h1 id="basic-authentication">Basic Authentication<a class="headerlink" href="#basic-authentication" title="Permanent link"></a></h1> <h1 id="basic-authentication">Basic Authentication<a class="headerlink" href="#basic-authentication" title="Permanent link"></a></h1>
<p>This example shows how to add authentication in a Ingress rule using a secret that contains a file generated with <code class="codehilite">htpasswd</code>. <p>This example shows how to add authentication in a Ingress rule using a secret that contains a file generated with <code class="codehilite"><span class="err">htpasswd</span></code>.
It's important the file generated is named <code class="codehilite">auth</code> (actually - that the secret has a key <code class="codehilite">data.auth</code>), otherwise the ingress-controller returns a 503.</p> It's important the file generated is named <code class="codehilite"><span class="err">auth</span></code> (actually - that the secret has a key <code class="codehilite"><span class="err">data.auth</span></code>), otherwise the ingress-controller returns a 503.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> htpasswd -c auth foo <div class="codehilite"><pre><span></span><code><span class="gp">$</span> htpasswd -c auth foo
<span class="go">New password: &lt;bar&gt;</span> <span class="go">New password: &lt;bar&gt;</span>
<span class="go">New password:</span> <span class="go">New password:</span>
<span class="go">Re-type new password:</span> <span class="go">Re-type new password:</span>
<span class="go">Adding password for user foo</span> <span class="go">Adding password for user foo</span>
</pre></div> </code></pre></div>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl create secret generic basic-auth --from-file<span class="o">=</span>auth <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl create secret generic basic-auth --from-file<span class="o">=</span>auth
<span class="go">secret &quot;basic-auth&quot; created</span> <span class="go">secret &quot;basic-auth&quot; created</span>
</pre></div> </code></pre></div>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get secret basic-auth -o yaml <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get secret basic-auth -o yaml
<span class="go">apiVersion: v1</span> <span class="go">apiVersion: v1</span>
<span class="go">data:</span> <span class="go">data:</span>
<span class="go"> auth: Zm9vOiRhcHIxJE9GRzNYeWJwJGNrTDBGSERBa29YWUlsSDkuY3lzVDAK</span> <span class="go"> auth: Zm9vOiRhcHIxJE9GRzNYeWJwJGNrTDBGSERBa29YWUlsSDkuY3lzVDAK</span>
@ -1173,9 +1173,9 @@ It's important the file generated is named <code class="codehilite">auth</code>
<span class="go"> name: basic-auth</span> <span class="go"> name: basic-auth</span>
<span class="go"> namespace: default</span> <span class="go"> namespace: default</span>
<span class="go">type: Opaque</span> <span class="go">type: Opaque</span>
</pre></div> </code></pre></div>
<div class="codehilite"><pre><span></span><span class="go">echo &quot;</span> <div class="codehilite"><pre><span></span><code><span class="go">echo &quot;</span>
<span class="go">apiVersion: networking.k8s.io/v1beta1</span> <span class="go">apiVersion: networking.k8s.io/v1beta1</span>
<span class="go">kind: Ingress</span> <span class="go">kind: Ingress</span>
<span class="go">metadata:</span> <span class="go">metadata:</span>
@ -1197,9 +1197,9 @@ It's important the file generated is named <code class="codehilite">auth</code>
<span class="go"> serviceName: http-svc</span> <span class="go"> serviceName: http-svc</span>
<span class="go"> servicePort: 80</span> <span class="go"> servicePort: 80</span>
<span class="go">&quot; | kubectl create -f -</span> <span class="go">&quot; | kubectl create -f -</span>
</pre></div> </code></pre></div>
<div class="codehilite"><pre><span></span>$ curl -v http://10.2.29.4/ -H &#39;Host: foo.bar.com&#39; <div class="codehilite"><pre><span></span><code>$ curl -v http://10.2.29.4/ -H &#39;Host: foo.bar.com&#39;
* Trying 10.2.29.4... * Trying 10.2.29.4...
* Connected to 10.2.29.4 (10.2.29.4) port 80 (#0) * Connected to 10.2.29.4 (10.2.29.4) port 80 (#0)
&gt; GET / HTTP/1.1 &gt; GET / HTTP/1.1
@ -1223,9 +1223,9 @@ It's important the file generated is named <code class="codehilite">auth</code>
<span class="nt">&lt;/body&gt;</span> <span class="nt">&lt;/body&gt;</span>
<span class="nt">&lt;/html&gt;</span> <span class="nt">&lt;/html&gt;</span>
* Connection #0 to host 10.2.29.4 left intact * Connection #0 to host 10.2.29.4 left intact
</pre></div> </code></pre></div>
<div class="codehilite"><pre><span></span>$ curl -v http://10.2.29.4/ -H <span class="s1">&#39;Host: foo.bar.com&#39;</span> -u <span class="s1">&#39;foo:bar&#39;</span> <div class="codehilite"><pre><span></span><code>$ curl -v http://10.2.29.4/ -H <span class="s1">&#39;Host: foo.bar.com&#39;</span> -u <span class="s1">&#39;foo:bar&#39;</span>
* Trying <span class="m">10</span>.2.29.4... * Trying <span class="m">10</span>.2.29.4...
* Connected to <span class="m">10</span>.2.29.4 <span class="o">(</span><span class="m">10</span>.2.29.4<span class="o">)</span> port <span class="m">80</span> <span class="o">(</span><span class="c1">#0)</span> * Connected to <span class="m">10</span>.2.29.4 <span class="o">(</span><span class="m">10</span>.2.29.4<span class="o">)</span> port <span class="m">80</span> <span class="o">(</span><span class="c1">#0)</span>
* Server auth using Basic with user <span class="s1">&#39;foo&#39;</span> * Server auth using Basic with user <span class="s1">&#39;foo&#39;</span>
@ -1268,7 +1268,8 @@ x-real-ip<span class="o">=</span><span class="m">10</span>.2.29.1
BODY: BODY:
* Connection <span class="c1">#0 to host 10.2.29.4 left intact</span> * Connection <span class="c1">#0 to host 10.2.29.4 left intact</span>
-no body in request- -no body in request-
</pre></div> </code></pre></div>
@ -1326,9 +1327,9 @@ BODY:
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1338,7 +1339,7 @@ BODY:
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#client-certificate-authentication" tabindex="1" class="md-skip"> <a href="#client-certificate-authentication" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1219,12 +1219,12 @@ Before getting started you must have the following Certificates Setup:</p>
</ol> </ol>
<p>For more details on the generation process, checkout the Prerequisite <a href="../../PREREQUISITES/#client-certificate-authentication">docs</a>.</p> <p>For more details on the generation process, checkout the Prerequisite <a href="../../PREREQUISITES/#client-certificate-authentication">docs</a>.</p>
<p>You can have as many certificates as you want. If they're in the binary DER format, you can convert them as the following:</p> <p>You can have as many certificates as you want. If they're in the binary DER format, you can convert them as the following:</p>
<div class="codehilite"><pre><span></span>openssl x509 -in certificate.der -inform der -out certificate.crt -outform pem <div class="codehilite"><pre><span></span><code>openssl x509 -in certificate.der -inform der -out certificate.crt -outform pem
</pre></div> </code></pre></div>
<p>Then, you can concatenate them all in only one file, named 'ca.crt' as the following:</p> <p>Then, you can concatenate them all in only one file, named 'ca.crt' as the following:</p>
<div class="codehilite"><pre><span></span>cat certificate1.crt certificate2.crt certificate3.crt &gt;&gt; ca.crt <div class="codehilite"><pre><span></span><code>cat certificate1.crt certificate2.crt certificate3.crt &gt;&gt; ca.crt
</pre></div> </code></pre></div>
<p><strong>Note:</strong> Make sure that the Key Size is greater than 1024 and Hashing Algorithm(Digest) is something better than md5 <p><strong>Note:</strong> Make sure that the Key Size is greater than 1024 and Hashing Algorithm(Digest) is something better than md5
for each certificate generated. Otherwise you will receive an error.</p> for each certificate generated. Otherwise you will receive an error.</p>
@ -1235,23 +1235,23 @@ Authentication to work properly.</p>
<li> <li>
<p>You can create a secret containing just the CA certificate and another <p>You can create a secret containing just the CA certificate and another
Secret containing the Server Certificate which is Signed by the CA.</p> Secret containing the Server Certificate which is Signed by the CA.</p>
<div class="codehilite"><pre><span></span>kubectl create secret generic ca-secret --from-file<span class="o">=</span>ca.crt<span class="o">=</span>ca.crt <div class="codehilite"><pre><span></span><code>kubectl create secret generic ca-secret --from-file<span class="o">=</span>ca.crt<span class="o">=</span>ca.crt
kubectl create secret generic tls-secret --from-file<span class="o">=</span>tls.crt<span class="o">=</span>server.crt --from-file<span class="o">=</span>tls.key<span class="o">=</span>server.key kubectl create secret generic tls-secret --from-file<span class="o">=</span>tls.crt<span class="o">=</span>server.crt --from-file<span class="o">=</span>tls.key<span class="o">=</span>server.key
</pre></div> </code></pre></div>
</li> </li>
<li> <li>
<p>You can create a secret containing CA certificate along with the Server <p>You can create a secret containing CA certificate along with the Server
Certificate, that can be used for both TLS and Client Auth.</p> Certificate, that can be used for both TLS and Client Auth.</p>
<div class="codehilite"><pre><span></span>kubectl create secret generic ca-secret --from-file<span class="o">=</span>tls.crt<span class="o">=</span>server.crt --from-file<span class="o">=</span>tls.key<span class="o">=</span>server.key --from-file<span class="o">=</span>ca.crt<span class="o">=</span>ca.crt <div class="codehilite"><pre><span></span><code>kubectl create secret generic ca-secret --from-file<span class="o">=</span>tls.crt<span class="o">=</span>server.crt --from-file<span class="o">=</span>tls.key<span class="o">=</span>server.key --from-file<span class="o">=</span>ca.crt<span class="o">=</span>ca.crt
</pre></div> </code></pre></div>
</li> </li>
<li> <li>
<p>If you want to also enable Certificate Revocation List verification you can <p>If you want to also enable Certificate Revocation List verification you can
create the secret also containing the CRL file in PEM format: create the secret also containing the CRL file in PEM format:
<div class="codehilite"><pre><span></span>kubectl create secret generic ca-secret --from-file<span class="o">=</span>ca.crt<span class="o">=</span>ca.crt --from-file<span class="o">=</span>ca.crl<span class="o">=</span>ca.crl <div class="codehilite"><pre><span></span><code>kubectl create secret generic ca-secret --from-file<span class="o">=</span>ca.crt<span class="o">=</span>ca.crt --from-file<span class="o">=</span>ca.crl<span class="o">=</span>ca.crl
</pre></div></p> </code></pre></div></p>
</li> </li>
</ol> </ol>
<p>Note: The CA Certificate must contain the trusted certificate authority chain to verify client certificates.</p> <p>Note: The CA Certificate must contain the trusted certificate authority chain to verify client certificates.</p>
@ -1270,6 +1270,7 @@ kubectl create secret generic tls-secret --from-file<span class="o">=</span>tls.
</article> </article>
</div> </div>
</div> </div>
@ -1318,9 +1319,9 @@ kubectl create secret generic tls-secret --from-file<span class="o">=</span>tls.
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1330,7 +1331,7 @@ kubectl create secret generic tls-secret --from-file<span class="o">=</span>tls.
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#external-basic-authentication" tabindex="1" class="md-skip"> <a href="#external-basic-authentication" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1197,8 +1197,8 @@
<h1 id="external-basic-authentication">External Basic Authentication<a class="headerlink" href="#external-basic-authentication" title="Permanent link"></a></h1> <h1 id="external-basic-authentication">External Basic Authentication<a class="headerlink" href="#external-basic-authentication" title="Permanent link"></a></h1>
<h3 id="example-1">Example 1:<a class="headerlink" href="#example-1" title="Permanent link"></a></h3> <h3 id="example-1">Example 1:<a class="headerlink" href="#example-1" title="Permanent link"></a></h3>
<p>Use an external service (Basic Auth) located in <code class="codehilite">https://httpbin.org</code></p> <p>Use an external service (Basic Auth) located in <code class="codehilite"><span class="c">https://httpbin.org</span></code></p>
<div class="codehilite"><pre><span></span>$ kubectl create -f ingress.yaml <div class="codehilite"><pre><span></span><code>$ kubectl create -f ingress.yaml
ingress <span class="s2">&quot;external-auth&quot;</span> created ingress <span class="s2">&quot;external-auth&quot;</span> created
$ kubectl get ing external-auth $ kubectl get ing external-auth
@ -1232,10 +1232,10 @@ status:
ingress: ingress:
- ip: <span class="m">172</span>.17.4.99 - ip: <span class="m">172</span>.17.4.99
$ $
</pre></div> </code></pre></div>
<p>Test 1: no username/password (expect code 401)</p> <p>Test 1: no username/password (expect code 401)</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> curl -k http://172.17.4.99 -v -H <span class="s1">&#39;Host: external-auth-01.sample.com&#39;</span> <div class="codehilite"><pre><span></span><code><span class="gp">$</span> curl -k http://172.17.4.99 -v -H <span class="s1">&#39;Host: external-auth-01.sample.com&#39;</span>
<span class="go">* Rebuilt URL to: http://172.17.4.99/</span> <span class="go">* Rebuilt URL to: http://172.17.4.99/</span>
<span class="go">* Trying 172.17.4.99...</span> <span class="go">* Trying 172.17.4.99...</span>
<span class="go">* Connected to 172.17.4.99 (172.17.4.99) port 80 (#0)</span> <span class="go">* Connected to 172.17.4.99 (172.17.4.99) port 80 (#0)</span>
@ -1260,10 +1260,10 @@ $
<span class="go">&lt;/body&gt;</span> <span class="go">&lt;/body&gt;</span>
<span class="go">&lt;/html&gt;</span> <span class="go">&lt;/html&gt;</span>
<span class="go">* Connection #0 to host 172.17.4.99 left intact</span> <span class="go">* Connection #0 to host 172.17.4.99 left intact</span>
</pre></div> </code></pre></div>
<p>Test 2: valid username/password (expect code 200) <p>Test 2: valid username/password (expect code 200)
<div class="codehilite"><pre><span></span>$ curl -k http://172.17.4.99 -v -H <span class="s1">&#39;Host: external-auth-01.sample.com&#39;</span> -u <span class="s1">&#39;user:passwd&#39;</span> <div class="codehilite"><pre><span></span><code>$ curl -k http://172.17.4.99 -v -H <span class="s1">&#39;Host: external-auth-01.sample.com&#39;</span> -u <span class="s1">&#39;user:passwd&#39;</span>
* Rebuilt URL to: http://172.17.4.99/ * Rebuilt URL to: http://172.17.4.99/
* Trying <span class="m">172</span>.17.4.99... * Trying <span class="m">172</span>.17.4.99...
* Connected to <span class="m">172</span>.17.4.99 <span class="o">(</span><span class="m">172</span>.17.4.99<span class="o">)</span> port <span class="m">80</span> <span class="o">(</span><span class="c1">#0)</span> * Connected to <span class="m">172</span>.17.4.99 <span class="o">(</span><span class="m">172</span>.17.4.99<span class="o">)</span> port <span class="m">80</span> <span class="o">(</span><span class="c1">#0)</span>
@ -1306,9 +1306,9 @@ x-real-ip<span class="o">=</span><span class="m">10</span>.2.60.1
BODY: BODY:
* Connection <span class="c1">#0 to host 172.17.4.99 left intact</span> * Connection <span class="c1">#0 to host 172.17.4.99 left intact</span>
-no body in request- -no body in request-
</pre></div></p> </code></pre></div></p>
<p>Test 3: invalid username/password (expect code 401) <p>Test 3: invalid username/password (expect code 401)
<div class="codehilite"><pre><span></span>curl -k http://172.17.4.99 -v -H &#39;Host: external-auth-01.sample.com&#39; -u &#39;user:user&#39; <div class="codehilite"><pre><span></span><code>curl -k http://172.17.4.99 -v -H &#39;Host: external-auth-01.sample.com&#39; -u &#39;user:user&#39;
* Rebuilt URL to: http://172.17.4.99/ * Rebuilt URL to: http://172.17.4.99/
* Trying 172.17.4.99... * Trying 172.17.4.99...
* Connected to 172.17.4.99 (172.17.4.99) port 80 (#0) * Connected to 172.17.4.99 (172.17.4.99) port 80 (#0)
@ -1336,7 +1336,8 @@ BODY:
<span class="nt">&lt;/body&gt;</span> <span class="nt">&lt;/body&gt;</span>
<span class="nt">&lt;/html&gt;</span> <span class="nt">&lt;/html&gt;</span>
* Connection #0 to host 172.17.4.99 left intact * Connection #0 to host 172.17.4.99 left intact
</pre></div></p> </code></pre></div></p>
@ -1394,9 +1395,9 @@ BODY:
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1406,7 +1407,7 @@ BODY:
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#external-oauth-authentication" tabindex="1" class="md-skip"> <a href="#external-oauth-authentication" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1251,45 +1251,45 @@
<h1 id="external-oauth-authentication">External OAUTH Authentication<a class="headerlink" href="#external-oauth-authentication" title="Permanent link"></a></h1> <h1 id="external-oauth-authentication">External OAUTH Authentication<a class="headerlink" href="#external-oauth-authentication" title="Permanent link"></a></h1>
<h3 id="overview">Overview<a class="headerlink" href="#overview" title="Permanent link"></a></h3> <h3 id="overview">Overview<a class="headerlink" href="#overview" title="Permanent link"></a></h3>
<p>The <code class="codehilite">auth-url</code> and <code class="codehilite">auth-signin</code> annotations allow you to use an external <p>The <code class="codehilite"><span class="err">auth-url</span></code> and <code class="codehilite"><span class="err">auth-signin</span></code> annotations allow you to use an external
authentication provider to protect your Ingress resources.</p> authentication provider to protect your Ingress resources.</p>
<div class="admonition important"> <div class="admonition important">
<p class="admonition-title">Important</p> <p class="admonition-title">Important</p>
<p>This annotation requires <code class="codehilite">nginx-ingress-controller v0.9.0</code> or greater.)</p> <p>This annotation requires <code class="codehilite"><span class="err">nginx-ingress-controller v0.9.0</span></code> or greater.)</p>
</div> </div>
<h3 id="key-detail">Key Detail<a class="headerlink" href="#key-detail" title="Permanent link"></a></h3> <h3 id="key-detail">Key Detail<a class="headerlink" href="#key-detail" title="Permanent link"></a></h3>
<p>This functionality is enabled by deploying multiple Ingress objects for a single host. <p>This functionality is enabled by deploying multiple Ingress objects for a single host.
One Ingress object has no special annotations and handles authentication.</p> One Ingress object has no special annotations and handles authentication.</p>
<p>Other Ingress objects can then be annotated in such a way that require the user to <p>Other Ingress objects can then be annotated in such a way that require the user to
authenticate against the first Ingress's endpoint, and can redirect <code class="codehilite">401</code>s to the authenticate against the first Ingress's endpoint, and can redirect <code class="codehilite"><span class="err">401</span></code>s to the
same endpoint.</p> same endpoint.</p>
<p>Sample:</p> <p>Sample:</p>
<div class="codehilite"><pre><span></span><span class="nn">...</span> <div class="codehilite"><pre><span></span><code><span class="nn">...</span>
<span class="nt">metadata</span><span class="p">:</span> <span class="nt">metadata</span><span class="p">:</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">application</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">application</span>
<span class="nt">annotations</span><span class="p">:</span> <span class="nt">annotations</span><span class="p">:</span>
<span class="nt">nginx.ingress.kubernetes.io/auth-url</span><span class="p">:</span> <span class="s">&quot;https://$host/oauth2/auth&quot;</span> <span class="nt">nginx.ingress.kubernetes.io/auth-url</span><span class="p">:</span> <span class="s">&quot;https://$host/oauth2/auth&quot;</span>
<span class="nt">nginx.ingress.kubernetes.io/auth-signin</span><span class="p">:</span> <span class="s">&quot;https://$host/oauth2/start?rd=$escaped_request_uri&quot;</span> <span class="nt">nginx.ingress.kubernetes.io/auth-signin</span><span class="p">:</span> <span class="s">&quot;https://$host/oauth2/start?rd=$escaped_request_uri&quot;</span>
<span class="nn">...</span> <span class="nn">...</span>
</pre></div> </code></pre></div>
<h3 id="example-oauth2-proxy-kubernetes-dashboard">Example: OAuth2 Proxy + Kubernetes-Dashboard<a class="headerlink" href="#example-oauth2-proxy-kubernetes-dashboard" title="Permanent link"></a></h3> <h3 id="example-oauth2-proxy-kubernetes-dashboard">Example: OAuth2 Proxy + Kubernetes-Dashboard<a class="headerlink" href="#example-oauth2-proxy-kubernetes-dashboard" title="Permanent link"></a></h3>
<p>This example will show you how to deploy <a href="https://github.com/pusher/oauth2_proxy"><code class="codehilite">oauth2_proxy</code></a> <p>This example will show you how to deploy <a href="https://github.com/pusher/oauth2_proxy"><code class="codehilite"><span class="err">oauth2_proxy</span></code></a>
into a Kubernetes cluster and use it to protect the Kubernetes Dashboard using github as oAuth2 provider</p> into a Kubernetes cluster and use it to protect the Kubernetes Dashboard using github as oAuth2 provider</p>
<h4 id="prepare">Prepare<a class="headerlink" href="#prepare" title="Permanent link"></a></h4> <h4 id="prepare">Prepare<a class="headerlink" href="#prepare" title="Permanent link"></a></h4>
<ol> <ol>
<li>Install the kubernetes dashboard</li> <li>Install the kubernetes dashboard</li>
</ol> </ol>
<div class="codehilite"><pre><span></span><span class="go">kubectl create -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/kubernetes-dashboard/v1.10.1.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl create -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/kubernetes-dashboard/v1.10.1.yaml</span>
</pre></div> </code></pre></div>
<ol> <ol>
<li>Create a <a href="https://github.com/settings/applications/new">custom Github OAuth application</a></li> <li>Create a <a href="https://github.com/settings/applications/new">custom Github OAuth application</a></li>
</ol> </ol>
<p><img alt="Register OAuth2 Application" src="images/register-oauth-app.png" /></p> <p><img alt="Register OAuth2 Application" src="images/register-oauth-app.png" /></p>
<ul> <ul>
<li>Homepage URL is the FQDN in the Ingress rule, like <code class="codehilite">https://foo.bar.com</code></li> <li>Homepage URL is the FQDN in the Ingress rule, like <code class="codehilite"><span class="c">https://foo.bar.com</span></code></li>
<li>Authorization callback URL is the same as the base FQDN plus <code class="codehilite">/oauth2</code>, like <code class="codehilite">https://foo.bar.com/oauth2</code></li> <li>Authorization callback URL is the same as the base FQDN plus <code class="codehilite"><span class="err">/oauth2</span></code>, like <code class="codehilite"><span class="c">https://foo.bar.com/oauth2</span></code></li>
</ul> </ul>
<p><img alt="Register OAuth2 Application" src="images/register-oauth-app-2.png" /></p> <p><img alt="Register OAuth2 Application" src="images/register-oauth-app-2.png" /></p>
<ol> <ol>
@ -1297,9 +1297,9 @@ into a Kubernetes cluster and use it to protect the Kubernetes Dashboard using g
<p>Configure oauth2_proxy values in the file oauth2-proxy.yaml with the values:</p> <p>Configure oauth2_proxy values in the file oauth2-proxy.yaml with the values:</p>
</li> </li>
<li> <li>
<p>OAUTH2_PROXY_CLIENT_ID with the github <code class="codehilite">&lt;Client ID&gt;</code></p> <p>OAUTH2_PROXY_CLIENT_ID with the github <code class="codehilite"><span class="err">&lt;Client ID&gt;</span></code></p>
</li> </li>
<li>OAUTH2_PROXY_CLIENT_SECRET with the github <code class="codehilite">&lt;Client Secret&gt;</code></li> <li>OAUTH2_PROXY_CLIENT_SECRET with the github <code class="codehilite"><span class="err">&lt;Client Secret&gt;</span></code></li>
<li> <li>
<p>OAUTH2_PROXY_COOKIE_SECRET with value of <code class="codehilite"><span class="n">python</span> <span class="o">-</span><span class="n">c</span> <span class="s1">&#39;import os,base64; print(base64.b64encode(os.urandom(16)).decode(&quot;ascii&quot;))&#39;</span></code></p> <p>OAUTH2_PROXY_COOKIE_SECRET with value of <code class="codehilite"><span class="n">python</span> <span class="o">-</span><span class="n">c</span> <span class="s1">&#39;import os,base64; print(base64.b64encode(os.urandom(16)).decode(&quot;ascii&quot;))&#39;</span></code></p>
</li> </li>
@ -1307,14 +1307,14 @@ into a Kubernetes cluster and use it to protect the Kubernetes Dashboard using g
<p>Customize the contents of the file dashboard-ingress.yaml:</p> <p>Customize the contents of the file dashboard-ingress.yaml:</p>
</li> </li>
</ol> </ol>
<p>Replace <code class="codehilite">__INGRESS_HOST__</code> with a valid FQDN and <code class="codehilite">__INGRESS_SECRET__</code> with a Secret with a valid SSL certificate.</p> <p>Replace <code class="codehilite"><span class="err">__INGRESS_HOST__</span></code> with a valid FQDN and <code class="codehilite"><span class="err">__INGRESS_SECRET__</span></code> with a Secret with a valid SSL certificate.</p>
<ol> <ol>
<li>Deploy the oauth2 proxy and the ingress rules running:</li> <li>Deploy the oauth2 proxy and the ingress rules running:</li>
</ol> </ol>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl create -f oauth2-proxy.yaml,dashboard-ingress.yaml <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl create -f oauth2-proxy.yaml,dashboard-ingress.yaml
</pre></div> </code></pre></div>
<p>Test the oauth integration accessing the configured URL, like <code class="codehilite">https://foo.bar.com</code></p> <p>Test the oauth integration accessing the configured URL, like <code class="codehilite"><span class="c">https://foo.bar.com</span></code></p>
<p><img alt="Register OAuth2 Application" src="images/github-auth.png" /></p> <p><img alt="Register OAuth2 Application" src="images/github-auth.png" /></p>
<p><img alt="Github authentication" src="images/oauth-login.png" /></p> <p><img alt="Github authentication" src="images/oauth-login.png" /></p>
<p><img alt="Kubernetes dashboard" src="images/dashboard.png" /></p> <p><img alt="Kubernetes dashboard" src="images/dashboard.png" /></p>
@ -1327,6 +1327,7 @@ into a Kubernetes cluster and use it to protect the Kubernetes Dashboard using g
</article> </article>
</div> </div>
</div> </div>
@ -1375,9 +1376,9 @@ into a Kubernetes cluster and use it to protect the Kubernetes Dashboard using g
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1387,7 +1388,7 @@ into a Kubernetes cluster and use it to protect the Kubernetes Dashboard using g
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#configuration-snippets" tabindex="1" class="md-skip"> <a href="#configuration-snippets" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1212,12 +1212,13 @@
<h1 id="configuration-snippets">Configuration Snippets<a class="headerlink" href="#configuration-snippets" title="Permanent link"></a></h1> <h1 id="configuration-snippets">Configuration Snippets<a class="headerlink" href="#configuration-snippets" title="Permanent link"></a></h1>
<h2 id="ingress">Ingress<a class="headerlink" href="#ingress" title="Permanent link"></a></h2> <h2 id="ingress">Ingress<a class="headerlink" href="#ingress" title="Permanent link"></a></h2>
<p>The Ingress in this example adds a custom header to Nginx configuration that only applies to that specific Ingress. If you want to add headers that apply globally to all Ingresses, please have a look at <a href="../custom-headers/">this example</a>.</p> <p>The Ingress in this example adds a custom header to Nginx configuration that only applies to that specific Ingress. If you want to add headers that apply globally to all Ingresses, please have a look at <a href="../custom-headers/">this example</a>.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl apply -f ingress.yaml <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl apply -f ingress.yaml
</pre></div> </code></pre></div>
<h2 id="test">Test<a class="headerlink" href="#test" title="Permanent link"></a></h2> <h2 id="test">Test<a class="headerlink" href="#test" title="Permanent link"></a></h2>
<p>Check if the contents of the annotation are present in the nginx.conf file using: <p>Check if the contents of the annotation are present in the nginx.conf file using:
<code class="codehilite">kubectl exec nginx-ingress-controller-873061567-4n3k2 -n kube-system cat /etc/nginx/nginx.conf</code></p> <code class="codehilite"><span class="err">kubectl exec nginx-ingress-controller-873061567-4n3k2 -n kube-system cat /etc/nginx/nginx.conf</span></code></p>
@ -1275,9 +1276,9 @@
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1287,7 +1288,7 @@
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#custom-configuration" tabindex="1" class="md-skip"> <a href="#custom-configuration" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1153,7 +1153,7 @@
<h1 id="custom-configuration">Custom Configuration<a class="headerlink" href="#custom-configuration" title="Permanent link"></a></h1> <h1 id="custom-configuration">Custom Configuration<a class="headerlink" href="#custom-configuration" title="Permanent link"></a></h1>
<p>Using a <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/">ConfigMap</a> is possible to customize the NGINX configuration</p> <p>Using a <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/">ConfigMap</a> is possible to customize the NGINX configuration</p>
<p>For example, if we want to change the timeouts we need to create a ConfigMap:</p> <p>For example, if we want to change the timeouts we need to create a ConfigMap:</p>
<div class="codehilite"><pre><span></span>$ cat configmap.yaml <div class="codehilite"><pre><span></span><code>$ cat configmap.yaml
apiVersion: v1 apiVersion: v1
data: data:
proxy-connect-timeout: <span class="s2">&quot;10&quot;</span> proxy-connect-timeout: <span class="s2">&quot;10&quot;</span>
@ -1162,11 +1162,11 @@ data:
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: nginx-configuration name: nginx-configuration
</pre></div> </code></pre></div>
<div class="codehilite"><pre><span></span>curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/customization/custom-configuration/configmap.yaml \ <div class="codehilite"><pre><span></span><code><span class="err">curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/customization/custom-configuration/configmap.yaml \</span>
| kubectl apply -f - <span class="err"> | kubectl apply -f -</span>
</pre></div> </code></pre></div>
<p>If the Configmap it is updated, NGINX will be reloaded with the new configuration.</p> <p>If the Configmap it is updated, NGINX will be reloaded with the new configuration.</p>
@ -1178,6 +1178,7 @@ metadata:
</article> </article>
</div> </div>
</div> </div>
@ -1226,9 +1227,9 @@ metadata:
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1238,7 +1239,7 @@ metadata:
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#custom-errors" tabindex="1" class="md-skip"> <a href="#custom-errors" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1226,49 +1226,49 @@
<h1 id="custom-errors">Custom Errors<a class="headerlink" href="#custom-errors" title="Permanent link"></a></h1> <h1 id="custom-errors">Custom Errors<a class="headerlink" href="#custom-errors" title="Permanent link"></a></h1>
<p>This example demonstrates how to use a custom backend to render custom error pages.</p> <p>This example demonstrates how to use a custom backend to render custom error pages.</p>
<h2 id="customized-default-backend">Customized default backend<a class="headerlink" href="#customized-default-backend" title="Permanent link"></a></h2> <h2 id="customized-default-backend">Customized default backend<a class="headerlink" href="#customized-default-backend" title="Permanent link"></a></h2>
<p>First, create the custom <code class="codehilite">default-backend</code>. It will be used by the Ingress controller later on.</p> <p>First, create the custom <code class="codehilite"><span class="err">default-backend</span></code>. It will be used by the Ingress controller later on.</p>
<div class="codehilite"><pre><span></span>$ kubectl create -f custom-default-backend.yaml <div class="codehilite"><pre><span></span><code>$ kubectl create -f custom-default-backend.yaml
service <span class="s2">&quot;nginx-errors&quot;</span> created service <span class="s2">&quot;nginx-errors&quot;</span> created
deployment.apps <span class="s2">&quot;nginx-errors&quot;</span> created deployment.apps <span class="s2">&quot;nginx-errors&quot;</span> created
</pre></div> </code></pre></div>
<p>This should have created a Deployment and a Service with the name <code class="codehilite">nginx-errors</code>.</p> <p>This should have created a Deployment and a Service with the name <code class="codehilite"><span class="err">nginx-errors</span></code>.</p>
<div class="codehilite"><pre><span></span>$ kubectl get deploy,svc <div class="codehilite"><pre><span></span><code>$ kubectl get deploy,svc
NAME DESIRED CURRENT READY AGE NAME DESIRED CURRENT READY AGE
deployment.apps/nginx-errors <span class="m">1</span> <span class="m">1</span> <span class="m">1</span> 10s deployment.apps/nginx-errors <span class="m">1</span> <span class="m">1</span> <span class="m">1</span> 10s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT<span class="o">(</span>S<span class="o">)</span> AGE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT<span class="o">(</span>S<span class="o">)</span> AGE
service/nginx-errors ClusterIP <span class="m">10</span>.0.0.12 &lt;none&gt; <span class="m">80</span>/TCP 10s service/nginx-errors ClusterIP <span class="m">10</span>.0.0.12 &lt;none&gt; <span class="m">80</span>/TCP 10s
</pre></div> </code></pre></div>
<h2 id="ingress-controller-configuration">Ingress controller configuration<a class="headerlink" href="#ingress-controller-configuration" title="Permanent link"></a></h2> <h2 id="ingress-controller-configuration">Ingress controller configuration<a class="headerlink" href="#ingress-controller-configuration" title="Permanent link"></a></h2>
<p>If you do not already have an instance of the NGINX Ingress controller running, deploy it according to the <p>If you do not already have an instance of the NGINX Ingress controller running, deploy it according to the
<a href="../../../deploy/">deployment guide</a>, then follow these steps:</p> <a href="../../../deploy/">deployment guide</a>, then follow these steps:</p>
<ol> <ol>
<li> <li>
<p>Edit the <code class="codehilite">nginx-ingress-controller</code> Deployment and set the value of the <code class="codehilite">--default-backend</code> flag to the name of the <p>Edit the <code class="codehilite"><span class="err">nginx-ingress-controller</span></code> Deployment and set the value of the <code class="codehilite"><span class="err">--default-backend</span></code> flag to the name of the
newly created error backend.</p> newly created error backend.</p>
</li> </li>
<li> <li>
<p>Edit the <code class="codehilite">nginx-configuration</code> ConfigMap and create the key <code class="codehilite">custom-http-errors</code> with a value of <code class="codehilite">404,503</code>.</p> <p>Edit the <code class="codehilite"><span class="err">nginx-configuration</span></code> ConfigMap and create the key <code class="codehilite"><span class="err">custom-http-errors</span></code> with a value of <code class="codehilite"><span class="err">404,503</span></code>.</p>
</li> </li>
<li> <li>
<p>Take note of the IP address assigned to the NGINX Ingress controller Service. <p>Take note of the IP address assigned to the NGINX Ingress controller Service.
<div class="codehilite"><pre><span></span>$ kubectl get svc ingress-nginx <div class="codehilite"><pre><span></span><code>$ kubectl get svc ingress-nginx
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT<span class="o">(</span>S<span class="o">)</span> AGE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT<span class="o">(</span>S<span class="o">)</span> AGE
ingress-nginx ClusterIP <span class="m">10</span>.0.0.13 &lt;none&gt; <span class="m">80</span>/TCP,443/TCP 10m ingress-nginx ClusterIP <span class="m">10</span>.0.0.13 &lt;none&gt; <span class="m">80</span>/TCP,443/TCP 10m
</pre></div></p> </code></pre></div></p>
</li> </li>
</ol> </ol>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
<p>The <code class="codehilite">ingress-nginx</code> Service is of type <code class="codehilite">ClusterIP</code> in this example. This may vary depending on your environment. <p>The <code class="codehilite"><span class="err">ingress-nginx</span></code> Service is of type <code class="codehilite"><span class="err">ClusterIP</span></code> in this example. This may vary depending on your environment.
Make sure you can use the Service to reach NGINX before proceeding with the rest of this example.</p> Make sure you can use the Service to reach NGINX before proceeding with the rest of this example.</p>
</div> </div>
<h2 id="testing-error-pages">Testing error pages<a class="headerlink" href="#testing-error-pages" title="Permanent link"></a></h2> <h2 id="testing-error-pages">Testing error pages<a class="headerlink" href="#testing-error-pages" title="Permanent link"></a></h2>
<p>Let us send a couple of HTTP requests using cURL and validate everything is working as expected.</p> <p>Let us send a couple of HTTP requests using cURL and validate everything is working as expected.</p>
<p>A request to the default backend returns a 404 error with a custom message:</p> <p>A request to the default backend returns a 404 error with a custom message:</p>
<div class="codehilite"><pre><span></span>$ curl -D- http://10.0.0.13/ <div class="codehilite"><pre><span></span><code>$ curl -D- http://10.0.0.13/
HTTP/1.1 404 Not Found HTTP/1.1 404 Not Found
Server: nginx/1.13.12 Server: nginx/1.13.12
Date: Tue, 12 Jun 2018 19:11:24 GMT Date: Tue, 12 Jun 2018 19:11:24 GMT
@ -1277,10 +1277,10 @@ Transfer-Encoding: chunked
Connection: keep-alive Connection: keep-alive
<span class="nt">&lt;span&gt;</span>The page you&#39;re looking for could not be found.<span class="nt">&lt;/span&gt;</span> <span class="nt">&lt;span&gt;</span>The page you&#39;re looking for could not be found.<span class="nt">&lt;/span&gt;</span>
</pre></div> </code></pre></div>
<p>A request with a custom <code class="codehilite">Accept</code> header returns the corresponding document type (JSON):</p> <p>A request with a custom <code class="codehilite"><span class="err">Accept</span></code> header returns the corresponding document type (JSON):</p>
<div class="codehilite"><pre><span></span>$ curl -D- -H <span class="s1">&#39;Accept: application/json&#39;</span> http://10.0.0.13/ <div class="codehilite"><pre><span></span><code>$ curl -D- -H <span class="s1">&#39;Accept: application/json&#39;</span> http://10.0.0.13/
HTTP/1.1 <span class="m">404</span> Not Found HTTP/1.1 <span class="m">404</span> Not Found
Server: nginx/1.13.12 Server: nginx/1.13.12
Date: Tue, <span class="m">12</span> Jun <span class="m">2018</span> <span class="m">19</span>:12:36 GMT Date: Tue, <span class="m">12</span> Jun <span class="m">2018</span> <span class="m">19</span>:12:36 GMT
@ -1290,7 +1290,7 @@ Connection: keep-alive
Vary: Accept-Encoding Vary: Accept-Encoding
<span class="o">{</span> <span class="s2">&quot;message&quot;</span>: <span class="s2">&quot;The page you&#39;re looking for could not be found&quot;</span> <span class="o">}</span> <span class="o">{</span> <span class="s2">&quot;message&quot;</span>: <span class="s2">&quot;The page you&#39;re looking for could not be found&quot;</span> <span class="o">}</span>
</pre></div> </code></pre></div>
<p>To go further with this example, feel free to deploy your own applications and Ingress objects, and validate that the <p>To go further with this example, feel free to deploy your own applications and Ingress objects, and validate that the
responses are still in the correct format when a backend returns 503 (eg. if you scale a Deployment down to 0 replica).</p> responses are still in the correct format when a backend returns 503 (eg. if you scale a Deployment down to 0 replica).</p>
@ -1303,6 +1303,7 @@ responses are still in the correct format when a backend returns 503 (eg. if you
</article> </article>
</div> </div>
</div> </div>
@ -1351,9 +1352,9 @@ responses are still in the correct format when a backend returns 503 (eg. if you
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1363,7 +1364,7 @@ responses are still in the correct format when a backend returns 503 (eg. if you
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#custom-headers" tabindex="1" class="md-skip"> <a href="#custom-headers" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1199,18 +1199,19 @@
<p>This example demonstrates configuration of the nginx ingress controller via <p>This example demonstrates configuration of the nginx ingress controller via
a ConfigMap to pass a custom list of headers to the upstream a ConfigMap to pass a custom list of headers to the upstream
server.</p> server.</p>
<p><a href="custom-headers.yaml">custom-headers.yaml</a> defines a ConfigMap in the <code class="codehilite">ingress-nginx</code> namespace named <code class="codehilite">custom-headers</code>, holding several custom X-prefixed HTTP headers.</p> <p><a href="custom-headers.yaml">custom-headers.yaml</a> defines a ConfigMap in the <code class="codehilite"><span class="err">ingress-nginx</span></code> namespace named <code class="codehilite"><span class="err">custom-headers</span></code>, holding several custom X-prefixed HTTP headers.</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/customization/custom-headers/custom-headers.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/customization/custom-headers/custom-headers.yaml</span>
</pre></div> </code></pre></div>
<p><a href="configmap.yaml">configmap.yaml</a> defines a ConfigMap in the <code class="codehilite">ingress-nginx</code> namespace named <code class="codehilite">nginx-configuration</code>. This controls the <a href="../../../user-guide/nginx-configuration/configmap/">global configuration</a> of the ingress controller, and already exists in a standard installation. The key <code class="codehilite">proxy-set-headers</code> is set to cite the previously-created <code class="codehilite">ingress-nginx/custom-headers</code> ConfigMap.</p> <p><a href="configmap.yaml">configmap.yaml</a> defines a ConfigMap in the <code class="codehilite"><span class="err">ingress-nginx</span></code> namespace named <code class="codehilite"><span class="err">nginx-configuration</span></code>. This controls the <a href="../../../user-guide/nginx-configuration/configmap/">global configuration</a> of the ingress controller, and already exists in a standard installation. The key <code class="codehilite"><span class="err">proxy-set-headers</span></code> is set to cite the previously-created <code class="codehilite"><span class="err">ingress-nginx/custom-headers</span></code> ConfigMap.</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/customization/custom-headers/configmap.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/customization/custom-headers/configmap.yaml</span>
</pre></div> </code></pre></div>
<p>The nginx ingress controller will read the <code class="codehilite">ingress-nginx/nginx-configuration</code> ConfigMap, find the <code class="codehilite">proxy-set-headers</code> key, read HTTP headers from the <code class="codehilite">ingress-nginx/custom-headers</code> ConfigMap, and include those HTTP headers in all requests flowing from nginx to the backends.</p> <p>The nginx ingress controller will read the <code class="codehilite"><span class="err">ingress-nginx/nginx-configuration</span></code> ConfigMap, find the <code class="codehilite"><span class="err">proxy-set-headers</span></code> key, read HTTP headers from the <code class="codehilite"><span class="err">ingress-nginx/custom-headers</span></code> ConfigMap, and include those HTTP headers in all requests flowing from nginx to the backends.</p>
<h2 id="test">Test<a class="headerlink" href="#test" title="Permanent link"></a></h2> <h2 id="test">Test<a class="headerlink" href="#test" title="Permanent link"></a></h2>
<p>Check the contents of the ConfigMaps are present in the nginx.conf file using: <p>Check the contents of the ConfigMaps are present in the nginx.conf file using:
<code class="codehilite">kubectl exec nginx-ingress-controller-873061567-4n3k2 -n ingress-nginx cat /etc/nginx/nginx.conf</code></p> <code class="codehilite"><span class="err">kubectl exec nginx-ingress-controller-873061567-4n3k2 -n ingress-nginx cat /etc/nginx/nginx.conf</span></code></p>
@ -1268,9 +1269,9 @@ server.</p>
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1280,7 +1281,7 @@ server.</p>
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#external-authentication-authentication-service-response-headers-propagation" tabindex="1" class="md-skip"> <a href="#external-authentication-authentication-service-response-headers-propagation" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1156,8 +1156,8 @@ to backend service.</p>
<p>Sample configuration includes:</p> <p>Sample configuration includes:</p>
<ul> <ul>
<li>Sample authentication service producing several response headers</li> <li>Sample authentication service producing several response headers</li>
<li>Authentication logic is based on HTTP header: requests with header <code class="codehilite">User</code> containing string <code class="codehilite">internal</code> are considered authenticated</li> <li>Authentication logic is based on HTTP header: requests with header <code class="codehilite"><span class="err">User</span></code> containing string <code class="codehilite"><span class="err">internal</span></code> are considered authenticated</li>
<li>After successful authentication service generates response headers <code class="codehilite">UserID</code> and <code class="codehilite">UserRole</code></li> <li>After successful authentication service generates response headers <code class="codehilite"><span class="err">UserID</span></code> and <code class="codehilite"><span class="err">UserRole</span></code></li>
<li>Sample echo service displaying header information</li> <li>Sample echo service displaying header information</li>
<li>Two ingress objects pointing to echo service</li> <li>Two ingress objects pointing to echo service</li>
<li>Public, which allows access from unauthenticated users</li> <li>Public, which allows access from unauthenticated users</li>
@ -1165,7 +1165,7 @@ to backend service.</p>
</ul> </ul>
<p>You can deploy the controller as <p>You can deploy the controller as
follows:</p> follows:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl create -f deploy/ <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl create -f deploy/
<span class="go">deployment &quot;demo-auth-service&quot; created</span> <span class="go">deployment &quot;demo-auth-service&quot; created</span>
<span class="go">service &quot;demo-auth-service&quot; created</span> <span class="go">service &quot;demo-auth-service&quot; created</span>
<span class="go">ingress &quot;demo-auth-service&quot; created</span> <span class="go">ingress &quot;demo-auth-service&quot; created</span>
@ -1183,10 +1183,10 @@ follows:</p>
<span class="go">NAME HOSTS ADDRESS PORTS AGE</span> <span class="go">NAME HOSTS ADDRESS PORTS AGE</span>
<span class="go">public-demo-echo-service public-demo-echo-service.kube.local 80 1m</span> <span class="go">public-demo-echo-service public-demo-echo-service.kube.local 80 1m</span>
<span class="go">secure-demo-echo-service secure-demo-echo-service.kube.local 80 1m</span> <span class="go">secure-demo-echo-service secure-demo-echo-service.kube.local 80 1m</span>
</pre></div> </code></pre></div>
<p>Test 1: public service with no auth header</p> <p>Test 1: public service with no auth header</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> curl -H <span class="s1">&#39;Host: public-demo-echo-service.kube.local&#39;</span> -v <span class="m">192</span>.168.99.100 <div class="codehilite"><pre><span></span><code><span class="gp">$</span> curl -H <span class="s1">&#39;Host: public-demo-echo-service.kube.local&#39;</span> -v <span class="m">192</span>.168.99.100
<span class="go">* Rebuilt URL to: 192.168.99.100/</span> <span class="go">* Rebuilt URL to: 192.168.99.100/</span>
<span class="go">* Trying 192.168.99.100...</span> <span class="go">* Trying 192.168.99.100...</span>
<span class="go">* Connected to 192.168.99.100 (192.168.99.100) port 80 (#0)</span> <span class="go">* Connected to 192.168.99.100 (192.168.99.100) port 80 (#0)</span>
@ -1204,10 +1204,10 @@ follows:</p>
<span class="go">&lt;</span> <span class="go">&lt;</span>
<span class="go">* Connection #0 to host 192.168.99.100 left intact</span> <span class="go">* Connection #0 to host 192.168.99.100 left intact</span>
<span class="go">UserID: , UserRole:</span> <span class="go">UserID: , UserRole:</span>
</pre></div> </code></pre></div>
<p>Test 2: secure service with no auth header</p> <p>Test 2: secure service with no auth header</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> curl -H <span class="s1">&#39;Host: secure-demo-echo-service.kube.local&#39;</span> -v <span class="m">192</span>.168.99.100 <div class="codehilite"><pre><span></span><code><span class="gp">$</span> curl -H <span class="s1">&#39;Host: secure-demo-echo-service.kube.local&#39;</span> -v <span class="m">192</span>.168.99.100
<span class="go">* Rebuilt URL to: 192.168.99.100/</span> <span class="go">* Rebuilt URL to: 192.168.99.100/</span>
<span class="go">* Trying 192.168.99.100...</span> <span class="go">* Trying 192.168.99.100...</span>
<span class="go">* Connected to 192.168.99.100 (192.168.99.100) port 80 (#0)</span> <span class="go">* Connected to 192.168.99.100 (192.168.99.100) port 80 (#0)</span>
@ -1231,10 +1231,10 @@ follows:</p>
<span class="go">&lt;/body&gt;</span> <span class="go">&lt;/body&gt;</span>
<span class="go">&lt;/html&gt;</span> <span class="go">&lt;/html&gt;</span>
<span class="go">* Connection #0 to host 192.168.99.100 left intact</span> <span class="go">* Connection #0 to host 192.168.99.100 left intact</span>
</pre></div> </code></pre></div>
<p>Test 3: public service with valid auth header</p> <p>Test 3: public service with valid auth header</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> curl -H <span class="s1">&#39;Host: public-demo-echo-service.kube.local&#39;</span> -H <span class="s1">&#39;User:internal&#39;</span> -v <span class="m">192</span>.168.99.100 <div class="codehilite"><pre><span></span><code><span class="gp">$</span> curl -H <span class="s1">&#39;Host: public-demo-echo-service.kube.local&#39;</span> -H <span class="s1">&#39;User:internal&#39;</span> -v <span class="m">192</span>.168.99.100
<span class="go">* Rebuilt URL to: 192.168.99.100/</span> <span class="go">* Rebuilt URL to: 192.168.99.100/</span>
<span class="go">* Trying 192.168.99.100...</span> <span class="go">* Trying 192.168.99.100...</span>
<span class="go">* Connected to 192.168.99.100 (192.168.99.100) port 80 (#0)</span> <span class="go">* Connected to 192.168.99.100 (192.168.99.100) port 80 (#0)</span>
@ -1253,10 +1253,10 @@ follows:</p>
<span class="go">&lt;</span> <span class="go">&lt;</span>
<span class="go">* Connection #0 to host 192.168.99.100 left intact</span> <span class="go">* Connection #0 to host 192.168.99.100 left intact</span>
<span class="go">UserID: 1443635317331776148, UserRole: admin</span> <span class="go">UserID: 1443635317331776148, UserRole: admin</span>
</pre></div> </code></pre></div>
<p>Test 4: secure service with valid auth header</p> <p>Test 4: secure service with valid auth header</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> curl -H <span class="s1">&#39;Host: secure-demo-echo-service.kube.local&#39;</span> -H <span class="s1">&#39;User:internal&#39;</span> -v <span class="m">192</span>.168.99.100 <div class="codehilite"><pre><span></span><code><span class="gp">$</span> curl -H <span class="s1">&#39;Host: secure-demo-echo-service.kube.local&#39;</span> -H <span class="s1">&#39;User:internal&#39;</span> -v <span class="m">192</span>.168.99.100
<span class="go">* Rebuilt URL to: 192.168.99.100/</span> <span class="go">* Rebuilt URL to: 192.168.99.100/</span>
<span class="go">* Trying 192.168.99.100...</span> <span class="go">* Trying 192.168.99.100...</span>
<span class="go">* Connected to 192.168.99.100 (192.168.99.100) port 80 (#0)</span> <span class="go">* Connected to 192.168.99.100 (192.168.99.100) port 80 (#0)</span>
@ -1275,7 +1275,8 @@ follows:</p>
<span class="go">&lt;</span> <span class="go">&lt;</span>
<span class="go">* Connection #0 to host 192.168.99.100 left intact</span> <span class="go">* Connection #0 to host 192.168.99.100 left intact</span>
<span class="go">UserID: 605394647632969758, UserRole: admin</span> <span class="go">UserID: 605394647632969758, UserRole: admin</span>
</pre></div> </code></pre></div>
@ -1333,9 +1334,9 @@ follows:</p>
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1345,7 +1346,7 @@ follows:</p>
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#custom-dh-parameters-for-perfect-forward-secrecy" tabindex="1" class="md-skip"> <a href="#custom-dh-parameters-for-perfect-forward-secrecy" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1228,7 +1228,7 @@
use a ConfigMap to configure custom Diffie-Hellman parameters file to help with use a ConfigMap to configure custom Diffie-Hellman parameters file to help with
"Perfect Forward Secrecy".</p> "Perfect Forward Secrecy".</p>
<h2 id="custom-configuration">Custom configuration<a class="headerlink" href="#custom-configuration" title="Permanent link"></a></h2> <h2 id="custom-configuration">Custom configuration<a class="headerlink" href="#custom-configuration" title="Permanent link"></a></h2>
<div class="codehilite"><pre><span></span><span class="gp">$</span> cat configmap.yaml <div class="codehilite"><pre><span></span><code><span class="gp">$</span> cat configmap.yaml
<span class="go">apiVersion: v1</span> <span class="go">apiVersion: v1</span>
<span class="go">data:</span> <span class="go">data:</span>
<span class="go"> ssl-dh-param: &quot;ingress-nginx/lb-dhparam&quot;</span> <span class="go"> ssl-dh-param: &quot;ingress-nginx/lb-dhparam&quot;</span>
@ -1239,17 +1239,17 @@ use a ConfigMap to configure custom Diffie-Hellman parameters file to help with
<span class="go"> labels:</span> <span class="go"> labels:</span>
<span class="go"> app.kubernetes.io/name: ingress-nginx</span> <span class="go"> app.kubernetes.io/name: ingress-nginx</span>
<span class="go"> app.kubernetes.io/part-of: ingress-nginx</span> <span class="go"> app.kubernetes.io/part-of: ingress-nginx</span>
</pre></div> </code></pre></div>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl create -f configmap.yaml <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl create -f configmap.yaml
</pre></div> </code></pre></div>
<h2 id="custom-dh-parameters-secret">Custom DH parameters secret<a class="headerlink" href="#custom-dh-parameters-secret" title="Permanent link"></a></h2> <h2 id="custom-dh-parameters-secret">Custom DH parameters secret<a class="headerlink" href="#custom-dh-parameters-secret" title="Permanent link"></a></h2>
<div class="codehilite"><pre><span></span><span class="gp">$</span>&gt; openssl dhparam <span class="m">1024</span> <span class="m">2</span>&gt; /dev/null <span class="p">|</span> base64 <div class="codehilite"><pre><span></span><code><span class="gp">$</span>&gt; openssl dhparam <span class="m">1024</span> <span class="m">2</span>&gt; /dev/null <span class="p">|</span> base64
<span class="go">LS0tLS1CRUdJTiBESCBQQVJBTUVURVJ...</span> <span class="go">LS0tLS1CRUdJTiBESCBQQVJBTUVURVJ...</span>
</pre></div> </code></pre></div>
<div class="codehilite"><pre><span></span><span class="gp">$</span> cat ssl-dh-param.yaml <div class="codehilite"><pre><span></span><code><span class="gp">$</span> cat ssl-dh-param.yaml
<span class="go">apiVersion: v1</span> <span class="go">apiVersion: v1</span>
<span class="go">data:</span> <span class="go">data:</span>
<span class="go"> dhparam.pem: &quot;LS0tLS1CRUdJTiBESCBQQVJBTUVURVJ...&quot;</span> <span class="go"> dhparam.pem: &quot;LS0tLS1CRUdJTiBESCBQQVJBTUVURVJ...&quot;</span>
@ -1260,14 +1260,15 @@ use a ConfigMap to configure custom Diffie-Hellman parameters file to help with
<span class="go"> labels:</span> <span class="go"> labels:</span>
<span class="go"> app.kubernetes.io/name: ingress-nginx</span> <span class="go"> app.kubernetes.io/name: ingress-nginx</span>
<span class="go"> app.kubernetes.io/part-of: ingress-nginx</span> <span class="go"> app.kubernetes.io/part-of: ingress-nginx</span>
</pre></div> </code></pre></div>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl create -f ssl-dh-param.yaml <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl create -f ssl-dh-param.yaml
</pre></div> </code></pre></div>
<h2 id="test">Test<a class="headerlink" href="#test" title="Permanent link"></a></h2> <h2 id="test">Test<a class="headerlink" href="#test" title="Permanent link"></a></h2>
<p>Check the contents of the configmap is present in the nginx.conf file using: <p>Check the contents of the configmap is present in the nginx.conf file using:
<code class="codehilite">kubectl exec nginx-ingress-controller-873061567-4n3k2 -n kube-system cat /etc/nginx/nginx.conf</code></p> <code class="codehilite"><span class="err">kubectl exec nginx-ingress-controller-873061567-4n3k2 -n kube-system cat /etc/nginx/nginx.conf</span></code></p>
@ -1325,9 +1326,9 @@ use a ConfigMap to configure custom Diffie-Hellman parameters file to help with
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1337,7 +1338,7 @@ use a ConfigMap to configure custom Diffie-Hellman parameters file to help with
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#sysctl-tuning" tabindex="1" class="md-skip"> <a href="#sysctl-tuning" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1151,15 +1151,15 @@
<h1 id="sysctl-tuning">Sysctl tuning<a class="headerlink" href="#sysctl-tuning" title="Permanent link"></a></h1> <h1 id="sysctl-tuning">Sysctl tuning<a class="headerlink" href="#sysctl-tuning" title="Permanent link"></a></h1>
<p>This example aims to demonstrate the use of an Init Container to adjust sysctl default values using <code class="codehilite">kubectl patch</code></p> <p>This example aims to demonstrate the use of an Init Container to adjust sysctl default values using <code class="codehilite"><span class="err">kubectl patch</span></code></p>
<div class="codehilite"><pre><span></span><span class="go">kubectl patch deployment -n ingress-nginx nginx-ingress-controller \</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl patch deployment -n ingress-nginx nginx-ingress-controller \</span>
<span class="go"> --patch=&quot;$(curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/customization/sysctl/patch.json)&quot;</span> <span class="go"> --patch=&quot;$(curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/customization/sysctl/patch.json)&quot;</span>
</pre></div> </code></pre></div>
<p><strong>Changes:</strong></p> <p><strong>Changes:</strong></p>
<ul> <ul>
<li>Backlog Queue setting <code class="codehilite">net.core.somaxconn</code> from <code class="codehilite">128</code> to <code class="codehilite">32768</code></li> <li>Backlog Queue setting <code class="codehilite"><span class="err">net.core.somaxconn</span></code> from <code class="codehilite"><span class="err">128</span></code> to <code class="codehilite"><span class="err">32768</span></code></li>
<li>Ephemeral Ports setting <code class="codehilite">net.ipv4.ip_local_port_range</code> from <code class="codehilite">32768 60999</code> to <code class="codehilite">1024 65000</code></li> <li>Ephemeral Ports setting <code class="codehilite"><span class="err">net.ipv4.ip_local_port_range</span></code> from <code class="codehilite"><span class="err">32768 60999</span></code> to <code class="codehilite"><span class="err">1024 65000</span></code></li>
</ul> </ul>
<p>In a <a href="https://www.nginx.com/blog/tuning-nginx/">post from the NGINX blog</a>, it is possible to see an explanation for the changes.</p> <p>In a <a href="https://www.nginx.com/blog/tuning-nginx/">post from the NGINX blog</a>, it is possible to see an explanation for the changes.</p>
@ -1171,6 +1171,7 @@
</article> </article>
</div> </div>
</div> </div>
@ -1219,9 +1220,9 @@
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1231,7 +1232,7 @@
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#docker-registry" tabindex="1" class="md-skip"> <a href="#docker-registry" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1251,39 +1251,40 @@
<p>This example demonstrates how to deploy a <a href="https://github.com/docker/distribution">docker registry</a> in the cluster and configure Ingress enable access from Internet</p> <p>This example demonstrates how to deploy a <a href="https://github.com/docker/distribution">docker registry</a> in the cluster and configure Ingress enable access from Internet</p>
<h2 id="deployment">Deployment<a class="headerlink" href="#deployment" title="Permanent link"></a></h2> <h2 id="deployment">Deployment<a class="headerlink" href="#deployment" title="Permanent link"></a></h2>
<p>First we deploy the docker registry in the cluster:</p> <p>First we deploy the docker registry in the cluster:</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/docker-registry/deployment.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/docker-registry/deployment.yaml</span>
</pre></div> </code></pre></div>
<div class="admonition important"> <div class="admonition important">
<p class="admonition-title">Important</p> <p class="admonition-title">Important</p>
<p><strong>DO NOT RUN THIS IN PRODUCTION</strong></p> <p><strong>DO NOT RUN THIS IN PRODUCTION</strong></p>
<p>This deployment uses <code class="codehilite">emptyDir</code> in the <code class="codehilite">volumeMount</code> which means the contents of the registry will be deleted when the pod dies.</p> <p>This deployment uses <code class="codehilite"><span class="err">emptyDir</span></code> in the <code class="codehilite"><span class="err">volumeMount</span></code> which means the contents of the registry will be deleted when the pod dies.</p>
</div> </div>
<p>The next required step is creation of the ingress rules. To do this we have two options: with and without TLS</p> <p>The next required step is creation of the ingress rules. To do this we have two options: with and without TLS</p>
<h3 id="without-tls">Without TLS<a class="headerlink" href="#without-tls" title="Permanent link"></a></h3> <h3 id="without-tls">Without TLS<a class="headerlink" href="#without-tls" title="Permanent link"></a></h3>
<p>Download and edit the yaml deployment replacing <code class="codehilite">registry.&lt;your domain&gt;</code> with a valid DNS name pointing to the ingress controller:</p> <p>Download and edit the yaml deployment replacing <code class="codehilite"><span class="err">registry.&lt;your domain&gt;</span></code> with a valid DNS name pointing to the ingress controller:</p>
<div class="codehilite"><pre><span></span><span class="go">wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/docker-registry/ingress-without-tls.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/docker-registry/ingress-without-tls.yaml</span>
</pre></div> </code></pre></div>
<div class="admonition important"> <div class="admonition important">
<p class="admonition-title">Important</p> <p class="admonition-title">Important</p>
</div>
<p>Running a docker registry without TLS requires we configure our local docker daemon with the insecure registry flag.</p> <p>Running a docker registry without TLS requires we configure our local docker daemon with the insecure registry flag.</p>
</div>
<p>Please check <a href="https://docs.docker.com/registry/insecure/#deploy-a-plain-http-registry">deploy a plain http registry</a></p> <p>Please check <a href="https://docs.docker.com/registry/insecure/#deploy-a-plain-http-registry">deploy a plain http registry</a></p>
<h3 id="with-tls">With TLS<a class="headerlink" href="#with-tls" title="Permanent link"></a></h3> <h3 id="with-tls">With TLS<a class="headerlink" href="#with-tls" title="Permanent link"></a></h3>
<p>Download and edit the yaml deployment replacing <code class="codehilite">registry.&lt;your domain&gt;</code> with a valid DNS name pointing to the ingress controller:</p> <p>Download and edit the yaml deployment replacing <code class="codehilite"><span class="err">registry.&lt;your domain&gt;</span></code> with a valid DNS name pointing to the ingress controller:</p>
<div class="codehilite"><pre><span></span><span class="go">wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/docker-registry/ingress-with-tls.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/docker-registry/ingress-with-tls.yaml</span>
</pre></div> </code></pre></div>
<p>Deploy <a href="https://github.com/jetstack/kube-lego">kube lego</a> use <a href="https://letsencrypt.org/">Let's Encrypt</a> certificates or edit the ingress rule to use a secret with an existing SSL certificate.</p> <p>Deploy <a href="https://github.com/jetstack/kube-lego">kube lego</a> use <a href="https://letsencrypt.org/">Let's Encrypt</a> certificates or edit the ingress rule to use a secret with an existing SSL certificate.</p>
<h3 id="testing">Testing<a class="headerlink" href="#testing" title="Permanent link"></a></h3> <h3 id="testing">Testing<a class="headerlink" href="#testing" title="Permanent link"></a></h3>
<p>To test the registry is working correctly we download a known image from <a href="https://hub.docker.com">docker hub</a>, create a tag pointing to the new registry and upload the image:</p> <p>To test the registry is working correctly we download a known image from <a href="https://hub.docker.com">docker hub</a>, create a tag pointing to the new registry and upload the image:</p>
<div class="codehilite"><pre><span></span><span class="go">docker pull ubuntu:16.04</span> <div class="codehilite"><pre><span></span><code><span class="go">docker pull ubuntu:16.04</span>
<span class="go">docker tag ubuntu:16.04 `registry.&lt;your domain&gt;/ubuntu:16.04`</span> <span class="go">docker tag ubuntu:16.04 `registry.&lt;your domain&gt;/ubuntu:16.04`</span>
<span class="go">docker push `registry.&lt;your domain&gt;/ubuntu:16.04`</span> <span class="go">docker push `registry.&lt;your domain&gt;/ubuntu:16.04`</span>
</pre></div> </code></pre></div>
<p>Please replace <code class="codehilite"><span class="err">registry.&lt;your domain&gt;</span></code> with your domain.</p>
<p>Please replace <code class="codehilite">registry.&lt;your domain&gt;</code> with your domain.</p>
@ -1341,9 +1342,9 @@
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1353,7 +1354,7 @@
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#grpc" tabindex="1" class="md-skip"> <a href="#grpc" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1295,9 +1295,9 @@ nginx controller.</p>
<h2 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link"></a></h2> <h2 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link"></a></h2>
<ol> <ol>
<li>You have a kubernetes cluster running.</li> <li>You have a kubernetes cluster running.</li>
<li>You have a domain name such as <code class="codehilite">example.com</code> that is configured to route <li>You have a domain name such as <code class="codehilite"><span class="err">example.com</span></code> that is configured to route
traffic to the ingress controller. Replace references to traffic to the ingress controller. Replace references to
<code class="codehilite">fortune-teller.stack.build</code> (the domain name used in this example) to your <code class="codehilite"><span class="err">fortune-teller.stack.build</span></code> (the domain name used in this example) to your
own domain name (you're also responsible for provisioning an SSL certificate own domain name (you're also responsible for provisioning an SSL certificate
for the ingress).</li> for the ingress).</li>
<li>You have the nginx-ingress controller installed in typical fashion (must be <li>You have the nginx-ingress controller installed in typical fashion (must be
@ -1309,59 +1309,59 @@ nginx controller.</p>
<a href="https://github.com/kubernetes/ingress-nginx/tree/master/images/grpc-fortune-teller">fortune-teller</a> <a href="https://github.com/kubernetes/ingress-nginx/tree/master/images/grpc-fortune-teller">fortune-teller</a>
application provided here as an example.</li> application provided here as an example.</li>
</ol> </ol>
<h3 id="step-1-kubernetes-deployment">Step 1: kubernetes <code class="codehilite">Deployment</code><a class="headerlink" href="#step-1-kubernetes-deployment" title="Permanent link"></a></h3> <h3 id="step-1-kubernetes-deployment">Step 1: kubernetes <code class="codehilite"><span class="err">Deployment</span></code><a class="headerlink" href="#step-1-kubernetes-deployment" title="Permanent link"></a></h3>
<div class="codehilite"><pre><span></span>$ kubectl create -f app.yaml <div class="codehilite"><pre><span></span><code>$ kubectl create -f app.yaml
</pre></div> </code></pre></div>
<p>This is a standard kubernetes deployment object. It is running a grpc service <p>This is a standard kubernetes deployment object. It is running a grpc service
listening on port <code class="codehilite">50051</code>.</p> listening on port <code class="codehilite"><span class="err">50051</span></code>.</p>
<p>The sample application <p>The sample application
<a href="https://github.com/kubernetes/ingress-nginx/tree/master/images/grpc-fortune-teller">fortune-teller-app</a> <a href="https://github.com/kubernetes/ingress-nginx/tree/master/images/grpc-fortune-teller">fortune-teller-app</a>
is a grpc server implemented in go. Here's the stripped-down implementation:</p> is a grpc server implemented in go. Here's the stripped-down implementation:</p>
<div class="codehilite"><pre><span></span><span class="kd">func</span> <span class="nx">main</span><span class="p">()</span> <span class="p">{</span> <div class="codehilite"><pre><span></span><code><span class="kd">func</span> <span class="nx">main</span><span class="p">()</span> <span class="p">{</span>
<span class="nx">grpcServer</span> <span class="o">:=</span> <span class="nx">grpc</span><span class="p">.</span><span class="nx">NewServer</span><span class="p">()</span> <span class="nx">grpcServer</span> <span class="o">:=</span> <span class="nx">grpc</span><span class="p">.</span><span class="nx">NewServer</span><span class="p">()</span>
<span class="nx">fortune</span><span class="p">.</span><span class="nx">RegisterFortuneTellerServer</span><span class="p">(</span><span class="nx">grpcServer</span><span class="p">,</span> <span class="o">&amp;</span><span class="nx">FortuneTeller</span><span class="p">{})</span> <span class="nx">fortune</span><span class="p">.</span><span class="nx">RegisterFortuneTellerServer</span><span class="p">(</span><span class="nx">grpcServer</span><span class="p">,</span> <span class="o">&amp;</span><span class="nx">FortuneTeller</span><span class="p">{})</span>
<span class="nx">lis</span><span class="p">,</span> <span class="nx">_</span> <span class="o">:=</span> <span class="nx">net</span><span class="p">.</span><span class="nx">Listen</span><span class="p">(</span><span class="s">&quot;tcp&quot;</span><span class="p">,</span> <span class="s">&quot;:50051&quot;</span><span class="p">)</span> <span class="nx">lis</span><span class="p">,</span> <span class="nx">_</span> <span class="o">:=</span> <span class="nx">net</span><span class="p">.</span><span class="nx">Listen</span><span class="p">(</span><span class="s">&quot;tcp&quot;</span><span class="p">,</span> <span class="s">&quot;:50051&quot;</span><span class="p">)</span>
<span class="nx">grpcServer</span><span class="p">.</span><span class="nx">Serve</span><span class="p">(</span><span class="nx">lis</span><span class="p">)</span> <span class="nx">grpcServer</span><span class="p">.</span><span class="nx">Serve</span><span class="p">(</span><span class="nx">lis</span><span class="p">)</span>
<span class="p">}</span> <span class="p">}</span>
</pre></div> </code></pre></div>
<p>The takeaway is that we are not doing any TLS configuration on the server (as we <p>The takeaway is that we are not doing any TLS configuration on the server (as we
are terminating TLS at the ingress level, grpc traffic will travel unencrypted are terminating TLS at the ingress level, grpc traffic will travel unencrypted
inside the cluster and arrive "insecure").</p> inside the cluster and arrive "insecure").</p>
<p>For your own application you may or may not want to do this. If you prefer to <p>For your own application you may or may not want to do this. If you prefer to
forward encrypted traffic to your POD and terminate TLS at the gRPC server forward encrypted traffic to your POD and terminate TLS at the gRPC server
itself, add the ingress annotation <code class="codehilite">nginx.ingress.kubernetes.io/backend-protocol: &quot;GRPCS&quot;</code>.</p> itself, add the ingress annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/backend-protocol: &quot;GRPCS&quot;</span></code>.</p>
<h3 id="step-2-the-kubernetes-service">Step 2: the kubernetes <code class="codehilite">Service</code><a class="headerlink" href="#step-2-the-kubernetes-service" title="Permanent link"></a></h3> <h3 id="step-2-the-kubernetes-service">Step 2: the kubernetes <code class="codehilite"><span class="err">Service</span></code><a class="headerlink" href="#step-2-the-kubernetes-service" title="Permanent link"></a></h3>
<div class="codehilite"><pre><span></span>$ kubectl create -f svc.yaml <div class="codehilite"><pre><span></span><code>$ kubectl create -f svc.yaml
</pre></div> </code></pre></div>
<p>Here we have a typical service. Nothing special, just routing traffic to the <p>Here we have a typical service. Nothing special, just routing traffic to the
backend application on port <code class="codehilite">50051</code>.</p> backend application on port <code class="codehilite"><span class="err">50051</span></code>.</p>
<h3 id="step-3-the-kubernetes-ingress">Step 3: the kubernetes <code class="codehilite">Ingress</code><a class="headerlink" href="#step-3-the-kubernetes-ingress" title="Permanent link"></a></h3> <h3 id="step-3-the-kubernetes-ingress">Step 3: the kubernetes <code class="codehilite"><span class="err">Ingress</span></code><a class="headerlink" href="#step-3-the-kubernetes-ingress" title="Permanent link"></a></h3>
<div class="codehilite"><pre><span></span>$ kubectl create -f ingress.yaml <div class="codehilite"><pre><span></span><code>$ kubectl create -f ingress.yaml
</pre></div> </code></pre></div>
<p>A few things to note:</p> <p>A few things to note:</p>
<ol> <ol>
<li>We've tagged the ingress with the annotation <li>We've tagged the ingress with the annotation
<code class="codehilite">nginx.ingress.kubernetes.io/backend-protocol: &quot;GRPC&quot;</code>. This is the magic <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/backend-protocol: &quot;GRPC&quot;</span></code>. This is the magic
ingredient that sets up the appropriate nginx configuration to route http/2 ingredient that sets up the appropriate nginx configuration to route http/2
traffic to our service.</li> traffic to our service.</li>
<li>We're terminating TLS at the ingress and have configured an SSL certificate <li>We're terminating TLS at the ingress and have configured an SSL certificate
<code class="codehilite">fortune-teller.stack.build</code>. The ingress matches traffic arriving as <code class="codehilite"><span class="err">fortune-teller.stack.build</span></code>. The ingress matches traffic arriving as
<code class="codehilite">https://fortune-teller.stack.build:443</code> and routes unencrypted messages to <code class="codehilite"><span class="c">https://fortune-teller.stack.build:443</span></code> and routes unencrypted messages to
our kubernetes service.</li> our kubernetes service.</li>
</ol> </ol>
<h3 id="step-4-test-the-connection">Step 4: test the connection<a class="headerlink" href="#step-4-test-the-connection" title="Permanent link"></a></h3> <h3 id="step-4-test-the-connection">Step 4: test the connection<a class="headerlink" href="#step-4-test-the-connection" title="Permanent link"></a></h3>
<p>Once we've applied our configuration to kubernetes, it's time to test that we <p>Once we've applied our configuration to kubernetes, it's time to test that we
can actually talk to the backend. To do this, we'll use the can actually talk to the backend. To do this, we'll use the
<a href="https://github.com/fullstorydev/grpcurl">grpcurl</a> utility:</p> <a href="https://github.com/fullstorydev/grpcurl">grpcurl</a> utility:</p>
<div class="codehilite"><pre><span></span>$ grpcurl fortune-teller.stack.build:443 build.stack.fortune.FortuneTeller/Predict <div class="codehilite"><pre><span></span><code>$ grpcurl fortune-teller.stack.build:443 build.stack.fortune.FortuneTeller/Predict
<span class="o">{</span> <span class="o">{</span>
<span class="s2">&quot;message&quot;</span>: <span class="s2">&quot;Let us endeavor so to live that when we come to die even the undertaker will be sorry.\n\t\t-- Mark Twain, \&quot;Pudd&#39;nhead Wilson&#39;s Calendar\&quot;&quot;</span> <span class="s2">&quot;message&quot;</span>: <span class="s2">&quot;Let us endeavor so to live that when we come to die even the undertaker will be sorry.\n\t\t-- Mark Twain, \&quot;Pudd&#39;nhead Wilson&#39;s Calendar\&quot;&quot;</span>
<span class="o">}</span> <span class="o">}</span>
</pre></div> </code></pre></div>
<h3 id="debugging-hints">Debugging Hints<a class="headerlink" href="#debugging-hints" title="Permanent link"></a></h3> <h3 id="debugging-hints">Debugging Hints<a class="headerlink" href="#debugging-hints" title="Permanent link"></a></h3>
<ol> <ol>
@ -1369,7 +1369,7 @@ can actually talk to the backend. To do this, we'll use the
<li>Watch the logs for the nginx-ingress-controller (increasing verbosity as <li>Watch the logs for the nginx-ingress-controller (increasing verbosity as
needed).</li> needed).</li>
<li>Double-check your address and ports.</li> <li>Double-check your address and ports.</li>
<li>Set the <code class="codehilite">GODEBUG=http2debug=2</code> environment variable to get detailed http/2 <li>Set the <code class="codehilite"><span class="err">GODEBUG=http2debug=2</span></code> environment variable to get detailed http/2
logging on the client and/or server.</li> logging on the client and/or server.</li>
<li>Study RFC 7540 (http/2) <a href="https://tools.ietf.org/html/rfc7540">https://tools.ietf.org/html/rfc7540</a>.</li> <li>Study RFC 7540 (http/2) <a href="https://tools.ietf.org/html/rfc7540">https://tools.ietf.org/html/rfc7540</a>.</li>
</ol> </ol>
@ -1381,14 +1381,14 @@ to help make it easier for your users to consume your API.</p>
</blockquote> </blockquote>
<h3 id="notes-on-using-responserequest-streams">Notes on using response/request streams<a class="headerlink" href="#notes-on-using-responserequest-streams" title="Permanent link"></a></h3> <h3 id="notes-on-using-responserequest-streams">Notes on using response/request streams<a class="headerlink" href="#notes-on-using-responserequest-streams" title="Permanent link"></a></h3>
<ol> <ol>
<li>If your server does only response streaming and you expect a stream to be open longer than 60 seconds, you will have to change the <code class="codehilite">grpc_read_timeout</code> to acommodate for this.</li> <li>If your server does only response streaming and you expect a stream to be open longer than 60 seconds, you will have to change the <code class="codehilite"><span class="err">grpc_read_timeout</span></code> to acommodate for this.</li>
<li>If your service does only request streaming and you expect a stream to be open longer than 60 seconds, you have to change the <li>If your service does only request streaming and you expect a stream to be open longer than 60 seconds, you have to change the
<code class="codehilite">grpc_send_timeout</code> and the <code class="codehilite">client_body_timeout</code>.</li> <code class="codehilite"><span class="err">grpc_send_timeout</span></code> and the <code class="codehilite"><span class="err">client_body_timeout</span></code>.</li>
<li>If you do both response and request streaming with an open stream longer than 60 seconds, you have to change all three timeouts: <code class="codehilite">grpc_read_timeout</code>, <code class="codehilite">grpc_send_timeout</code> and <code class="codehilite">client_body_timeout</code>.</li> <li>If you do both response and request streaming with an open stream longer than 60 seconds, you have to change all three timeouts: <code class="codehilite"><span class="err">grpc_read_timeout</span></code>, <code class="codehilite"><span class="err">grpc_send_timeout</span></code> and <code class="codehilite"><span class="err">client_body_timeout</span></code>.</li>
</ol> </ol>
<p>Values for the timeouts must be specified as e.g. <code class="codehilite">&quot;1200s&quot;</code>.</p> <p>Values for the timeouts must be specified as e.g. <code class="codehilite"><span class="err">&quot;1200s&quot;</span></code>.</p>
<blockquote> <blockquote>
<p>On the most recent versions of nginx-ingress, changing these timeouts requires using the <code class="codehilite">nginx.ingress.kubernetes.io/server-snippet</code> annotation. There are plans for future releases to allow using the Kubernetes annotations to define each timeout seperately.</p> <p>On the most recent versions of nginx-ingress, changing these timeouts requires using the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/server-snippet</span></code> annotation. There are plans for future releases to allow using the Kubernetes annotations to define each timeout seperately.</p>
</blockquote> </blockquote>
@ -1399,6 +1399,7 @@ to help make it easier for your users to consume your API.</p>
</article> </article>
</div> </div>
</div> </div>
@ -1447,9 +1448,9 @@ to help make it easier for your users to consume your API.</p>
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1459,7 +1460,7 @@ to help make it easier for your users to consume your API.</p>
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../assets/images/favicon.png"> <link rel="shortcut icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../assets/javascripts/modernizr.74668098.js"></script> <script src="../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#ingress-examples" tabindex="1" class="md-skip"> <a href="#ingress-examples" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1274,6 +1274,7 @@ Please review the <a href="PREREQUISITES/">prerequisites</a> before trying them.
</article> </article>
</div> </div>
</div> </div>
@ -1322,9 +1323,9 @@ Please review the <a href="PREREQUISITES/">prerequisites</a> before trying them.
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1334,7 +1335,7 @@ Please review the <a href="PREREQUISITES/">prerequisites</a> before trying them.
</div> </div>
<script src="../assets/javascripts/application.ac79c3b0.js"></script> <script src="../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script> <script>app.initialize({version:"1.0.4",url:{base:".."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#multi-tls-certificate-termination" tabindex="1" class="md-skip"> <a href="#multi-tls-certificate-termination" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1156,7 +1156,7 @@
<li>Create <a href="multi-tls.yaml">multi-tls.yaml</a></li> <li>Create <a href="multi-tls.yaml">multi-tls.yaml</a></li>
</ol> </ol>
<p>This should generate a segment like: <p>This should generate a segment like:
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl <span class="nb">exec</span> -it nginx-ingress-controller-6vwd1 -- cat /etc/nginx/nginx.conf <span class="p">|</span> grep <span class="s2">&quot;foo.bar.com&quot;</span> -B <span class="m">7</span> -A <span class="m">35</span> <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl <span class="nb">exec</span> -it nginx-ingress-controller-6vwd1 -- cat /etc/nginx/nginx.conf <span class="p">|</span> grep <span class="s2">&quot;foo.bar.com&quot;</span> -B <span class="m">7</span> -A <span class="m">35</span>
<span class="go"> server {</span> <span class="go"> server {</span>
<span class="go"> listen 80;</span> <span class="go"> listen 80;</span>
<span class="go"> listen 443 ssl http2;</span> <span class="go"> listen 443 ssl http2;</span>
@ -1198,9 +1198,9 @@
<span class="go"> proxy_pass http://default-http-svc-80;</span> <span class="go"> proxy_pass http://default-http-svc-80;</span>
<span class="go"> }</span> <span class="go"> }</span>
</pre></div></p> </code></pre></div></p>
<p>And you should be able to reach your nginx service or http-svc service using a hostname switch: <p>And you should be able to reach your nginx service or http-svc service using a hostname switch:
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get ing <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get ing
<span class="go">NAME RULE BACKEND ADDRESS AGE</span> <span class="go">NAME RULE BACKEND ADDRESS AGE</span>
<span class="go">foo-tls - 104.154.30.67 13m</span> <span class="go">foo-tls - 104.154.30.67 13m</span>
<span class="go"> foo.bar.com</span> <span class="go"> foo.bar.com</span>
@ -1237,7 +1237,8 @@
<span class="gp">$</span> curl <span class="m">104</span>.154.30.67 <span class="gp">$</span> curl <span class="m">104</span>.154.30.67
<span class="go">default backend - 404</span> <span class="go">default backend - 404</span>
</pre></div></p> </code></pre></div></p>
@ -1295,9 +1296,9 @@
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1307,7 +1308,7 @@
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#pod-security-policy-psp" tabindex="1" class="md-skip"> <a href="#pod-security-policy-psp" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1157,8 +1157,8 @@ Kubernetes however provides a more fine-grained authorization policy called
If you have PSP enabled on the cluster, and you deploy ingress-nginx, If you have PSP enabled on the cluster, and you deploy ingress-nginx,
you will need to provide the Deployment with the permissions to create pods.</p> you will need to provide the Deployment with the permissions to create pods.</p>
<p>Before applying any objects, first apply the PSP permissions by running: <p>Before applying any objects, first apply the PSP permissions by running:
<div class="codehilite"><pre><span></span><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/psp/psp.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/psp/psp.yaml</span>
</pre></div></p> </code></pre></div></p>
<p>Now that the pod security policy is applied, we can continue as usual by applying the <p>Now that the pod security policy is applied, we can continue as usual by applying the
<a href="https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/mandatory.yaml">mandatory.yaml</a> <a href="https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/mandatory.yaml">mandatory.yaml</a>
according to the <a href="../../deploy/">Installation Guide</a>.</p> according to the <a href="../../deploy/">Installation Guide</a>.</p>
@ -1174,6 +1174,7 @@ only after deleting them and reapplying mandatory.yaml.</p>
</article> </article>
</div> </div>
</div> </div>
@ -1208,9 +1209,9 @@ only after deleting them and reapplying mandatory.yaml.</p>
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1220,7 +1221,7 @@ only after deleting them and reapplying mandatory.yaml.</p>
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#rewrite" tabindex="1" class="md-skip"> <a href="#rewrite" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1309,14 +1309,14 @@ and that you have an ingress controller <a href="../../deploy/">running</a> in y
<h3 id="rewrite-target">Rewrite Target<a class="headerlink" href="#rewrite-target" title="Permanent link"></a></h3> <h3 id="rewrite-target">Rewrite Target<a class="headerlink" href="#rewrite-target" title="Permanent link"></a></h3>
<div class="admonition attention"> <div class="admonition attention">
<p class="admonition-title">Attention</p> <p class="admonition-title">Attention</p>
<p>Starting in Version 0.22.0, ingress definitions using the annotation <code class="codehilite">nginx.ingress.kubernetes.io/rewrite-target</code> are not backwards compatible with previous versions. In Version 0.22.0 and beyond, any substrings within the request URI that need to be passed to the rewritten path must explicitly be defined in a <a href="https://www.regular-expressions.info/refcapture.html">capture group</a>.</p> <p>Starting in Version 0.22.0, ingress definitions using the annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/rewrite-target</span></code> are not backwards compatible with previous versions. In Version 0.22.0 and beyond, any substrings within the request URI that need to be passed to the rewritten path must explicitly be defined in a <a href="https://www.regular-expressions.info/refcapture.html">capture group</a>.</p>
</div> </div>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
<p><a href="https://www.regular-expressions.info/refcapture.html">Captured groups</a> are saved in numbered placeholders, chronologically, in the form <code class="codehilite">$1</code>, <code class="codehilite">$2</code> ... <code class="codehilite">$n</code>. These placeholders can be used as parameters in the <code class="codehilite">rewrite-target</code> annotation.</p> <p><a href="https://www.regular-expressions.info/refcapture.html">Captured groups</a> are saved in numbered placeholders, chronologically, in the form <code class="codehilite"><span class="err">$1</span></code>, <code class="codehilite"><span class="err">$2</span></code> ... <code class="codehilite"><span class="err">$n</span></code>. These placeholders can be used as parameters in the <code class="codehilite"><span class="err">rewrite-target</span></code> annotation.</p>
</div> </div>
<p>Create an Ingress rule with a rewrite annotation:</p> <p>Create an Ingress rule with a rewrite annotation:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> <span class="nb">echo</span> <span class="err">&#39;</span> <div class="codehilite"><pre><span></span><code><span class="gp">$</span> <span class="nb">echo</span> <span class="err">&#39;</span>
<span class="go">apiVersion: networking.k8s.io/v1beta1</span> <span class="go">apiVersion: networking.k8s.io/v1beta1</span>
<span class="go">kind: Ingress</span> <span class="go">kind: Ingress</span>
<span class="go">metadata:</span> <span class="go">metadata:</span>
@ -1334,18 +1334,18 @@ and that you have an ingress controller <a href="../../deploy/">running</a> in y
<span class="go"> servicePort: 80</span> <span class="go"> servicePort: 80</span>
<span class="go"> path: /something(/|$)(.*)</span> <span class="go"> path: /something(/|$)(.*)</span>
<span class="go">&#39; | kubectl create -f -</span> <span class="go">&#39; | kubectl create -f -</span>
</pre></div> </code></pre></div>
<p>In this ingress definition, any characters captured by <code class="codehilite">(.*)</code> will be assigned to the placeholder <code class="codehilite">$2</code>, which is then used as a parameter in the <code class="codehilite">rewrite-target</code> annotation.</p> <p>In this ingress definition, any characters captured by <code class="codehilite"><span class="err">(.*)</span></code> will be assigned to the placeholder <code class="codehilite"><span class="err">$2</span></code>, which is then used as a parameter in the <code class="codehilite"><span class="err">rewrite-target</span></code> annotation.</p>
<p>For example, the ingress definition above will result in the following rewrites:</p> <p>For example, the ingress definition above will result in the following rewrites:</p>
<ul> <ul>
<li><code class="codehilite">rewrite.bar.com/something</code> rewrites to <code class="codehilite">rewrite.bar.com/</code></li> <li><code class="codehilite"><span class="err">rewrite.bar.com/something</span></code> rewrites to <code class="codehilite"><span class="err">rewrite.bar.com/</span></code></li>
<li><code class="codehilite">rewrite.bar.com/something/</code> rewrites to <code class="codehilite">rewrite.bar.com/</code></li> <li><code class="codehilite"><span class="err">rewrite.bar.com/something/</span></code> rewrites to <code class="codehilite"><span class="err">rewrite.bar.com/</span></code></li>
<li><code class="codehilite">rewrite.bar.com/something/new</code> rewrites to <code class="codehilite">rewrite.bar.com/new</code></li> <li><code class="codehilite"><span class="err">rewrite.bar.com/something/new</span></code> rewrites to <code class="codehilite"><span class="err">rewrite.bar.com/new</span></code></li>
</ul> </ul>
<h3 id="app-root">App Root<a class="headerlink" href="#app-root" title="Permanent link"></a></h3> <h3 id="app-root">App Root<a class="headerlink" href="#app-root" title="Permanent link"></a></h3>
<p>Create an Ingress rule with a app-root annotation: <p>Create an Ingress rule with a app-root annotation:
<div class="codehilite"><pre><span></span>$ <span class="nb">echo</span> <span class="s2">&quot;</span> <div class="codehilite"><pre><span></span><code>$ <span class="nb">echo</span> <span class="s2">&quot;</span>
<span class="s2">apiVersion: networking.k8s.io/v1beta1</span> <span class="s2">apiVersion: networking.k8s.io/v1beta1</span>
<span class="s2">kind: Ingress</span> <span class="s2">kind: Ingress</span>
<span class="s2">metadata:</span> <span class="s2">metadata:</span>
@ -1363,9 +1363,9 @@ and that you have an ingress controller <a href="../../deploy/">running</a> in y
<span class="s2"> servicePort: 80</span> <span class="s2"> servicePort: 80</span>
<span class="s2"> path: /</span> <span class="s2"> path: /</span>
<span class="s2">&quot;</span> <span class="p">|</span> kubectl create -f - <span class="s2">&quot;</span> <span class="p">|</span> kubectl create -f -
</pre></div></p> </code></pre></div></p>
<p>Check the rewrite is working</p> <p>Check the rewrite is working</p>
<div class="codehilite"><pre><span></span>$ curl -I -k http://approot.bar.com/ <div class="codehilite"><pre><span></span><code>$ curl -I -k http://approot.bar.com/
HTTP/1.1 <span class="m">302</span> Moved Temporarily HTTP/1.1 <span class="m">302</span> Moved Temporarily
Server: nginx/1.11.10 Server: nginx/1.11.10
Date: Mon, <span class="m">13</span> Mar <span class="m">2017</span> <span class="m">14</span>:57:15 GMT Date: Mon, <span class="m">13</span> Mar <span class="m">2017</span> <span class="m">14</span>:57:15 GMT
@ -1373,7 +1373,8 @@ Content-Type: text/html
Content-Length: <span class="m">162</span> Content-Length: <span class="m">162</span>
Location: http://stickyingress.example.com/app1 Location: http://stickyingress.example.com/app1
Connection: keep-alive Connection: keep-alive
</pre></div> </code></pre></div>
@ -1431,9 +1432,9 @@ Connection: keep-alive
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1443,7 +1444,7 @@ Connection: keep-alive
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#static-ips" tabindex="1" class="md-skip"> <a href="#static-ips" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1262,27 +1262,27 @@ by default nginx Ingresses will only get static IPs if your cloudprovider
supports static IP assignments to nodes. On GKE/GCE for example, even though supports static IP assignments to nodes. On GKE/GCE for example, even though
nodes get static IPs, the IPs are not retained across upgrade.</p> nodes get static IPs, the IPs are not retained across upgrade.</p>
<p>To acquire a static IP for the nginx ingress controller, simply put it <p>To acquire a static IP for the nginx ingress controller, simply put it
behind a Service of <code class="codehilite">Type=LoadBalancer</code>.</p> behind a Service of <code class="codehilite"><span class="err">Type=LoadBalancer</span></code>.</p>
<p>First, create a loadbalancer Service and wait for it to acquire an IP</p> <p>First, create a loadbalancer Service and wait for it to acquire an IP</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl create -f static-ip-svc.yaml <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl create -f static-ip-svc.yaml
<span class="go">service &quot;nginx-ingress-lb&quot; created</span> <span class="go">service &quot;nginx-ingress-lb&quot; created</span>
<span class="gp">$</span> kubectl get svc nginx-ingress-lb <span class="gp">$</span> kubectl get svc nginx-ingress-lb
<span class="go">NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE</span> <span class="go">NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE</span>
<span class="go">nginx-ingress-lb 10.0.138.113 104.154.109.191 80:31457/TCP,443:32240/TCP 15m</span> <span class="go">nginx-ingress-lb 10.0.138.113 104.154.109.191 80:31457/TCP,443:32240/TCP 15m</span>
</pre></div> </code></pre></div>
<p>then, update the ingress controller so it adopts the static IP of the Service <p>then, update the ingress controller so it adopts the static IP of the Service
by passing the <code class="codehilite">--publish-service</code> flag (the example yaml used in the next step by passing the <code class="codehilite"><span class="err">--publish-service</span></code> flag (the example yaml used in the next step
already has it set to "nginx-ingress-lb").</p> already has it set to "nginx-ingress-lb").</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl create -f nginx-ingress-controller.yaml <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl create -f nginx-ingress-controller.yaml
<span class="go">deployment &quot;nginx-ingress-controller&quot; created</span> <span class="go">deployment &quot;nginx-ingress-controller&quot; created</span>
</pre></div> </code></pre></div>
<h2 id="assigning-the-ip-to-an-ingress">Assigning the IP to an Ingress<a class="headerlink" href="#assigning-the-ip-to-an-ingress" title="Permanent link"></a></h2> <h2 id="assigning-the-ip-to-an-ingress">Assigning the IP to an Ingress<a class="headerlink" href="#assigning-the-ip-to-an-ingress" title="Permanent link"></a></h2>
<p>From here on every Ingress created with the <code class="codehilite">ingress.class</code> annotation set to <p>From here on every Ingress created with the <code class="codehilite"><span class="err">ingress.class</span></code> annotation set to
<code class="codehilite">nginx</code> will get the IP allocated in the previous step</p> <code class="codehilite"><span class="err">nginx</span></code> will get the IP allocated in the previous step</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl create -f nginx-ingress.yaml <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl create -f nginx-ingress.yaml
<span class="go">ingress &quot;nginx-ingress&quot; created</span> <span class="go">ingress &quot;nginx-ingress&quot; created</span>
<span class="gp">$</span> kubectl get ing ingress-nginx <span class="gp">$</span> kubectl get ing ingress-nginx
@ -1298,11 +1298,11 @@ already has it set to "nginx-ingress-lb").</p>
<span class="go">request_version=1.1</span> <span class="go">request_version=1.1</span>
<span class="go">request_uri=http://104.154.109.191:8080/</span> <span class="go">request_uri=http://104.154.109.191:8080/</span>
<span class="go">...</span> <span class="go">...</span>
</pre></div> </code></pre></div>
<h2 id="retaining-the-ip">Retaining the IP<a class="headerlink" href="#retaining-the-ip" title="Permanent link"></a></h2> <h2 id="retaining-the-ip">Retaining the IP<a class="headerlink" href="#retaining-the-ip" title="Permanent link"></a></h2>
<p>You can test retention by deleting the Ingress</p> <p>You can test retention by deleting the Ingress</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl delete ing nginx-ingress <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl delete ing nginx-ingress
<span class="go">ingress &quot;nginx-ingress&quot; deleted</span> <span class="go">ingress &quot;nginx-ingress&quot; deleted</span>
<span class="gp">$</span> kubectl create -f nginx-ingress.yaml <span class="gp">$</span> kubectl create -f nginx-ingress.yaml
@ -1311,7 +1311,7 @@ already has it set to "nginx-ingress-lb").</p>
<span class="gp">$</span> kubectl get ing nginx-ingress <span class="gp">$</span> kubectl get ing nginx-ingress
<span class="go">NAME HOSTS ADDRESS PORTS AGE</span> <span class="go">NAME HOSTS ADDRESS PORTS AGE</span>
<span class="go">nginx-ingress * 104.154.109.191 80, 443 13m</span> <span class="go">nginx-ingress * 104.154.109.191 80, 443 13m</span>
</pre></div> </code></pre></div>
<blockquote> <blockquote>
<p>Note that unlike the GCE Ingress, the same loadbalancer IP is shared amongst all <p>Note that unlike the GCE Ingress, the same loadbalancer IP is shared amongst all
@ -1320,14 +1320,14 @@ controllers.</p>
</blockquote> </blockquote>
<h2 id="promote-ephemeral-to-static-ip">Promote ephemeral to static IP<a class="headerlink" href="#promote-ephemeral-to-static-ip" title="Permanent link"></a></h2> <h2 id="promote-ephemeral-to-static-ip">Promote ephemeral to static IP<a class="headerlink" href="#promote-ephemeral-to-static-ip" title="Permanent link"></a></h2>
<p>To promote the allocated IP to static, you can update the Service manifest</p> <p>To promote the allocated IP to static, you can update the Service manifest</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl patch svc nginx-ingress-lb -p <span class="s1">&#39;{&quot;spec&quot;: {&quot;loadBalancerIP&quot;: &quot;104.154.109.191&quot;}}&#39;</span> <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl patch svc nginx-ingress-lb -p <span class="s1">&#39;{&quot;spec&quot;: {&quot;loadBalancerIP&quot;: &quot;104.154.109.191&quot;}}&#39;</span>
<span class="go">&quot;nginx-ingress-lb&quot; patched</span> <span class="go">&quot;nginx-ingress-lb&quot; patched</span>
</pre></div> </code></pre></div>
<p>and promote the IP to static (promotion works differently for cloudproviders, <p>and promote the IP to static (promotion works differently for cloudproviders,
provided example is for GKE/GCE) provided example is for GKE/GCE)
` `
<div class="codehilite"><pre><span></span><span class="gp">$</span> gcloud compute addresses create nginx-ingress-lb --addresses <span class="m">104</span>.154.109.191 --region us-central1 <div class="codehilite"><pre><span></span><code><span class="gp">$</span> gcloud compute addresses create nginx-ingress-lb --addresses <span class="m">104</span>.154.109.191 --region us-central1
<span class="go">Created [https://www.googleapis.com/compute/v1/projects/kubernetesdev/regions/us-central1/addresses/nginx-ingress-lb].</span> <span class="go">Created [https://www.googleapis.com/compute/v1/projects/kubernetesdev/regions/us-central1/addresses/nginx-ingress-lb].</span>
<span class="go">---</span> <span class="go">---</span>
<span class="go">address: 104.154.109.191</span> <span class="go">address: 104.154.109.191</span>
@ -1341,9 +1341,10 @@ provided example is for GKE/GCE)
<span class="go">status: IN_USE</span> <span class="go">status: IN_USE</span>
<span class="go">users:</span> <span class="go">users:</span>
<span class="go">- us-central1/forwardingRules/a09f6913ae80e11e6a8c542010af0000</span> <span class="go">- us-central1/forwardingRules/a09f6913ae80e11e6a8c542010af0000</span>
</pre></div></p> </code></pre></div></p>
<p>Now even if the Service is deleted, the IP will persist, so you can recreate the <p>Now even if the Service is deleted, the IP will persist, so you can recreate the
Service with <code class="codehilite">spec.loadBalancerIP</code> set to <code class="codehilite">104.154.109.191</code>.</p> Service with <code class="codehilite"><span class="err">spec.loadBalancerIP</span></code> set to <code class="codehilite"><span class="err">104.154.109.191</span></code>.</p>
@ -1401,9 +1402,9 @@ Service with <code class="codehilite">spec.loadBalancerIP</code> set to <code cl
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1413,7 +1414,7 @@ Service with <code class="codehilite">spec.loadBalancerIP</code> set to <code cl
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#tls-termination" tabindex="1" class="md-skip"> <a href="#tls-termination" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1226,8 +1226,8 @@
<h2 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link"></a></h2> <h2 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link"></a></h2>
<p>You need a <a href="../PREREQUISITES/#tls-certificates">TLS cert</a> and a <a href="../PREREQUISITES/#test-http-service">test HTTP service</a> for this example.</p> <p>You need a <a href="../PREREQUISITES/#tls-certificates">TLS cert</a> and a <a href="../PREREQUISITES/#test-http-service">test HTTP service</a> for this example.</p>
<h2 id="deployment">Deployment<a class="headerlink" href="#deployment" title="Permanent link"></a></h2> <h2 id="deployment">Deployment<a class="headerlink" href="#deployment" title="Permanent link"></a></h2>
<p>Create a <code class="codehilite">values.yaml</code> file.</p> <p>Create a <code class="codehilite"><span class="err">values.yaml</span></code> file.</p>
<div class="codehilite"><pre><span></span><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">networking.k8s.io/v1beta1</span> <div class="codehilite"><pre><span></span><code><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">networking.k8s.io/v1beta1</span>
<span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Ingress</span> <span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Ingress</span>
<span class="nt">metadata</span><span class="p">:</span> <span class="nt">metadata</span><span class="p">:</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">nginx-test</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">nginx-test</span>
@ -1247,16 +1247,16 @@
<span class="c1"># This assumes http-svc exists and routes to healthy endpoints</span> <span class="c1"># This assumes http-svc exists and routes to healthy endpoints</span>
<span class="nt">serviceName</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">http-svc</span> <span class="nt">serviceName</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">http-svc</span>
<span class="nt">servicePort</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">80</span> <span class="nt">servicePort</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">80</span>
</pre></div> </code></pre></div>
<p>The following command instructs the controller to terminate traffic using the provided <p>The following command instructs the controller to terminate traffic using the provided
TLS cert, and forward un-encrypted HTTP traffic to the test HTTP service.</p> TLS cert, and forward un-encrypted HTTP traffic to the test HTTP service.</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl apply -f ingress.yaml</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl apply -f ingress.yaml</span>
</pre></div> </code></pre></div>
<h2 id="validation">Validation<a class="headerlink" href="#validation" title="Permanent link"></a></h2> <h2 id="validation">Validation<a class="headerlink" href="#validation" title="Permanent link"></a></h2>
<p>You can confirm that the Ingress works.</p> <p>You can confirm that the Ingress works.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl describe ing nginx-test <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl describe ing nginx-test
<span class="go">Name: nginx-test</span> <span class="go">Name: nginx-test</span>
<span class="go">Namespace: default</span> <span class="go">Namespace: default</span>
<span class="go">Address: 104.198.183.6</span> <span class="go">Address: 104.198.183.6</span>
@ -1303,7 +1303,8 @@ TLS cert, and forward un-encrypted HTTP traffic to the test HTTP service.</p>
<span class="go">x-forwarded-for=104.132.0.80, 35.186.221.137</span> <span class="go">x-forwarded-for=104.132.0.80, 35.186.221.137</span>
<span class="go">x-forwarded-proto=https</span> <span class="go">x-forwarded-proto=https</span>
<span class="go">BODY:</span> <span class="go">BODY:</span>
</pre></div> </code></pre></div>
@ -1361,9 +1362,9 @@ TLS cert, and forward un-encrypted HTTP traffic to the test HTTP service.</p>
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1373,7 +1374,7 @@ TLS cert, and forward un-encrypted HTTP traffic to the test HTTP service.</p>
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../assets/images/favicon.png"> <link rel="shortcut icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../assets/javascripts/modernizr.74668098.js"></script> <script src="../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#how-it-works" tabindex="1" class="md-skip"> <a href="#how-it-works" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1292,10 +1292,10 @@
<h1 id="how-it-works">How it works<a class="headerlink" href="#how-it-works" title="Permanent link"></a></h1> <h1 id="how-it-works">How it works<a class="headerlink" href="#how-it-works" title="Permanent link"></a></h1>
<p>The objective of this document is to explain how the NGINX Ingress controller works, in particular how the NGINX model is built and why we need one.</p> <p>The objective of this document is to explain how the NGINX Ingress controller works, in particular how the NGINX model is built and why we need one.</p>
<h2 id="nginx-configuration">NGINX configuration<a class="headerlink" href="#nginx-configuration" title="Permanent link"></a></h2> <h2 id="nginx-configuration">NGINX configuration<a class="headerlink" href="#nginx-configuration" title="Permanent link"></a></h2>
<p>The goal of this Ingress controller is the assembly of a configuration file (nginx.conf). The main implication of this requirement is the need to reload NGINX after any change in the configuration file. <em>Though it is important to note that we don't reload Nginx on changes that impact only an <code class="codehilite">upstream</code> configuration (i.e Endpoints change when you deploy your app)</em>. We use <a href="https://github.com/openresty/lua-nginx-module">lua-nginx-module</a> to achieve this. Check <a href="#avoiding-reloads-on-endpoints-changes">below</a> to learn more about how it's done.</p> <p>The goal of this Ingress controller is the assembly of a configuration file (nginx.conf). The main implication of this requirement is the need to reload NGINX after any change in the configuration file. <em>Though it is important to note that we don't reload Nginx on changes that impact only an <code class="codehilite"><span class="err">upstream</span></code> configuration (i.e Endpoints change when you deploy your app)</em>. We use <a href="https://github.com/openresty/lua-nginx-module">lua-nginx-module</a> to achieve this. Check <a href="#avoiding-reloads-on-endpoints-changes">below</a> to learn more about how it's done.</p>
<h2 id="nginx-model">NGINX model<a class="headerlink" href="#nginx-model" title="Permanent link"></a></h2> <h2 id="nginx-model">NGINX model<a class="headerlink" href="#nginx-model" title="Permanent link"></a></h2>
<p>Usually, a Kubernetes Controller utilizes the <a href="https://coreos.com/kubernetes/docs/latest/replication-controller.html#the-reconciliation-loop-in-detail">synchronization loop pattern</a> to check if the desired state in the controller is updated or a change is required. To this purpose, we need to build a model using different objects from the cluster, in particular (in no special order) Ingresses, Services, Endpoints, Secrets, and Configmaps to generate a point in time configuration file that reflects the state of the cluster.</p> <p>Usually, a Kubernetes Controller utilizes the <a href="https://coreos.com/kubernetes/docs/latest/replication-controller.html#the-reconciliation-loop-in-detail">synchronization loop pattern</a> to check if the desired state in the controller is updated or a change is required. To this purpose, we need to build a model using different objects from the cluster, in particular (in no special order) Ingresses, Services, Endpoints, Secrets, and Configmaps to generate a point in time configuration file that reflects the state of the cluster.</p>
<p>To get this object from the cluster, we use <a href="https://godoc.org/k8s.io/client-go/informers#NewFilteredSharedInformerFactory">Kubernetes Informers</a>, in particular, <code class="codehilite">FilteredSharedInformer</code>. This informers allows reacting to changes in using <a href="https://godoc.org/k8s.io/client-go/tools/cache#ResourceEventHandlerFuncs">callbacks</a> to individual changes when a new object is added, modified or removed. Unfortunately, there is no way to know if a particular change is going to affect the final configuration file. Therefore on every change, we have to rebuild a new model from scratch based on the state of cluster and compare it to the current model. If the new model equals to the current one, then we avoid generating a new NGINX configuration and triggering a reload. Otherwise, we check if the difference is only about Endpoints. If so we then send the new list of Endpoints to a Lua handler running inside Nginx using HTTP POST request and again avoid generating a new NGINX configuration and triggering a reload. If the difference between running and new model is about more than just Endpoints we create a new NGINX configuration based on the new model, replace the current model and trigger a reload.</p> <p>To get this object from the cluster, we use <a href="https://godoc.org/k8s.io/client-go/informers#NewFilteredSharedInformerFactory">Kubernetes Informers</a>, in particular, <code class="codehilite"><span class="err">FilteredSharedInformer</span></code>. This informers allows reacting to changes in using <a href="https://godoc.org/k8s.io/client-go/tools/cache#ResourceEventHandlerFuncs">callbacks</a> to individual changes when a new object is added, modified or removed. Unfortunately, there is no way to know if a particular change is going to affect the final configuration file. Therefore on every change, we have to rebuild a new model from scratch based on the state of cluster and compare it to the current model. If the new model equals to the current one, then we avoid generating a new NGINX configuration and triggering a reload. Otherwise, we check if the difference is only about Endpoints. If so we then send the new list of Endpoints to a Lua handler running inside Nginx using HTTP POST request and again avoid generating a new NGINX configuration and triggering a reload. If the difference between running and new model is about more than just Endpoints we create a new NGINX configuration based on the new model, replace the current model and trigger a reload.</p>
<p>One of the uses of the model is to avoid unnecessary reloads when there's no change in the state and to detect conflicts in definitions.</p> <p>One of the uses of the model is to avoid unnecessary reloads when there's no change in the state and to detect conflicts in definitions.</p>
<p>The final representation of the NGINX configuration is generated from a <a href="https://github.com/kubernetes/ingress-nginx/blob/master/rootfs/etc/nginx/template/nginx.tmpl">Go template</a> using the new model as input for the variables required by the template.</p> <p>The final representation of the NGINX configuration is generated from a <a href="https://github.com/kubernetes/ingress-nginx/blob/master/rootfs/etc/nginx/template/nginx.tmpl">Go template</a> using the new model as input for the variables required by the template.</p>
<h2 id="building-the-nginx-model">Building the NGINX model<a class="headerlink" href="#building-the-nginx-model" title="Permanent link"></a></h2> <h2 id="building-the-nginx-model">Building the NGINX model<a class="headerlink" href="#building-the-nginx-model" title="Permanent link"></a></h2>
@ -1303,7 +1303,7 @@
<p>Operations to build the model:</p> <p>Operations to build the model:</p>
<ul> <ul>
<li> <li>
<p>Order Ingress rules by <code class="codehilite">CreationTimestamp</code> field, i.e., old rules first.</p> <p>Order Ingress rules by <code class="codehilite"><span class="err">CreationTimestamp</span></code> field, i.e., old rules first.</p>
</li> </li>
<li> <li>
<p>If the same path for the same host is defined in more than one Ingress, the oldest rule wins.</p> <p>If the same path for the same host is defined in more than one Ingress, the oldest rule wins.</p>
@ -1325,7 +1325,7 @@
<ul> <ul>
<li>New Ingress Resource Created.</li> <li>New Ingress Resource Created.</li>
<li>TLS section is added to existing Ingress.</li> <li>TLS section is added to existing Ingress.</li>
<li>Change in Ingress annotations that impacts more than just upstream configuration. For instance <code class="codehilite">load-balance</code> annotation does not require a reload.</li> <li>Change in Ingress annotations that impacts more than just upstream configuration. For instance <code class="codehilite"><span class="err">load-balance</span></code> annotation does not require a reload.</li>
<li>A path is added/removed from an Ingress.</li> <li>A path is added/removed from an Ingress.</li>
<li>An Ingress, Service, Secret is removed.</li> <li>An Ingress, Service, Secret is removed.</li>
<li>Some missing referenced object from the Ingress is available, like a Service or Secret.</li> <li>Some missing referenced object from the Ingress is available, like a Service or Secret.</li>
@ -1334,10 +1334,10 @@
<h2 id="avoiding-reloads">Avoiding reloads<a class="headerlink" href="#avoiding-reloads" title="Permanent link"></a></h2> <h2 id="avoiding-reloads">Avoiding reloads<a class="headerlink" href="#avoiding-reloads" title="Permanent link"></a></h2>
<p>In some cases, it is possible to avoid reloads, in particular when there is a change in the endpoints, i.e., a pod is started or replaced. It is out of the scope of this Ingress controller to remove reloads completely. This would require an incredible amount of work and at some point makes no sense. This can change only if NGINX changes the way new configurations are read, basically, new changes do not replace worker processes.</p> <p>In some cases, it is possible to avoid reloads, in particular when there is a change in the endpoints, i.e., a pod is started or replaced. It is out of the scope of this Ingress controller to remove reloads completely. This would require an incredible amount of work and at some point makes no sense. This can change only if NGINX changes the way new configurations are read, basically, new changes do not replace worker processes.</p>
<h3 id="avoiding-reloads-on-endpoints-changes">Avoiding reloads on Endpoints changes<a class="headerlink" href="#avoiding-reloads-on-endpoints-changes" title="Permanent link"></a></h3> <h3 id="avoiding-reloads-on-endpoints-changes">Avoiding reloads on Endpoints changes<a class="headerlink" href="#avoiding-reloads-on-endpoints-changes" title="Permanent link"></a></h3>
<p>On every endpoint change the controller fetches endpoints from all the services it sees and generates corresponding Backend objects. It then sends these objects to a Lua handler running inside Nginx. The Lua code in turn stores those backends in a shared memory zone. Then for every request Lua code running in <a href="https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/balancer.md"><code class="codehilite">balancer_by_lua</code></a> context detects what endpoints it should choose upstream peer from and applies the configured load balancing algorithm to choose the peer. Then Nginx takes care of the rest. This way we avoid reloading Nginx on endpoint changes. <em>Note</em> that this includes annotation changes that affects only <code class="codehilite">upstream</code> configuration in Nginx as well.</p> <p>On every endpoint change the controller fetches endpoints from all the services it sees and generates corresponding Backend objects. It then sends these objects to a Lua handler running inside Nginx. The Lua code in turn stores those backends in a shared memory zone. Then for every request Lua code running in <a href="https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/balancer.md"><code class="codehilite"><span class="err">balancer_by_lua</span></code></a> context detects what endpoints it should choose upstream peer from and applies the configured load balancing algorithm to choose the peer. Then Nginx takes care of the rest. This way we avoid reloading Nginx on endpoint changes. <em>Note</em> that this includes annotation changes that affects only <code class="codehilite"><span class="err">upstream</span></code> configuration in Nginx as well.</p>
<p>In a relatively big clusters with frequently deploying apps this feature saves significant number of Nginx reloads which can otherwise affect response latency, load balancing quality (after every reload Nginx resets the state of load balancing) and so on.</p> <p>In a relatively big clusters with frequently deploying apps this feature saves significant number of Nginx reloads which can otherwise affect response latency, load balancing quality (after every reload Nginx resets the state of load balancing) and so on.</p>
<h3 id="avoiding-outage-from-wrong-configuration">Avoiding outage from wrong configuration<a class="headerlink" href="#avoiding-outage-from-wrong-configuration" title="Permanent link"></a></h3> <h3 id="avoiding-outage-from-wrong-configuration">Avoiding outage from wrong configuration<a class="headerlink" href="#avoiding-outage-from-wrong-configuration" title="Permanent link"></a></h3>
<p>Because the ingress controller works using the <a href="https://coreos.com/kubernetes/docs/latest/replication-controller.html#the-reconciliation-loop-in-detail">synchronization loop pattern</a>, it is applying the configuration for all matching objects. In case some Ingress objects have a broken configuration, for example a syntax error in the <code class="codehilite">nginx.ingress.kubernetes.io/configuration-snippet</code> annotation, the generated configuration becomes invalid, does not reload and hence no more ingresses will be taken into account.</p> <p>Because the ingress controller works using the <a href="https://coreos.com/kubernetes/docs/latest/replication-controller.html#the-reconciliation-loop-in-detail">synchronization loop pattern</a>, it is applying the configuration for all matching objects. In case some Ingress objects have a broken configuration, for example a syntax error in the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/configuration-snippet</span></code> annotation, the generated configuration becomes invalid, does not reload and hence no more ingresses will be taken into account.</p>
<p>To prevent this situation to happen, the nginx ingress controller optionally exposes a <a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#validatingadmissionwebhook">validating admission webhook server</a> to ensure the validity of incoming ingress objects. <p>To prevent this situation to happen, the nginx ingress controller optionally exposes a <a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#validatingadmissionwebhook">validating admission webhook server</a> to ensure the validity of incoming ingress objects.
This webhook appends the incoming ingress objects to the list of ingresses, generates the configuration and calls nginx to ensure the configuration has no syntax errors.</p> This webhook appends the incoming ingress objects to the list of ingresses, generates the configuration and calls nginx to ensure the configuration has no syntax errors.</p>
@ -1349,6 +1349,7 @@ This webhook appends the incoming ingress objects to the list of ingresses, gene
</article> </article>
</div> </div>
</div> </div>
@ -1397,9 +1398,9 @@ This webhook appends the incoming ingress objects to the list of ingresses, gene
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1409,7 +1410,7 @@ This webhook appends the incoming ingress objects to the list of ingresses, gene
</div> </div>
<script src="../assets/javascripts/application.ac79c3b0.js"></script> <script src="../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script> <script>app.initialize({version:"1.0.4",url:{base:".."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="assets/images/favicon.png"> <link rel="shortcut icon" href="assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="assets/javascripts/modernizr.74668098.js"></script> <script src="assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#welcome" tabindex="1" class="md-skip"> <a href="#welcome" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1208,6 +1208,7 @@
</article> </article>
</div> </div>
</div> </div>
@ -1242,9 +1243,9 @@
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1254,7 +1255,7 @@
</div> </div>
<script src="assets/javascripts/application.ac79c3b0.js"></script> <script src="assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../assets/images/favicon.png"> <link rel="shortcut icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../assets/javascripts/modernizr.74668098.js"></script> <script src="../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#the-ingress-nginx-kubectl-plugin" tabindex="1" class="md-skip"> <a href="#the-ingress-nginx-kubectl-plugin" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1384,15 +1384,15 @@ Do not move it without providing redirects.
<h1 id="the-ingress-nginx-kubectl-plugin">The ingress-nginx kubectl plugin<a class="headerlink" href="#the-ingress-nginx-kubectl-plugin" title="Permanent link"></a></h1> <h1 id="the-ingress-nginx-kubectl-plugin">The ingress-nginx kubectl plugin<a class="headerlink" href="#the-ingress-nginx-kubectl-plugin" title="Permanent link"></a></h1>
<h2 id="installation">Installation<a class="headerlink" href="#installation" title="Permanent link"></a></h2> <h2 id="installation">Installation<a class="headerlink" href="#installation" title="Permanent link"></a></h2>
<p>Install <a href="https://github.com/GoogleContainerTools/krew">krew</a>, then run</p> <p>Install <a href="https://github.com/GoogleContainerTools/krew">krew</a>, then run</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl krew install ingress-nginx</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl krew install ingress-nginx</span>
</pre></div> </code></pre></div>
<p>to install the plugin. Then run</p> <p>to install the plugin. Then run</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl ingress-nginx --help</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl ingress-nginx --help</span>
</pre></div> </code></pre></div>
<p>to make sure the plugin is properly installed and to get a list of commands:</p> <p>to make sure the plugin is properly installed and to get a list of commands:</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl ingress-nginx --help</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl ingress-nginx --help</span>
<span class="go">A kubectl plugin for inspecting your ingress-nginx deployments</span> <span class="go">A kubectl plugin for inspecting your ingress-nginx deployments</span>
<span class="go">Usage:</span> <span class="go">Usage:</span>
@ -1430,29 +1430,29 @@ Do not move it without providing redirects.
<span class="go"> --user string The name of the kubeconfig user to use</span> <span class="go"> --user string The name of the kubeconfig user to use</span>
<span class="go">Use &quot;ingress-nginx [command] --help&quot; for more information about a command.</span> <span class="go">Use &quot;ingress-nginx [command] --help&quot; for more information about a command.</span>
</pre></div> </code></pre></div>
<p>If a new <code class="codehilite">ingress-nginx</code> version has just been released, the plugin may not yet have been updated inside the repository. In that case, you can install the latest version of the plugin by running:</p> <p>If a new <code class="codehilite"><span class="err">ingress-nginx</span></code> version has just been released, the plugin may not yet have been updated inside the repository. In that case, you can install the latest version of the plugin by running:</p>
<div class="codehilite"><pre><span></span><span class="go">(</span> <div class="codehilite"><pre><span></span><code><span class="go">(</span>
<span class="go"> set -x; cd &quot;$(mktemp -d)&quot; &amp;&amp;</span> <span class="go"> set -x; cd &quot;$(mktemp -d)&quot; &amp;&amp;</span>
<span class="go"> curl -fsSLO &quot;https://github.com/kubernetes/ingress-nginx/releases/download/nginx-0.24.0/{ingress-nginx.yaml,kubectl-ingress_nginx-$(uname | tr &#39;[:upper:]&#39; &#39;[:lower:]&#39;)-amd64.tar.gz}&quot; &amp;&amp;</span> <span class="go"> curl -fsSLO &quot;https://github.com/kubernetes/ingress-nginx/releases/download/nginx-0.24.0/{ingress-nginx.yaml,kubectl-ingress_nginx-$(uname | tr &#39;[:upper:]&#39; &#39;[:lower:]&#39;)-amd64.tar.gz}&quot; &amp;&amp;</span>
<span class="go"> kubectl krew install \</span> <span class="go"> kubectl krew install \</span>
<span class="go"> --manifest=ingress-nginx.yaml --archive=kubectl-ingress_nginx-$(uname | tr &#39;[:upper:]&#39; &#39;[:lower:]&#39;)-amd64.tar.gz</span> <span class="go"> --manifest=ingress-nginx.yaml --archive=kubectl-ingress_nginx-$(uname | tr &#39;[:upper:]&#39; &#39;[:lower:]&#39;)-amd64.tar.gz</span>
<span class="go">)</span> <span class="go">)</span>
</pre></div> </code></pre></div>
<p>Replacing <code class="codehilite">0.24.0</code> with the recently released version.</p> <p>Replacing <code class="codehilite"><span class="err">0.24.0</span></code> with the recently released version.</p>
<h2 id="common-flags">Common Flags<a class="headerlink" href="#common-flags" title="Permanent link"></a></h2> <h2 id="common-flags">Common Flags<a class="headerlink" href="#common-flags" title="Permanent link"></a></h2>
<ul> <ul>
<li>Every subcommand supports the basic <code class="codehilite">kubectl</code> configuration flags like <code class="codehilite">--namespace</code>, <code class="codehilite">--context</code>, <code class="codehilite">--client-key</code> and so on.</li> <li>Every subcommand supports the basic <code class="codehilite"><span class="err">kubectl</span></code> configuration flags like <code class="codehilite"><span class="err">--namespace</span></code>, <code class="codehilite"><span class="err">--context</span></code>, <code class="codehilite"><span class="err">--client-key</span></code> and so on.</li>
<li>Subcommands that act on a particular <code class="codehilite">ingress-nginx</code> pod (<code class="codehilite">backends</code>, <code class="codehilite">certs</code>, <code class="codehilite">conf</code>, <code class="codehilite">exec</code>, <code class="codehilite">general</code>, <code class="codehilite">logs</code>, <code class="codehilite">ssh</code>), support the <code class="codehilite">--deployment &lt;deployment&gt;</code> and <code class="codehilite">--pod &lt;pod&gt;</code> flags to select either a pod from a deployment with the given name, or a pod with the given name. The <code class="codehilite">--deployment</code> flag defaults to <code class="codehilite">nginx-ingress-controller</code>.</li> <li>Subcommands that act on a particular <code class="codehilite"><span class="err">ingress-nginx</span></code> pod (<code class="codehilite"><span class="err">backends</span></code>, <code class="codehilite"><span class="err">certs</span></code>, <code class="codehilite"><span class="err">conf</span></code>, <code class="codehilite"><span class="err">exec</span></code>, <code class="codehilite"><span class="err">general</span></code>, <code class="codehilite"><span class="err">logs</span></code>, <code class="codehilite"><span class="err">ssh</span></code>), support the <code class="codehilite"><span class="err">--deployment &lt;deployment&gt;</span></code> and <code class="codehilite"><span class="err">--pod &lt;pod&gt;</span></code> flags to select either a pod from a deployment with the given name, or a pod with the given name. The <code class="codehilite"><span class="err">--deployment</span></code> flag defaults to <code class="codehilite"><span class="err">nginx-ingress-controller</span></code>.</li>
<li>Subcommands that inspect resources (<code class="codehilite">ingresses</code>, <code class="codehilite">lint</code>) support the <code class="codehilite">--all-namespaces</code> flag, which causes them to inspect resources in every namespace.</li> <li>Subcommands that inspect resources (<code class="codehilite"><span class="err">ingresses</span></code>, <code class="codehilite"><span class="err">lint</span></code>) support the <code class="codehilite"><span class="err">--all-namespaces</span></code> flag, which causes them to inspect resources in every namespace.</li>
</ul> </ul>
<h2 id="subcommands">Subcommands<a class="headerlink" href="#subcommands" title="Permanent link"></a></h2> <h2 id="subcommands">Subcommands<a class="headerlink" href="#subcommands" title="Permanent link"></a></h2>
<p>Note that <code class="codehilite">backends</code>, <code class="codehilite">general</code>, <code class="codehilite">certs</code>, and <code class="codehilite">conf</code> require <code class="codehilite">ingress-nginx</code> version <code class="codehilite">0.23.0</code> or higher.</p> <p>Note that <code class="codehilite"><span class="err">backends</span></code>, <code class="codehilite"><span class="err">general</span></code>, <code class="codehilite"><span class="err">certs</span></code>, and <code class="codehilite"><span class="err">conf</span></code> require <code class="codehilite"><span class="err">ingress-nginx</span></code> version <code class="codehilite"><span class="err">0.23.0</span></code> or higher.</p>
<h3 id="backends">backends<a class="headerlink" href="#backends" title="Permanent link"></a></h3> <h3 id="backends">backends<a class="headerlink" href="#backends" title="Permanent link"></a></h3>
<p>Run <code class="codehilite">kubectl ingress-nginx backends</code> to get a JSON array of the backends that an ingress-nginx controller currently knows about:</p> <p>Run <code class="codehilite"><span class="err">kubectl ingress-nginx backends</span></code> to get a JSON array of the backends that an ingress-nginx controller currently knows about:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl ingress-nginx backends -n ingress-nginx <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl ingress-nginx backends -n ingress-nginx
<span class="go">[</span> <span class="go">[</span>
<span class="go"> {</span> <span class="go"> {</span>
<span class="go"> &quot;name&quot;: &quot;default-apple-service-5678&quot;,</span> <span class="go"> &quot;name&quot;: &quot;default-apple-service-5678&quot;,</span>
@ -1513,13 +1513,13 @@ Do not move it without providing redirects.
<span class="go"> ...</span> <span class="go"> ...</span>
<span class="go"> }</span> <span class="go"> }</span>
<span class="go">]</span> <span class="go">]</span>
</pre></div> </code></pre></div>
<p>Add the <code class="codehilite">--list</code> option to show only the backend names. Add the <code class="codehilite">--backend &lt;backend&gt;</code> option to show only the backend with the given name.</p> <p>Add the <code class="codehilite"><span class="err">--list</span></code> option to show only the backend names. Add the <code class="codehilite"><span class="err">--backend &lt;backend&gt;</span></code> option to show only the backend with the given name.</p>
<h3 id="certs">certs<a class="headerlink" href="#certs" title="Permanent link"></a></h3> <h3 id="certs">certs<a class="headerlink" href="#certs" title="Permanent link"></a></h3>
<p>Use <code class="codehilite">kubectl ingress-nginx certs --host &lt;hostname&gt;</code> to dump the SSL cert/key information for a given host. Requires that <code class="codehilite">--enable-dynamic-certificates</code> is <code class="codehilite">true</code> (this is the default as of version <code class="codehilite">0.24.0</code>).</p> <p>Use <code class="codehilite"><span class="err">kubectl ingress-nginx certs --host &lt;hostname&gt;</span></code> to dump the SSL cert/key information for a given host. Requires that <code class="codehilite"><span class="err">--enable-dynamic-certificates</span></code> is <code class="codehilite"><span class="err">true</span></code> (this is the default as of version <code class="codehilite"><span class="err">0.24.0</span></code>).</p>
<p><strong>WARNING:</strong> This command will dump sensitive private key information. Don't blindly share the output, and certainly don't log it anywhere.</p> <p><strong>WARNING:</strong> This command will dump sensitive private key information. Don't blindly share the output, and certainly don't log it anywhere.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl ingress-nginx certs -n ingress-nginx --host testaddr.local <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl ingress-nginx certs -n ingress-nginx --host testaddr.local
<span class="go">-----BEGIN CERTIFICATE-----</span> <span class="go">-----BEGIN CERTIFICATE-----</span>
<span class="go">...</span> <span class="go">...</span>
<span class="go">-----END CERTIFICATE-----</span> <span class="go">-----END CERTIFICATE-----</span>
@ -1530,11 +1530,11 @@ Do not move it without providing redirects.
<span class="go">-----BEGIN RSA PRIVATE KEY-----</span> <span class="go">-----BEGIN RSA PRIVATE KEY-----</span>
<span class="go">&lt;REDACTED! DO NOT SHARE THIS!&gt;</span> <span class="go">&lt;REDACTED! DO NOT SHARE THIS!&gt;</span>
<span class="go">-----END RSA PRIVATE KEY-----</span> <span class="go">-----END RSA PRIVATE KEY-----</span>
</pre></div> </code></pre></div>
<h3 id="conf">conf<a class="headerlink" href="#conf" title="Permanent link"></a></h3> <h3 id="conf">conf<a class="headerlink" href="#conf" title="Permanent link"></a></h3>
<p>Use <code class="codehilite">kubectl ingress-nginx conf</code> to dump the generated <code class="codehilite">nginx.conf</code> file. Add the <code class="codehilite">--host &lt;hostname&gt;</code> option to view only the server block for that host:</p> <p>Use <code class="codehilite"><span class="err">kubectl ingress-nginx conf</span></code> to dump the generated <code class="codehilite"><span class="err">nginx.conf</span></code> file. Add the <code class="codehilite"><span class="err">--host &lt;hostname&gt;</span></code> option to view only the server block for that host:</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl ingress-nginx conf -n ingress-nginx --host testaddr.local</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl ingress-nginx conf -n ingress-nginx --host testaddr.local</span>
<span class="go"> server {</span> <span class="go"> server {</span>
<span class="go"> server_name testaddr.local ;</span> <span class="go"> server_name testaddr.local ;</span>
@ -1556,11 +1556,11 @@ Do not move it without providing redirects.
<span class="go"> set $location_path &quot;/&quot;;</span> <span class="go"> set $location_path &quot;/&quot;;</span>
<span class="go">...</span> <span class="go">...</span>
</pre></div> </code></pre></div>
<h3 id="exec">exec<a class="headerlink" href="#exec" title="Permanent link"></a></h3> <h3 id="exec">exec<a class="headerlink" href="#exec" title="Permanent link"></a></h3>
<p><code class="codehilite">kubectl ingress-nginx exec</code> is exactly the same as <code class="codehilite">kubectl exec</code>, with the same command flags. It will automatically choose an <code class="codehilite">ingress-nginx</code> pod to run the command in.</p> <p><code class="codehilite"><span class="err">kubectl ingress-nginx exec</span></code> is exactly the same as <code class="codehilite"><span class="err">kubectl exec</span></code>, with the same command flags. It will automatically choose an <code class="codehilite"><span class="err">ingress-nginx</span></code> pod to run the command in.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl ingress-nginx <span class="nb">exec</span> -i -n ingress-nginx -- ls /etc/nginx <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl ingress-nginx <span class="nb">exec</span> -i -n ingress-nginx -- ls /etc/nginx
<span class="go">fastcgi_params</span> <span class="go">fastcgi_params</span>
<span class="go">geoip</span> <span class="go">geoip</span>
<span class="go">lua</span> <span class="go">lua</span>
@ -1571,44 +1571,44 @@ Do not move it without providing redirects.
<span class="go">opentracing.json</span> <span class="go">opentracing.json</span>
<span class="go">owasp-modsecurity-crs</span> <span class="go">owasp-modsecurity-crs</span>
<span class="go">template</span> <span class="go">template</span>
</pre></div> </code></pre></div>
<h3 id="general">general<a class="headerlink" href="#general" title="Permanent link"></a></h3> <h3 id="general">general<a class="headerlink" href="#general" title="Permanent link"></a></h3>
<p><code class="codehilite">kubectl ingress-nginx general</code> dumps miscellaneous controller state as a JSON object. Currently it just shows the number of controller pods known to a particular controller pod.</p> <p><code class="codehilite"><span class="err">kubectl ingress-nginx general</span></code> dumps miscellaneous controller state as a JSON object. Currently it just shows the number of controller pods known to a particular controller pod.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl ingress-nginx general -n ingress-nginx <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl ingress-nginx general -n ingress-nginx
<span class="go">{</span> <span class="go">{</span>
<span class="go"> &quot;controllerPodsCount&quot;: 1</span> <span class="go"> &quot;controllerPodsCount&quot;: 1</span>
<span class="go">}</span> <span class="go">}</span>
</pre></div> </code></pre></div>
<h3 id="info">info<a class="headerlink" href="#info" title="Permanent link"></a></h3> <h3 id="info">info<a class="headerlink" href="#info" title="Permanent link"></a></h3>
<p>Shows the internal and external IP/CNAMES for an <code class="codehilite">ingress-nginx</code> service.</p> <p>Shows the internal and external IP/CNAMES for an <code class="codehilite"><span class="err">ingress-nginx</span></code> service.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl ingress-nginx info -n ingress-nginx <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl ingress-nginx info -n ingress-nginx
<span class="go">Service cluster IP address: 10.187.253.31</span> <span class="go">Service cluster IP address: 10.187.253.31</span>
<span class="go">LoadBalancer IP|CNAME: 35.123.123.123</span> <span class="go">LoadBalancer IP|CNAME: 35.123.123.123</span>
</pre></div> </code></pre></div>
<p>Use the <code class="codehilite">--service &lt;service&gt;</code> flag if your <code class="codehilite">ingress-nginx</code> <code class="codehilite">LoadBalancer</code> service is not named <code class="codehilite">ingress-nginx</code>.</p> <p>Use the <code class="codehilite"><span class="err">--service &lt;service&gt;</span></code> flag if your <code class="codehilite"><span class="err">ingress-nginx</span></code> <code class="codehilite"><span class="err">LoadBalancer</span></code> service is not named <code class="codehilite"><span class="err">ingress-nginx</span></code>.</p>
<h3 id="ingresses">ingresses<a class="headerlink" href="#ingresses" title="Permanent link"></a></h3> <h3 id="ingresses">ingresses<a class="headerlink" href="#ingresses" title="Permanent link"></a></h3>
<p><code class="codehilite">kubectl ingress-nginx ingresses</code>, alternately <code class="codehilite">kubectl ingress-nginx ing</code>, shows a more detailed view of the ingress definitions in a namespace. Compare:</p> <p><code class="codehilite"><span class="err">kubectl ingress-nginx ingresses</span></code>, alternately <code class="codehilite"><span class="err">kubectl ingress-nginx ing</span></code>, shows a more detailed view of the ingress definitions in a namespace. Compare:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get ingresses --all-namespaces <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get ingresses --all-namespaces
<span class="go">NAMESPACE NAME HOSTS ADDRESS PORTS AGE</span> <span class="go">NAMESPACE NAME HOSTS ADDRESS PORTS AGE</span>
<span class="go">default example-ingress1 testaddr.local,testaddr2.local localhost 80 5d</span> <span class="go">default example-ingress1 testaddr.local,testaddr2.local localhost 80 5d</span>
<span class="go">default test-ingress-2 * localhost 80 5d</span> <span class="go">default test-ingress-2 * localhost 80 5d</span>
</pre></div> </code></pre></div>
<p>vs</p> <p>vs</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl ingress-nginx ingresses --all-namespaces <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl ingress-nginx ingresses --all-namespaces
<span class="go">NAMESPACE INGRESS NAME HOST+PATH ADDRESSES TLS SERVICE SERVICE PORT ENDPOINTS</span> <span class="go">NAMESPACE INGRESS NAME HOST+PATH ADDRESSES TLS SERVICE SERVICE PORT ENDPOINTS</span>
<span class="go">default example-ingress1 testaddr.local/etameta localhost NO pear-service 5678 5</span> <span class="go">default example-ingress1 testaddr.local/etameta localhost NO pear-service 5678 5</span>
<span class="go">default example-ingress1 testaddr2.local/otherpath localhost NO apple-service 5678 1</span> <span class="go">default example-ingress1 testaddr2.local/otherpath localhost NO apple-service 5678 1</span>
<span class="go">default example-ingress1 testaddr2.local/otherotherpath localhost NO pear-service 5678 5</span> <span class="go">default example-ingress1 testaddr2.local/otherotherpath localhost NO pear-service 5678 5</span>
<span class="go">default test-ingress-2 * localhost NO echo-service 8080 2</span> <span class="go">default test-ingress-2 * localhost NO echo-service 8080 2</span>
</pre></div> </code></pre></div>
<h3 id="lint">lint<a class="headerlink" href="#lint" title="Permanent link"></a></h3> <h3 id="lint">lint<a class="headerlink" href="#lint" title="Permanent link"></a></h3>
<p><code class="codehilite">kubectl ingress-nginx lint</code> can check a namespace or entire cluster for potential configuration issues. This command is especially useful when upgrading between <code class="codehilite">ingress-nginx</code> versions.</p> <p><code class="codehilite"><span class="err">kubectl ingress-nginx lint</span></code> can check a namespace or entire cluster for potential configuration issues. This command is especially useful when upgrading between <code class="codehilite"><span class="err">ingress-nginx</span></code> versions.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl ingress-nginx lint --all-namespaces --verbose <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl ingress-nginx lint --all-namespaces --verbose
<span class="go">Checking ingresses...</span> <span class="go">Checking ingresses...</span>
<span class="go">✗ anamespace/this-nginx</span> <span class="go">✗ anamespace/this-nginx</span>
<span class="go"> - Contains the removed session-cookie-hash annotation.</span> <span class="go"> - Contains the removed session-cookie-hash annotation.</span>
@ -1627,10 +1627,10 @@ Do not move it without providing redirects.
<span class="go"> - Uses removed config flag --enable-dynamic-certificates</span> <span class="go"> - Uses removed config flag --enable-dynamic-certificates</span>
<span class="go"> Lint added for version 0.24.0</span> <span class="go"> Lint added for version 0.24.0</span>
<span class="go"> https://github.com/kubernetes/ingress-nginx/issues/3808</span> <span class="go"> https://github.com/kubernetes/ingress-nginx/issues/3808</span>
</pre></div> </code></pre></div>
<p>to show the lints added <strong>only</strong> for a particular <code class="codehilite">ingress-nginx</code> release, use the <code class="codehilite">--from-version</code> and <code class="codehilite">--to-version</code> flags:</p> <p>to show the lints added <strong>only</strong> for a particular <code class="codehilite"><span class="err">ingress-nginx</span></code> release, use the <code class="codehilite"><span class="err">--from-version</span></code> and <code class="codehilite"><span class="err">--to-version</span></code> flags:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl ingress-nginx lint --all-namespaces --verbose --from-version <span class="m">0</span>.24.0 --to-version <span class="m">0</span>.24.0 <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl ingress-nginx lint --all-namespaces --verbose --from-version <span class="m">0</span>.24.0 --to-version <span class="m">0</span>.24.0
<span class="go">Checking ingresses...</span> <span class="go">Checking ingresses...</span>
<span class="go">✗ anamespace/this-nginx</span> <span class="go">✗ anamespace/this-nginx</span>
<span class="go"> - Contains the removed session-cookie-hash annotation.</span> <span class="go"> - Contains the removed session-cookie-hash annotation.</span>
@ -1642,11 +1642,11 @@ Do not move it without providing redirects.
<span class="go"> - Uses removed config flag --enable-dynamic-certificates</span> <span class="go"> - Uses removed config flag --enable-dynamic-certificates</span>
<span class="go"> Lint added for version 0.24.0</span> <span class="go"> Lint added for version 0.24.0</span>
<span class="go"> https://github.com/kubernetes/ingress-nginx/issues/3808</span> <span class="go"> https://github.com/kubernetes/ingress-nginx/issues/3808</span>
</pre></div> </code></pre></div>
<h3 id="logs">logs<a class="headerlink" href="#logs" title="Permanent link"></a></h3> <h3 id="logs">logs<a class="headerlink" href="#logs" title="Permanent link"></a></h3>
<p><code class="codehilite">kubectl ingress-nginx logs</code> is almost the same as <code class="codehilite">kubectl logs</code>, with fewer flags. It will automatically choose an <code class="codehilite">ingress-nginx</code> pod to read logs from.</p> <p><code class="codehilite"><span class="err">kubectl ingress-nginx logs</span></code> is almost the same as <code class="codehilite"><span class="err">kubectl logs</span></code>, with fewer flags. It will automatically choose an <code class="codehilite"><span class="err">ingress-nginx</span></code> pod to read logs from.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl ingress-nginx logs -n ingress-nginx <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl ingress-nginx logs -n ingress-nginx
<span class="go">-------------------------------------------------------------------------------</span> <span class="go">-------------------------------------------------------------------------------</span>
<span class="go">NGINX Ingress controller</span> <span class="go">NGINX Ingress controller</span>
<span class="go"> Release: dev</span> <span class="go"> Release: dev</span>
@ -1662,13 +1662,14 @@ Do not move it without providing redirects.
<span class="go">I0405 16:53:46.183359 7 nginx.go:265] Starting NGINX Ingress controller</span> <span class="go">I0405 16:53:46.183359 7 nginx.go:265] Starting NGINX Ingress controller</span>
<span class="go">I0405 16:53:46.193913 7 event.go:209] Event(v1.ObjectReference{Kind:&quot;ConfigMap&quot;, Namespace:&quot;ingress-nginx&quot;, Name:&quot;udp-services&quot;, UID:&quot;82258915-563e-11e9-9c52-025000000001&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;494&quot;, FieldPath:&quot;&quot;}): type: &#39;Normal&#39; reason: &#39;CREATE&#39; ConfigMap ingress-nginx/udp-services</span> <span class="go">I0405 16:53:46.193913 7 event.go:209] Event(v1.ObjectReference{Kind:&quot;ConfigMap&quot;, Namespace:&quot;ingress-nginx&quot;, Name:&quot;udp-services&quot;, UID:&quot;82258915-563e-11e9-9c52-025000000001&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;494&quot;, FieldPath:&quot;&quot;}): type: &#39;Normal&#39; reason: &#39;CREATE&#39; ConfigMap ingress-nginx/udp-services</span>
<span class="go">...</span> <span class="go">...</span>
</pre></div> </code></pre></div>
<h3 id="ssh">ssh<a class="headerlink" href="#ssh" title="Permanent link"></a></h3> <h3 id="ssh">ssh<a class="headerlink" href="#ssh" title="Permanent link"></a></h3>
<p><code class="codehilite">kubectl ingress-nginx ssh</code> is exactly the same as <code class="codehilite">kubectl ingress-nginx exec -it -- /bin/bash</code>. Use it when you want to quickly be dropped into a shell inside a running <code class="codehilite">ingress-nginx</code> container.</p> <p><code class="codehilite"><span class="err">kubectl ingress-nginx ssh</span></code> is exactly the same as <code class="codehilite"><span class="err">kubectl ingress-nginx exec -it -- /bin/bash</span></code>. Use it when you want to quickly be dropped into a shell inside a running <code class="codehilite"><span class="err">ingress-nginx</span></code> container.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl ingress-nginx ssh -n ingress-nginx <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl ingress-nginx ssh -n ingress-nginx
<span class="gp">www-data@nginx-ingress-controller-7cbf77c976-wx5pn:/etc/nginx$</span> <span class="gp">www-data@nginx-ingress-controller-7cbf77c976-wx5pn:/etc/nginx$</span>
</pre></div> </code></pre></div>
@ -1726,9 +1727,9 @@ Do not move it without providing redirects.
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1738,7 +1739,7 @@ Do not move it without providing redirects.
</div> </div>
<script src="../assets/javascripts/application.ac79c3b0.js"></script> <script src="../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script> <script>app.initialize({version:"1.0.4",url:{base:".."}})</script>

File diff suppressed because one or more lines are too long

View file

@ -2,252 +2,252 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/</loc> <loc>https://kubernetes.github.io/ingress-nginx/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/how-it-works/</loc> <loc>https://kubernetes.github.io/ingress-nginx/how-it-works/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/troubleshooting/</loc> <loc>https://kubernetes.github.io/ingress-nginx/troubleshooting/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/kubectl-plugin/</loc> <loc>https://kubernetes.github.io/ingress-nginx/kubectl-plugin/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/development/</loc> <loc>https://kubernetes.github.io/ingress-nginx/development/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/deploy/</loc> <loc>https://kubernetes.github.io/ingress-nginx/deploy/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/deploy/baremetal/</loc> <loc>https://kubernetes.github.io/ingress-nginx/deploy/baremetal/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/deploy/rbac/</loc> <loc>https://kubernetes.github.io/ingress-nginx/deploy/rbac/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/deploy/validating-webhook/</loc> <loc>https://kubernetes.github.io/ingress-nginx/deploy/validating-webhook/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/deploy/upgrade/</loc> <loc>https://kubernetes.github.io/ingress-nginx/deploy/upgrade/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/basic-usage/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/basic-usage/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/custom-template/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/custom-template/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/log-format/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/log-format/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/cli-arguments/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/cli-arguments/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/custom-errors/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/custom-errors/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/default-backend/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/default-backend/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/fcgi-services/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/fcgi-services/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/ingress-path-matching/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/ingress-path-matching/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/external-articles/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/external-articles/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/miscellaneous/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/miscellaneous/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/monitoring/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/monitoring/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/multiple-ingress/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/multiple-ingress/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/tls/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/tls/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/third-party-addons/modsecurity/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/third-party-addons/modsecurity/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/user-guide/third-party-addons/opentracing/</loc> <loc>https://kubernetes.github.io/ingress-nginx/user-guide/third-party-addons/opentracing/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/PREREQUISITES/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/PREREQUISITES/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/affinity/cookie/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/affinity/cookie/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/auth/basic/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/auth/basic/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/auth/client-certs/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/auth/client-certs/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/auth/external-auth/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/auth/external-auth/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/auth/oauth-external-auth/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/auth/oauth-external-auth/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/customization/configuration-snippets/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/customization/configuration-snippets/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/customization/custom-configuration/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/customization/custom-configuration/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/customization/custom-errors/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/customization/custom-errors/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/customization/custom-headers/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/customization/custom-headers/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/customization/external-auth-headers/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/customization/external-auth-headers/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/customization/ssl-dh-param/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/customization/ssl-dh-param/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/customization/sysctl/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/customization/sysctl/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/docker-registry/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/docker-registry/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/grpc/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/grpc/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/multi-tls/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/multi-tls/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/rewrite/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/rewrite/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/static-ip/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/static-ip/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/tls-termination/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/tls-termination/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>https://kubernetes.github.io/ingress-nginx/examples/psp/</loc> <loc>https://kubernetes.github.io/ingress-nginx/examples/psp/</loc>
<lastmod>2020-02-08</lastmod> <lastmod>2020-02-09</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
</urlset> </urlset>

Binary file not shown.

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../assets/images/favicon.png"> <link rel="shortcut icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../assets/javascripts/modernizr.74668098.js"></script> <script src="../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#troubleshooting" tabindex="1" class="md-skip"> <a href="#troubleshooting" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1288,7 +1288,7 @@ Do not move it without providing redirects.
<p>There are many ways to troubleshoot the ingress-controller. The following are basic troubleshooting <p>There are many ways to troubleshoot the ingress-controller. The following are basic troubleshooting
methods to obtain more information.</p> methods to obtain more information.</p>
<p>Check the Ingress Resource Events</p> <p>Check the Ingress Resource Events</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get ing -n &lt;namespace-of-ingress-resource&gt; <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get ing -n &lt;namespace-of-ingress-resource&gt;
<span class="go">NAME HOSTS ADDRESS PORTS AGE</span> <span class="go">NAME HOSTS ADDRESS PORTS AGE</span>
<span class="go">cafe-ingress cafe.com 10.0.2.15 80 25s</span> <span class="go">cafe-ingress cafe.com 10.0.2.15 80 25s</span>
@ -1311,10 +1311,10 @@ methods to obtain more information.</p>
<span class="go"> ---- ------ ---- ---- -------</span> <span class="go"> ---- ------ ---- ---- -------</span>
<span class="go"> Normal CREATE 1m nginx-ingress-controller Ingress default/cafe-ingress</span> <span class="go"> Normal CREATE 1m nginx-ingress-controller Ingress default/cafe-ingress</span>
<span class="go"> Normal UPDATE 58s nginx-ingress-controller Ingress default/cafe-ingress</span> <span class="go"> Normal UPDATE 58s nginx-ingress-controller Ingress default/cafe-ingress</span>
</pre></div> </code></pre></div>
<p>Check the Ingress Controller Logs</p> <p>Check the Ingress Controller Logs</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get pods -n &lt;namespace-of-ingress-controller&gt; <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get pods -n &lt;namespace-of-ingress-controller&gt;
<span class="go">NAME READY STATUS RESTARTS AGE</span> <span class="go">NAME READY STATUS RESTARTS AGE</span>
<span class="go">nginx-ingress-controller-67956bf89d-fv58j 1/1 Running 0 1m</span> <span class="go">nginx-ingress-controller-67956bf89d-fv58j 1/1 Running 0 1m</span>
@ -1326,10 +1326,10 @@ methods to obtain more information.</p>
<span class="go"> Repository: https://github.com/kubernetes/ingress-nginx</span> <span class="go"> Repository: https://github.com/kubernetes/ingress-nginx</span>
<span class="go">-------------------------------------------------------------------------------</span> <span class="go">-------------------------------------------------------------------------------</span>
<span class="go">....</span> <span class="go">....</span>
</pre></div> </code></pre></div>
<p>Check the Nginx Configuration</p> <p>Check the Nginx Configuration</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get pods -n &lt;namespace-of-ingress-controller&gt; <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get pods -n &lt;namespace-of-ingress-controller&gt;
<span class="go">NAME READY STATUS RESTARTS AGE</span> <span class="go">NAME READY STATUS RESTARTS AGE</span>
<span class="go">nginx-ingress-controller-67956bf89d-fv58j 1/1 Running 0 1m</span> <span class="go">nginx-ingress-controller-67956bf89d-fv58j 1/1 Running 0 1m</span>
@ -1346,10 +1346,10 @@ methods to obtain more information.</p>
<span class="go">}</span> <span class="go">}</span>
<span class="go">http {</span> <span class="go">http {</span>
<span class="go">....</span> <span class="go">....</span>
</pre></div> </code></pre></div>
<p>Check if used Services Exist</p> <p>Check if used Services Exist</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get svc --all-namespaces <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get svc --all-namespaces
<span class="go">NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE</span> <span class="go">NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE</span>
<span class="go">default coffee-svc ClusterIP 10.106.154.35 &lt;none&gt; 80/TCP 18m</span> <span class="go">default coffee-svc ClusterIP 10.106.154.35 &lt;none&gt; 80/TCP 18m</span>
<span class="go">default kubernetes ClusterIP 10.96.0.1 &lt;none&gt; 443/TCP 30m</span> <span class="go">default kubernetes ClusterIP 10.96.0.1 &lt;none&gt; 443/TCP 30m</span>
@ -1357,36 +1357,36 @@ methods to obtain more information.</p>
<span class="go">kube-system default-http-backend NodePort 10.108.189.236 &lt;none&gt; 80:30001/TCP 30m</span> <span class="go">kube-system default-http-backend NodePort 10.108.189.236 &lt;none&gt; 80:30001/TCP 30m</span>
<span class="go">kube-system kube-dns ClusterIP 10.96.0.10 &lt;none&gt; 53/UDP,53/TCP 30m</span> <span class="go">kube-system kube-dns ClusterIP 10.96.0.10 &lt;none&gt; 53/UDP,53/TCP 30m</span>
<span class="go">kube-system kubernetes-dashboard NodePort 10.103.128.17 &lt;none&gt; 80:30000/TCP 30m</span> <span class="go">kube-system kubernetes-dashboard NodePort 10.103.128.17 &lt;none&gt; 80:30000/TCP 30m</span>
</pre></div> </code></pre></div>
<h2 id="debug-logging">Debug Logging<a class="headerlink" href="#debug-logging" title="Permanent link"></a></h2> <h2 id="debug-logging">Debug Logging<a class="headerlink" href="#debug-logging" title="Permanent link"></a></h2>
<p>Using the flag <code class="codehilite">--v=XX</code> it is possible to increase the level of logging. This is performed by editing <p>Using the flag <code class="codehilite"><span class="err">--v=XX</span></code> it is possible to increase the level of logging. This is performed by editing
the deployment.</p> the deployment.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> kubectl get deploy -n &lt;namespace-of-ingress-controller&gt; <div class="codehilite"><pre><span></span><code><span class="gp">$</span> kubectl get deploy -n &lt;namespace-of-ingress-controller&gt;
<span class="go">NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE</span> <span class="go">NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE</span>
<span class="go">default-http-backend 1 1 1 1 35m</span> <span class="go">default-http-backend 1 1 1 1 35m</span>
<span class="go">nginx-ingress-controller 1 1 1 1 35m</span> <span class="go">nginx-ingress-controller 1 1 1 1 35m</span>
<span class="gp">$</span> kubectl edit deploy -n &lt;namespace-of-ingress-controller&gt; nginx-ingress-controller <span class="gp">$</span> kubectl edit deploy -n &lt;namespace-of-ingress-controller&gt; nginx-ingress-controller
<span class="gp">#</span> Add --v<span class="o">=</span>X to <span class="s2">&quot;- args&quot;</span>, where X is an integer <span class="gp">#</span> Add --v<span class="o">=</span>X to <span class="s2">&quot;- args&quot;</span>, where X is an integer
</pre></div> </code></pre></div>
<ul> <ul>
<li><code class="codehilite">--v=2</code> shows details using <code class="codehilite">diff</code> about the changes in the configuration in nginx</li> <li><code class="codehilite"><span class="err">--v=2</span></code> shows details using <code class="codehilite"><span class="err">diff</span></code> about the changes in the configuration in nginx</li>
<li><code class="codehilite">--v=3</code> shows details about the service, Ingress rule, endpoint changes and it dumps the nginx configuration in JSON format</li> <li><code class="codehilite"><span class="err">--v=3</span></code> shows details about the service, Ingress rule, endpoint changes and it dumps the nginx configuration in JSON format</li>
<li><code class="codehilite">--v=5</code> configures NGINX in <a href="http://nginx.org/en/docs/debugging_log.html">debug mode</a></li> <li><code class="codehilite"><span class="err">--v=5</span></code> configures NGINX in <a href="http://nginx.org/en/docs/debugging_log.html">debug mode</a></li>
</ul> </ul>
<h2 id="authentication-to-the-kubernetes-api-server">Authentication to the Kubernetes API Server<a class="headerlink" href="#authentication-to-the-kubernetes-api-server" title="Permanent link"></a></h2> <h2 id="authentication-to-the-kubernetes-api-server">Authentication to the Kubernetes API Server<a class="headerlink" href="#authentication-to-the-kubernetes-api-server" title="Permanent link"></a></h2>
<p>A number of components are involved in the authentication process and the first step is to narrow <p>A number of components are involved in the authentication process and the first step is to narrow
down the source of the problem, namely whether it is a problem with service authentication or down the source of the problem, namely whether it is a problem with service authentication or
with the kubeconfig file.</p> with the kubeconfig file.</p>
<p>Both authentications must work:</p> <p>Both authentications must work:</p>
<div class="codehilite"><pre><span></span>+-------------+ service +------------+ <div class="codehilite"><pre><span></span><code><span class="err">+-------------+ service +------------+</span>
| | authentication | | <span class="err">| | authentication | |</span>
+ apiserver +&lt;-------------------+ ingress | <span class="err">+ apiserver +&lt;-------------------+ ingress |</span>
| | | controller | <span class="err">| | | controller |</span>
+-------------+ +------------+ <span class="err">+-------------+ +------------+</span>
</pre></div> </code></pre></div>
<p><strong>Service authentication</strong></p> <p><strong>Service authentication</strong></p>
<p>The Ingress controller needs information from apiserver. Therefore, authentication is required, which can be achieved in two different ways:</p> <p>The Ingress controller needs information from apiserver. Therefore, authentication is required, which can be achieved in two different ways:</p>
@ -1395,41 +1395,41 @@ with the kubeconfig file.</p>
<p><em>Service Account:</em> This is recommended, because nothing has to be configured. The Ingress controller will use information provided by the system to communicate with the API server. See 'Service Account' section for details.</p> <p><em>Service Account:</em> This is recommended, because nothing has to be configured. The Ingress controller will use information provided by the system to communicate with the API server. See 'Service Account' section for details.</p>
</li> </li>
<li> <li>
<p><em>Kubeconfig file:</em> In some Kubernetes environments service accounts are not available. In this case a manual configuration is required. The Ingress controller binary can be started with the <code class="codehilite">--kubeconfig</code> flag. The value of the flag is a path to a file specifying how to connect to the API server. Using the <code class="codehilite">--kubeconfig</code> does not requires the flag <code class="codehilite">--apiserver-host</code>. <p><em>Kubeconfig file:</em> In some Kubernetes environments service accounts are not available. In this case a manual configuration is required. The Ingress controller binary can be started with the <code class="codehilite"><span class="err">--kubeconfig</span></code> flag. The value of the flag is a path to a file specifying how to connect to the API server. Using the <code class="codehilite"><span class="err">--kubeconfig</span></code> does not requires the flag <code class="codehilite"><span class="err">--apiserver-host</span></code>.
The format of the file is identical to <code class="codehilite">~/.kube/config</code> which is used by kubectl to connect to the API server. See 'kubeconfig' section for details.</p> The format of the file is identical to <code class="codehilite"><span class="err">~/.kube/config</span></code> which is used by kubectl to connect to the API server. See 'kubeconfig' section for details.</p>
</li> </li>
<li> <li>
<p><em>Using the flag <code class="codehilite">--apiserver-host</code>:</em> Using this flag <code class="codehilite">--apiserver-host=http://localhost:8080</code> it is possible to specify an unsecured API server or reach a remote kubernetes cluster using <a href="https://kubernetes.io/docs/user-guide/kubectl/kubectl_proxy/">kubectl proxy</a>. <p><em>Using the flag <code class="codehilite"><span class="err">--apiserver-host</span></code>:</em> Using this flag <code class="codehilite"><span class="err">--apiserver-host=http://localhost:8080</span></code> it is possible to specify an unsecured API server or reach a remote kubernetes cluster using <a href="https://kubernetes.io/docs/user-guide/kubectl/kubectl_proxy/">kubectl proxy</a>.
Please do not use this approach in production.</p> Please do not use this approach in production.</p>
</li> </li>
</ol> </ol>
<p>In the diagram below you can see the full authentication flow with all options, starting with the browser <p>In the diagram below you can see the full authentication flow with all options, starting with the browser
on the lower left hand side.</p> on the lower left hand side.</p>
<div class="codehilite"><pre><span></span>Kubernetes Workstation <div class="codehilite"><pre><span></span><code><span class="err">Kubernetes Workstation</span>
+---------------------------------------------------+ +------------------+ <span class="err">+---------------------------------------------------+ +------------------+</span>
| | | | <span class="err">| | | |</span>
| +-----------+ apiserver +------------+ | | +------------+ | <span class="err">| +-----------+ apiserver +------------+ | | +------------+ |</span>
| | | proxy | | | | | | | <span class="err">| | | proxy | | | | | | |</span>
| | apiserver | | ingress | | | | ingress | | <span class="err">| | apiserver | | ingress | | | | ingress | |</span>
| | | | controller | | | | controller | | <span class="err">| | | | controller | | | | controller | |</span>
| | | | | | | | | | <span class="err">| | | | | | | | | |</span>
| | | | | | | | | | <span class="err">| | | | | | | | | |</span>
| | | service account/ | | | | | | | <span class="err">| | | service account/ | | | | | | |</span>
| | | kubeconfig | | | | | | | <span class="err">| | | kubeconfig | | | | | | |</span>
| | +&lt;-------------------+ | | | | | | <span class="err">| | +&lt;-------------------+ | | | | | |</span>
| | | | | | | | | | <span class="err">| | | | | | | | | |</span>
| +------+----+ kubeconfig +------+-----+ | | +------+-----+ | <span class="err">| +------+----+ kubeconfig +------+-----+ | | +------+-----+ |</span>
| |&lt;--------------------------------------------------------| | <span class="err">| |&lt;--------------------------------------------------------| |</span>
| | | | <span class="err">| | | |</span>
+---------------------------------------------------+ +------------------+ <span class="err">+---------------------------------------------------+ +------------------+</span>
</pre></div> </code></pre></div>
<h3 id="service-account">Service Account<a class="headerlink" href="#service-account" title="Permanent link"></a></h3> <h3 id="service-account">Service Account<a class="headerlink" href="#service-account" title="Permanent link"></a></h3>
<p>If using a service account to connect to the API server, Dashboard expects the file <p>If using a service account to connect to the API server, Dashboard expects the file
<code class="codehilite">/var/run/secrets/kubernetes.io/serviceaccount/token</code> to be present. It provides a secret <code class="codehilite"><span class="err">/var/run/secrets/kubernetes.io/serviceaccount/token</span></code> to be present. It provides a secret
token that is required to authenticate with the API server.</p> token that is required to authenticate with the API server.</p>
<p>Verify with the following commands:</p> <p>Verify with the following commands:</p>
<div class="codehilite"><pre><span></span><span class="gp">#</span> start a container that contains curl <div class="codehilite"><pre><span></span><code><span class="gp">#</span> start a container that contains curl
<span class="gp">$</span> kubectl run <span class="nb">test</span> --image<span class="o">=</span>tutum/curl -- sleep <span class="m">10000</span> <span class="gp">$</span> kubectl run <span class="nb">test</span> --image<span class="o">=</span>tutum/curl -- sleep <span class="m">10000</span>
<span class="gp">#</span> check that container is running <span class="gp">#</span> check that container is running
@ -1492,20 +1492,20 @@ token that is required to authenticate with the API server.</p>
<span class="go"> &quot;/version&quot;</span> <span class="go"> &quot;/version&quot;</span>
<span class="go"> ]</span> <span class="go"> ]</span>
<span class="go">}</span> <span class="go">}</span>
</pre></div> </code></pre></div>
<p>If it is not working, there are two possible reasons:</p> <p>If it is not working, there are two possible reasons:</p>
<ol> <ol>
<li> <li>
<p>The contents of the tokens are invalid. Find the secret name with <code class="codehilite">kubectl get secrets | grep service-account</code> and <p>The contents of the tokens are invalid. Find the secret name with <code class="codehilite"><span class="err">kubectl get secrets | grep service-account</span></code> and
delete it with <code class="codehilite">kubectl delete secret &lt;name&gt;</code>. It will automatically be recreated.</p> delete it with <code class="codehilite"><span class="err">kubectl delete secret &lt;name&gt;</span></code>. It will automatically be recreated.</p>
</li> </li>
<li> <li>
<p>You have a non-standard Kubernetes installation and the file containing the token may not be present. <p>You have a non-standard Kubernetes installation and the file containing the token may not be present.
The API server will mount a volume containing this file, but only if the API server is configured to use The API server will mount a volume containing this file, but only if the API server is configured to use
the ServiceAccount admission controller. the ServiceAccount admission controller.
If you experience this error, verify that your API server is using the ServiceAccount admission controller. If you experience this error, verify that your API server is using the ServiceAccount admission controller.
If you are configuring the API server by hand, you can set this with the <code class="codehilite">--admission-control</code> parameter.</p> If you are configuring the API server by hand, you can set this with the <code class="codehilite"><span class="err">--admission-control</span></code> parameter.</p>
<blockquote> <blockquote>
<p>Note that you should use other admission controllers as well. Before configuring this option, you should read about admission controllers.</p> <p>Note that you should use other admission controllers as well. Before configuring this option, you should read about admission controllers.</p>
</blockquote> </blockquote>
@ -1518,7 +1518,7 @@ token that is required to authenticate with the API server.</p>
</ul> </ul>
<h2 id="kube-config">Kube-Config<a class="headerlink" href="#kube-config" title="Permanent link"></a></h2> <h2 id="kube-config">Kube-Config<a class="headerlink" href="#kube-config" title="Permanent link"></a></h2>
<p>If you want to use a kubeconfig file for authentication, follow the <a href="../deploy/">deploy procedure</a> and <p>If you want to use a kubeconfig file for authentication, follow the <a href="../deploy/">deploy procedure</a> and
add the flag <code class="codehilite">--kubeconfig=/etc/kubernetes/kubeconfig.yaml</code> to the args section of the deployment.</p> add the flag <code class="codehilite"><span class="err">--kubeconfig=/etc/kubernetes/kubeconfig.yaml</span></code> to the args section of the deployment.</p>
<h2 id="using-gdb-with-nginx">Using GDB with Nginx<a class="headerlink" href="#using-gdb-with-nginx" title="Permanent link"></a></h2> <h2 id="using-gdb-with-nginx">Using GDB with Nginx<a class="headerlink" href="#using-gdb-with-nginx" title="Permanent link"></a></h2>
<p><a href="https://www.gnu.org/software/gdb/">Gdb</a> can be used to with nginx to perform a configuration <p><a href="https://www.gnu.org/software/gdb/">Gdb</a> can be used to with nginx to perform a configuration
dump. This allows us to see which configuration is being used, as well as older configurations.</p> dump. This allows us to see which configuration is being used, as well as older configurations.</p>
@ -1526,33 +1526,33 @@ dump. This allows us to see which configuration is being used, as well as older
<ol> <ol>
<li>SSH into the worker</li> <li>SSH into the worker</li>
</ol> </ol>
<div class="codehilite"><pre><span></span><span class="gp">$</span> ssh user@workerIP <div class="codehilite"><pre><span></span><code><span class="gp">$</span> ssh user@workerIP
</pre></div> </code></pre></div>
<ol> <ol>
<li>Obtain the Docker Container Running nginx</li> <li>Obtain the Docker Container Running nginx</li>
</ol> </ol>
<div class="codehilite"><pre><span></span><span class="gp">$</span> docker ps <span class="p">|</span> grep nginx-ingress-controller <div class="codehilite"><pre><span></span><code><span class="gp">$</span> docker ps <span class="p">|</span> grep nginx-ingress-controller
<span class="go">CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</span> <span class="go">CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</span>
<span class="go">d9e1d243156a quay.io/kubernetes-ingress-controller/nginx-ingress-controller &quot;/usr/bin/dumb-init …&quot; 19 minutes ago Up 19 minutes k8s_nginx-ingress-controller_nginx-ingress-controller-67956bf89d-mqxzt_kube-system_079f31ec-aa37-11e8-ad39-080027a227db_0</span> <span class="go">d9e1d243156a quay.io/kubernetes-ingress-controller/nginx-ingress-controller &quot;/usr/bin/dumb-init …&quot; 19 minutes ago Up 19 minutes k8s_nginx-ingress-controller_nginx-ingress-controller-67956bf89d-mqxzt_kube-system_079f31ec-aa37-11e8-ad39-080027a227db_0</span>
</pre></div> </code></pre></div>
<ol> <ol>
<li>Exec into the container</li> <li>Exec into the container</li>
</ol> </ol>
<div class="codehilite"><pre><span></span><span class="gp">$</span> docker <span class="nb">exec</span> -it --user<span class="o">=</span><span class="m">0</span> --privileged d9e1d243156a bash <div class="codehilite"><pre><span></span><code><span class="gp">$</span> docker <span class="nb">exec</span> -it --user<span class="o">=</span><span class="m">0</span> --privileged d9e1d243156a bash
</pre></div> </code></pre></div>
<ol> <ol>
<li>Make sure nginx is running in <code class="codehilite">--with-debug</code></li> <li>Make sure nginx is running in <code class="codehilite"><span class="err">--with-debug</span></code></li>
</ol> </ol>
<div class="codehilite"><pre><span></span><span class="gp">$</span> nginx -V <span class="m">2</span>&gt;<span class="p">&amp;</span><span class="m">1</span> <span class="p">|</span> grep -- <span class="s1">&#39;--with-debug&#39;</span> <div class="codehilite"><pre><span></span><code><span class="gp">$</span> nginx -V <span class="m">2</span>&gt;<span class="p">&amp;</span><span class="m">1</span> <span class="p">|</span> grep -- <span class="s1">&#39;--with-debug&#39;</span>
</pre></div> </code></pre></div>
<ol> <ol>
<li>Get list of processes running on container</li> <li>Get list of processes running on container</li>
</ol> </ol>
<div class="codehilite"><pre><span></span><span class="gp">$</span> ps -ef <div class="codehilite"><pre><span></span><code><span class="gp">$</span> ps -ef
<span class="go">UID PID PPID C STIME TTY TIME CMD</span> <span class="go">UID PID PPID C STIME TTY TIME CMD</span>
<span class="go">root 1 0 0 20:23 ? 00:00:00 /usr/bin/dumb-init /nginx-ingres</span> <span class="go">root 1 0 0 20:23 ? 00:00:00 /usr/bin/dumb-init /nginx-ingres</span>
<span class="go">root 5 1 0 20:23 ? 00:00:05 /nginx-ingress-controller --defa</span> <span class="go">root 5 1 0 20:23 ? 00:00:05 /nginx-ingress-controller --defa</span>
@ -1560,23 +1560,23 @@ dump. This allows us to see which configuration is being used, as well as older
<span class="go">nobody 106 21 0 20:23 ? 00:00:00 nginx: worker process</span> <span class="go">nobody 106 21 0 20:23 ? 00:00:00 nginx: worker process</span>
<span class="go">nobody 107 21 0 20:23 ? 00:00:00 nginx: worker process</span> <span class="go">nobody 107 21 0 20:23 ? 00:00:00 nginx: worker process</span>
<span class="go">root 172 0 0 20:43 pts/0 00:00:00 bash</span> <span class="go">root 172 0 0 20:43 pts/0 00:00:00 bash</span>
</pre></div> </code></pre></div>
<ol> <ol>
<li>Attach gdb to the nginx master process</li> <li>Attach gdb to the nginx master process</li>
</ol> </ol>
<div class="codehilite"><pre><span></span><span class="gp">$</span> gdb -p <span class="m">21</span> <div class="codehilite"><pre><span></span><code><span class="gp">$</span> gdb -p <span class="m">21</span>
<span class="go">....</span> <span class="go">....</span>
<span class="go">Attaching to process 21</span> <span class="go">Attaching to process 21</span>
<span class="go">Reading symbols from /usr/sbin/nginx...done.</span> <span class="go">Reading symbols from /usr/sbin/nginx...done.</span>
<span class="go">....</span> <span class="go">....</span>
<span class="go">(gdb)</span> <span class="gp gp-VirtualEnv">(gdb)</span>
</pre></div> </code></pre></div>
<ol> <ol>
<li>Copy and paste the following:</li> <li>Copy and paste the following:</li>
</ol> </ol>
<div class="codehilite"><pre><span></span><span class="go">set $cd = ngx_cycle-&gt;config_dump</span> <div class="codehilite"><pre><span></span><code><span class="go">set $cd = ngx_cycle-&gt;config_dump</span>
<span class="go">set $nelts = $cd.nelts</span> <span class="go">set $nelts = $cd.nelts</span>
<span class="go">set $elts = (ngx_conf_dump_t*)($cd.elts)</span> <span class="go">set $elts = (ngx_conf_dump_t*)($cd.elts)</span>
<span class="go">while ($nelts-- &gt; 0)</span> <span class="go">while ($nelts-- &gt; 0)</span>
@ -1585,7 +1585,7 @@ dump. This allows us to see which configuration is being used, as well as older
<span class="go">append memory nginx_conf.txt \</span> <span class="go">append memory nginx_conf.txt \</span>
<span class="gp"> $</span>elts<span class="o">[</span><span class="nv">$nelts</span><span class="o">]</span>-&gt;buffer.start <span class="nv">$elts</span><span class="o">[</span><span class="nv">$nelts</span><span class="o">]</span>-&gt;buffer.end <span class="gp"> $</span>elts<span class="o">[</span><span class="nv">$nelts</span><span class="o">]</span>-&gt;buffer.start <span class="nv">$elts</span><span class="o">[</span><span class="nv">$nelts</span><span class="o">]</span>-&gt;buffer.end
<span class="go">end</span> <span class="go">end</span>
</pre></div> </code></pre></div>
<ol> <ol>
<li> <li>
@ -1595,8 +1595,9 @@ dump. This allows us to see which configuration is being used, as well as older
<p>Open nginx_conf.txt</p> <p>Open nginx_conf.txt</p>
</li> </li>
</ol> </ol>
<div class="codehilite"><pre><span></span><span class="go">cat nginx_conf.txt</span> <div class="codehilite"><pre><span></span><code><span class="go">cat nginx_conf.txt</span>
</pre></div> </code></pre></div>
@ -1654,9 +1655,9 @@ dump. This allows us to see which configuration is being used, as well as older
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1666,7 +1667,7 @@ dump. This allows us to see which configuration is being used, as well as older
</div> </div>
<script src="../assets/javascripts/application.ac79c3b0.js"></script> <script src="../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script> <script>app.initialize({version:"1.0.4",url:{base:".."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#basic-usage-host-based-routing" tabindex="1" class="md-skip"> <a href="#basic-usage-host-based-routing" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1152,8 +1152,8 @@
<h1 id="basic-usage-host-based-routing">Basic usage - host based routing<a class="headerlink" href="#basic-usage-host-based-routing" title="Permanent link"></a></h1> <h1 id="basic-usage-host-based-routing">Basic usage - host based routing<a class="headerlink" href="#basic-usage-host-based-routing" title="Permanent link"></a></h1>
<p>ingress-nginx can be used for many use cases, inside various cloud provider and supports a lot of configurations. In this section you can find a common usage scenario where a single load balancer powered by ingress-nginx will route traffic to 2 different HTTP backend services based on the host name.</p> <p>ingress-nginx can be used for many use cases, inside various cloud provider and supports a lot of configurations. In this section you can find a common usage scenario where a single load balancer powered by ingress-nginx will route traffic to 2 different HTTP backend services based on the host name.</p>
<p>First of all follow the instructions to install ingress-nginx. Then imagine that you need to expose 2 HTTP services already installed: <code class="codehilite">myServiceA</code>, <code class="codehilite">myServiceB</code>. Let's say that you want to expose the first at <code class="codehilite">myServiceA.foo.org</code> and the second at <code class="codehilite">myServiceB.foo.org</code>. One possible solution is to create two <strong>ingress</strong> resources:</p> <p>First of all follow the instructions to install ingress-nginx. Then imagine that you need to expose 2 HTTP services already installed: <code class="codehilite"><span class="err">myServiceA</span></code>, <code class="codehilite"><span class="err">myServiceB</span></code>. Let's say that you want to expose the first at <code class="codehilite"><span class="err">myServiceA.foo.org</span></code> and the second at <code class="codehilite"><span class="err">myServiceB.foo.org</span></code>. One possible solution is to create two <strong>ingress</strong> resources:</p>
<div class="codehilite"><pre><span></span><span class="n">apiVersion</span><span class="o">:</span> <span class="n">networking</span><span class="o">.</span><span class="na">k8s</span><span class="o">.</span><span class="na">io</span><span class="o">/</span><span class="n">v1beta1</span> <div class="codehilite"><pre><span></span><code><span class="n">apiVersion</span><span class="o">:</span> <span class="n">networking</span><span class="o">.</span><span class="na">k8s</span><span class="o">.</span><span class="na">io</span><span class="o">/</span><span class="n">v1beta1</span>
<span class="n">kind</span><span class="o">:</span> <span class="n">Ingress</span> <span class="n">kind</span><span class="o">:</span> <span class="n">Ingress</span>
<span class="n">metadata</span><span class="o">:</span> <span class="n">metadata</span><span class="o">:</span>
<span class="n">name</span><span class="o">:</span> <span class="n">ingress</span><span class="o">-</span><span class="n">myServiceA</span> <span class="n">name</span><span class="o">:</span> <span class="n">ingress</span><span class="o">-</span><span class="n">myServiceA</span>
@ -1186,13 +1186,14 @@
<span class="n">backend</span><span class="o">:</span> <span class="n">backend</span><span class="o">:</span>
<span class="n">serviceName</span><span class="o">:</span> <span class="n">myServiceB</span> <span class="n">serviceName</span><span class="o">:</span> <span class="n">myServiceB</span>
<span class="n">servicePort</span><span class="o">:</span> <span class="mi">80</span> <span class="n">servicePort</span><span class="o">:</span> <span class="mi">80</span>
</pre></div> </code></pre></div>
<p>When you apply this yaml, 2 ingress resources will be created managed by the <strong>ingress-nginx</strong> instance. Nginx is configured to automatically discover all ingress with the <code class="codehilite">kubernetes.io/ingress.class: &quot;nginx&quot;</code> annotation. <p>When you apply this yaml, 2 ingress resources will be created managed by the <strong>ingress-nginx</strong> instance. Nginx is configured to automatically discover all ingress with the <code class="codehilite"><span class="err">kubernetes.io/ingress.class: &quot;nginx&quot;</span></code> annotation.
Please note that the ingress resource should be placed inside the same namespace of the backend resource.</p> Please note that the ingress resource should be placed inside the same namespace of the backend resource.</p>
<p>On many cloud providers ingress-nginx will also create the corresponding Load Balancer resource. All you have to do is get the external IP and add a DNS <code class="codehilite">A record</code> inside your DNS provider that point myServiceA.foo.org and myServiceB.foo.org to the nginx external IP. Get the external IP by running:</p> <p>On many cloud providers ingress-nginx will also create the corresponding Load Balancer resource. All you have to do is get the external IP and add a DNS <code class="codehilite"><span class="err">A record</span></code> inside your DNS provider that point myServiceA.foo.org and myServiceB.foo.org to the nginx external IP. Get the external IP by running:</p>
<div class="codehilite"><pre><span></span>kubectl get services -n ingress-nginx <div class="codehilite"><pre><span></span><code><span class="err">kubectl get services -n ingress-nginx</span>
</pre></div> </code></pre></div>
@ -1250,9 +1251,9 @@ Please note that the ingress resource should be placed inside the same namespace
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1262,7 +1263,7 @@ Please note that the ingress resource should be placed inside the same namespace
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#command-line-arguments" tabindex="1" class="md-skip"> <a href="#command-line-arguments" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1150,7 +1150,7 @@
<h1 id="command-line-arguments">Command line arguments<a class="headerlink" href="#command-line-arguments" title="Permanent link"></a></h1> <h1 id="command-line-arguments">Command line arguments<a class="headerlink" href="#command-line-arguments" title="Permanent link"></a></h1>
<p>The following command line arguments are accepted by the Ingress controller executable.</p> <p>The following command line arguments are accepted by the Ingress controller executable.</p>
<p>They are set in the container spec of the <code class="codehilite">nginx-ingress-controller</code> Deployment manifest</p> <p>They are set in the container spec of the <code class="codehilite"><span class="err">nginx-ingress-controller</span></code> Deployment manifest</p>
<table> <table>
<thead> <thead>
<tr> <tr>
@ -1160,183 +1160,183 @@
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td><code class="codehilite">--alsologtostderr</code></td> <td><code class="codehilite"><span class="err">--alsologtostderr</span></code></td>
<td>log to standard error as well as files</td> <td>log to standard error as well as files</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--annotations-prefix string</code></td> <td><code class="codehilite"><span class="err">--annotations-prefix string</span></code></td>
<td>Prefix of the Ingress annotations specific to the NGINX controller. (default "nginx.ingress.kubernetes.io")</td> <td>Prefix of the Ingress annotations specific to the NGINX controller. (default "nginx.ingress.kubernetes.io")</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--apiserver-host string</code></td> <td><code class="codehilite"><span class="err">--apiserver-host string</span></code></td>
<td>Address of the Kubernetes API server. Takes the form "protocol://address:port". If not specified, it is assumed the program runs inside a Kubernetes cluster and local discovery is attempted.</td> <td>Address of the Kubernetes API server. Takes the form "protocol://address:port". If not specified, it is assumed the program runs inside a Kubernetes cluster and local discovery is attempted.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--configmap string</code></td> <td><code class="codehilite"><span class="err">--configmap string</span></code></td>
<td>Name of the ConfigMap containing custom global configurations for the controller.</td> <td>Name of the ConfigMap containing custom global configurations for the controller.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--default-backend-service string</code></td> <td><code class="codehilite"><span class="err">--default-backend-service string</span></code></td>
<td>Service used to serve HTTP requests not matching any known server name (catch-all). Takes the form "namespace/name". The controller configures NGINX to forward requests to the first port of this Service. If not specified, a 404 page will be returned directly from NGINX.</td> <td>Service used to serve HTTP requests not matching any known server name (catch-all). Takes the form "namespace/name". The controller configures NGINX to forward requests to the first port of this Service. If not specified, a 404 page will be returned directly from NGINX.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--default-server-port int</code></td> <td><code class="codehilite"><span class="err">--default-server-port int</span></code></td>
<td>When <code class="codehilite">default-backend-service</code> is not specified or specified service does not have any endpoint, a local endpoint with this port will be used to serve 404 page from inside Nginx.</td> <td>When <code class="codehilite"><span class="err">default-backend-service</span></code> is not specified or specified service does not have any endpoint, a local endpoint with this port will be used to serve 404 page from inside Nginx.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--default-ssl-certificate string</code></td> <td><code class="codehilite"><span class="err">--default-ssl-certificate string</span></code></td>
<td>Secret containing a SSL certificate to be used by the default HTTPS server (catch-all). Takes the form "namespace/name".</td> <td>Secret containing a SSL certificate to be used by the default HTTPS server (catch-all). Takes the form "namespace/name".</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--disable-catch-all</code></td> <td><code class="codehilite"><span class="err">--disable-catch-all</span></code></td>
<td>Disable support for catch-all Ingresses.</td> <td>Disable support for catch-all Ingresses.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--election-id string</code></td> <td><code class="codehilite"><span class="err">--election-id string</span></code></td>
<td>Election id to use for Ingress status updates. (default "ingress-controller-leader")</td> <td>Election id to use for Ingress status updates. (default "ingress-controller-leader")</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--enable-dynamic-certificates</code></td> <td><code class="codehilite"><span class="err">--enable-dynamic-certificates</span></code></td>
<td>Dynamically serves certificates instead of reloading NGINX when certificates are created, updated, or deleted. Currently does not support OCSP stapling, so --enable-ssl-chain-completion must be turned off (default behaviour). Assuming the certificate is generated with a 2048 bit RSA key/cert pair, this feature can store roughly 5000 certificates. Once the backing Lua shared dictionary <code class="codehilite">certificate_data</code> is full, the least recently used certificate will be removed to store new ones. (enabled by default)</td> <td>Dynamically serves certificates instead of reloading NGINX when certificates are created, updated, or deleted. Currently does not support OCSP stapling, so --enable-ssl-chain-completion must be turned off (default behaviour). Assuming the certificate is generated with a 2048 bit RSA key/cert pair, this feature can store roughly 5000 certificates. Once the backing Lua shared dictionary <code class="codehilite"><span class="err">certificate_data</span></code> is full, the least recently used certificate will be removed to store new ones. (enabled by default)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--enable-metrics</code></td> <td><code class="codehilite"><span class="err">--enable-metrics</span></code></td>
<td>Enable the collection of metrics for scraping by Prometheus (default true)</td> <td>Enable the collection of metrics for scraping by Prometheus (default true)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--enable-ssl-chain-completion</code></td> <td><code class="codehilite"><span class="err">--enable-ssl-chain-completion</span></code></td>
<td>Autocomplete SSL certificate chains with missing intermediate CA certificates. A valid certificate chain is required to enable OCSP stapling. Certificates uploaded to Kubernetes must have the "Authority Information Access" X.509 v3 extension for this to succeed. (default true)</td> <td>Autocomplete SSL certificate chains with missing intermediate CA certificates. A valid certificate chain is required to enable OCSP stapling. Certificates uploaded to Kubernetes must have the "Authority Information Access" X.509 v3 extension for this to succeed. (default true)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--enable-ssl-passthrough</code></td> <td><code class="codehilite"><span class="err">--enable-ssl-passthrough</span></code></td>
<td>Enable SSL Passthrough.</td> <td>Enable SSL Passthrough.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--health-check-path string</code></td> <td><code class="codehilite"><span class="err">--health-check-path string</span></code></td>
<td>URL path of the health check endpoint. Configured inside the NGINX status server. All requests received on the port defined by the healthz-port parameter are forwarded internally to this path. (default "/healthz")</td> <td>URL path of the health check endpoint. Configured inside the NGINX status server. All requests received on the port defined by the healthz-port parameter are forwarded internally to this path. (default "/healthz")</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--health-check-timeout duration</code></td> <td><code class="codehilite"><span class="err">--health-check-timeout duration</span></code></td>
<td>Time limit, in seconds, for a probe to health-check-path to succeed. (default 10)</td> <td>Time limit, in seconds, for a probe to health-check-path to succeed. (default 10)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--healthz-port int</code></td> <td><code class="codehilite"><span class="err">--healthz-port int</span></code></td>
<td>Port to use for the healthz endpoint. (default 10254)</td> <td>Port to use for the healthz endpoint. (default 10254)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--http-port int</code></td> <td><code class="codehilite"><span class="err">--http-port int</span></code></td>
<td>Port to use for servicing HTTP traffic. (default 80)</td> <td>Port to use for servicing HTTP traffic. (default 80)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--https-port int</code></td> <td><code class="codehilite"><span class="err">--https-port int</span></code></td>
<td>Port to use for servicing HTTPS traffic. (default 443)</td> <td>Port to use for servicing HTTPS traffic. (default 443)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--status-port int</code></td> <td><code class="codehilite"><span class="err">--status-port int</span></code></td>
<td>Port to use for the lua HTTP endpoint configuration. (default 10246)</td> <td>Port to use for the lua HTTP endpoint configuration. (default 10246)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--stream-port int</code></td> <td><code class="codehilite"><span class="err">--stream-port int</span></code></td>
<td>Port to use for the lua TCP/UDP endpoint configuration. (default 10247)</td> <td>Port to use for the lua TCP/UDP endpoint configuration. (default 10247)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--ingress-class string</code></td> <td><code class="codehilite"><span class="err">--ingress-class string</span></code></td>
<td>Name of the ingress class this controller satisfies. The class of an Ingress object is set using the annotation "kubernetes.io/ingress.class". All ingress classes are satisfied if this parameter is left empty.</td> <td>Name of the ingress class this controller satisfies. The class of an Ingress object is set using the annotation "kubernetes.io/ingress.class". All ingress classes are satisfied if this parameter is left empty.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--kubeconfig string</code></td> <td><code class="codehilite"><span class="err">--kubeconfig string</span></code></td>
<td>Path to a kubeconfig file containing authorization and API server information.</td> <td>Path to a kubeconfig file containing authorization and API server information.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--log_backtrace_at traceLocation</code></td> <td><code class="codehilite"><span class="err">--log_backtrace_at traceLocation</span></code></td>
<td>when logging hits line file:N, emit a stack trace (default :0)</td> <td>when logging hits line file:N, emit a stack trace (default :0)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--log_dir string</code></td> <td><code class="codehilite"><span class="err">--log_dir string</span></code></td>
<td>If non-empty, write log files in this directory</td> <td>If non-empty, write log files in this directory</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--logtostderr</code></td> <td><code class="codehilite"><span class="err">--logtostderr</span></code></td>
<td>log to standard error instead of files (default true)</td> <td>log to standard error instead of files (default true)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--metrics-per-host</code></td> <td><code class="codehilite"><span class="err">--metrics-per-host</span></code></td>
<td>enable host labels for prometheus metrics. You may want to disable this to reduce the number of time-series created. (default true)</td> <td>enable host labels for prometheus metrics. You may want to disable this to reduce the number of time-series created. (default true)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--profiling</code></td> <td><code class="codehilite"><span class="err">--profiling</span></code></td>
<td>Enable profiling via web interface host:port/debug/pprof/ (default true)</td> <td>Enable profiling via web interface host:port/debug/pprof/ (default true)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--publish-service string</code></td> <td><code class="codehilite"><span class="err">--publish-service string</span></code></td>
<td>Service fronting the Ingress controller. Takes the form "namespace/name". When used together with update-status, the controller mirrors the address of this service's endpoints to the load-balancer status of all Ingress objects it satisfies.</td> <td>Service fronting the Ingress controller. Takes the form "namespace/name". When used together with update-status, the controller mirrors the address of this service's endpoints to the load-balancer status of all Ingress objects it satisfies.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--publish-status-address string</code></td> <td><code class="codehilite"><span class="err">--publish-status-address string</span></code></td>
<td>Customized address to set as the load-balancer status of Ingress objects this controller satisfies. Requires the update-status parameter.</td> <td>Customized address to set as the load-balancer status of Ingress objects this controller satisfies. Requires the update-status parameter.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--report-node-internal-ip-address</code></td> <td><code class="codehilite"><span class="err">--report-node-internal-ip-address</span></code></td>
<td>Set the load-balancer status of Ingress objects to internal Node addresses instead of external. Requires the update-status parameter.</td> <td>Set the load-balancer status of Ingress objects to internal Node addresses instead of external. Requires the update-status parameter.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--ssl-passthrough-proxy-port int</code></td> <td><code class="codehilite"><span class="err">--ssl-passthrough-proxy-port int</span></code></td>
<td>Port to use internally for SSL Passthrough. (default 442)</td> <td>Port to use internally for SSL Passthrough. (default 442)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--stderrthreshold severity</code></td> <td><code class="codehilite"><span class="err">--stderrthreshold severity</span></code></td>
<td>logs at or above this threshold go to stderr (default 2)</td> <td>logs at or above this threshold go to stderr (default 2)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--sync-period duration</code></td> <td><code class="codehilite"><span class="err">--sync-period duration</span></code></td>
<td>Period at which the controller forces the repopulation of its local object stores. Disabled by default.</td> <td>Period at which the controller forces the repopulation of its local object stores. Disabled by default.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--sync-rate-limit float32</code></td> <td><code class="codehilite"><span class="err">--sync-rate-limit float32</span></code></td>
<td>Define the sync frequency upper limit (default 0.3)</td> <td>Define the sync frequency upper limit (default 0.3)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--tcp-services-configmap string</code></td> <td><code class="codehilite"><span class="err">--tcp-services-configmap string</span></code></td>
<td>Name of the ConfigMap containing the definition of the TCP services to expose. The key in the map indicates the external port to be used. The value is a reference to a Service in the form "namespace/name:port", where "port" can either be a port number or name. TCP ports 80 and 443 are reserved by the controller for servicing HTTP traffic.</td> <td>Name of the ConfigMap containing the definition of the TCP services to expose. The key in the map indicates the external port to be used. The value is a reference to a Service in the form "namespace/name:port", where "port" can either be a port number or name. TCP ports 80 and 443 are reserved by the controller for servicing HTTP traffic.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--udp-services-configmap string</code></td> <td><code class="codehilite"><span class="err">--udp-services-configmap string</span></code></td>
<td>Name of the ConfigMap containing the definition of the UDP services to expose. The key in the map indicates the external port to be used. The value is a reference to a Service in the form "namespace/name:port", where "port" can either be a port name or number.</td> <td>Name of the ConfigMap containing the definition of the UDP services to expose. The key in the map indicates the external port to be used. The value is a reference to a Service in the form "namespace/name:port", where "port" can either be a port name or number.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--update-status</code></td> <td><code class="codehilite"><span class="err">--update-status</span></code></td>
<td>Update the load-balancer status of Ingress objects this controller satisfies. Requires setting the publish-service parameter to a valid Service reference. (default true)</td> <td>Update the load-balancer status of Ingress objects this controller satisfies. Requires setting the publish-service parameter to a valid Service reference. (default true)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--update-status-on-shutdown</code></td> <td><code class="codehilite"><span class="err">--update-status-on-shutdown</span></code></td>
<td>Update the load-balancer status of Ingress objects when the controller shuts down. Requires the update-status parameter. (default true)</td> <td>Update the load-balancer status of Ingress objects when the controller shuts down. Requires the update-status parameter. (default true)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">-v</code>, <code class="codehilite">--v Level</code></td> <td><code class="codehilite"><span class="err">-v</span></code>, <code class="codehilite"><span class="err">--v Level</span></code></td>
<td>log level for V logs</td> <td>log level for V logs</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--version</code></td> <td><code class="codehilite"><span class="err">--version</span></code></td>
<td>Show release information about the NGINX Ingress controller and exit.</td> <td>Show release information about the NGINX Ingress controller and exit.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--vmodule moduleSpec</code></td> <td><code class="codehilite"><span class="err">--vmodule moduleSpec</span></code></td>
<td>comma-separated list of pattern=N settings for file-filtered logging</td> <td>comma-separated list of pattern=N settings for file-filtered logging</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--watch-namespace string</code></td> <td><code class="codehilite"><span class="err">--watch-namespace string</span></code></td>
<td>Namespace the controller watches for updates to Kubernetes objects. This includes Ingresses, Services and all configuration resources. All namespaces are watched if this parameter is left empty.</td> <td>Namespace the controller watches for updates to Kubernetes objects. This includes Ingresses, Services and all configuration resources. All namespaces are watched if this parameter is left empty.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--validating-webhook</code></td> <td><code class="codehilite"><span class="err">--validating-webhook</span></code></td>
<td>The address to start an admission controller on</td> <td>The address to start an admission controller on</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--validating-webhook-certificate</code></td> <td><code class="codehilite"><span class="err">--validating-webhook-certificate</span></code></td>
<td>The certificate the webhook is using for its TLS handling</td> <td>The certificate the webhook is using for its TLS handling</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">--validating-webhook-key</code></td> <td><code class="codehilite"><span class="err">--validating-webhook-key</span></code></td>
<td>The key the webhook is using for its TLS handling</td> <td>The key the webhook is using for its TLS handling</td>
</tr> </tr>
</tbody> </tbody>
@ -1350,6 +1350,7 @@
</article> </article>
</div> </div>
</div> </div>
@ -1398,9 +1399,9 @@
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1410,7 +1411,7 @@
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#custom-errors" tabindex="1" class="md-skip"> <a href="#custom-errors" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1149,8 +1149,8 @@
<h1 id="custom-errors">Custom errors<a class="headerlink" href="#custom-errors" title="Permanent link"></a></h1> <h1 id="custom-errors">Custom errors<a class="headerlink" href="#custom-errors" title="Permanent link"></a></h1>
<p>When the <a href="../nginx-configuration/configmap/#custom-http-errors"><code class="codehilite">custom-http-errors</code></a> option is enabled, the Ingress controller configures NGINX so <p>When the <a href="../nginx-configuration/configmap/#custom-http-errors"><code class="codehilite"><span class="err">custom-http-errors</span></code></a> option is enabled, the Ingress controller configures NGINX so
that it passes several HTTP headers down to its <code class="codehilite">default-backend</code> in case of error:</p> that it passes several HTTP headers down to its <code class="codehilite"><span class="err">default-backend</span></code> in case of error:</p>
<table> <table>
<thead> <thead>
<tr> <tr>
@ -1160,45 +1160,45 @@ that it passes several HTTP headers down to its <code class="codehilite">default
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td><code class="codehilite">X-Code</code></td> <td><code class="codehilite"><span class="err">X-Code</span></code></td>
<td>HTTP status code retuned by the request</td> <td>HTTP status code retuned by the request</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">X-Format</code></td> <td><code class="codehilite"><span class="err">X-Format</span></code></td>
<td>Value of the <code class="codehilite">Accept</code> header sent by the client</td> <td>Value of the <code class="codehilite"><span class="err">Accept</span></code> header sent by the client</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">X-Original-URI</code></td> <td><code class="codehilite"><span class="err">X-Original-URI</span></code></td>
<td>URI that caused the error</td> <td>URI that caused the error</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">X-Namespace</code></td> <td><code class="codehilite"><span class="err">X-Namespace</span></code></td>
<td>Namespace where the backend Service is located</td> <td>Namespace where the backend Service is located</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">X-Ingress-Name</code></td> <td><code class="codehilite"><span class="err">X-Ingress-Name</span></code></td>
<td>Name of the Ingress where the backend is defined</td> <td>Name of the Ingress where the backend is defined</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">X-Service-Name</code></td> <td><code class="codehilite"><span class="err">X-Service-Name</span></code></td>
<td>Name of the Service backing the backend</td> <td>Name of the Service backing the backend</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">X-Service-Port</code></td> <td><code class="codehilite"><span class="err">X-Service-Port</span></code></td>
<td>Port number of the Service backing the backend</td> <td>Port number of the Service backing the backend</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">X-Request-ID</code></td> <td><code class="codehilite"><span class="err">X-Request-ID</span></code></td>
<td>Unique ID that identifies the request - same as for backend service</td> <td>Unique ID that identifies the request - same as for backend service</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<p>A custom error backend can use this information to return the best possible representation of an error page. For <p>A custom error backend can use this information to return the best possible representation of an error page. For
example, if the value of the <code class="codehilite">Accept</code> header send by the client was <code class="codehilite">application/json</code>, a carefully crafted backend example, if the value of the <code class="codehilite"><span class="err">Accept</span></code> header send by the client was <code class="codehilite"><span class="err">application/json</span></code>, a carefully crafted backend
could decide to return the error payload as a JSON document instead of HTML.</p> could decide to return the error payload as a JSON document instead of HTML.</p>
<div class="admonition important"> <div class="admonition important">
<p class="admonition-title">Important</p> <p class="admonition-title">Important</p>
<p>The custom backend is expected to return the correct HTTP status code instead of <code class="codehilite">200</code>. <p>The custom backend is expected to return the correct HTTP status code instead of <code class="codehilite"><span class="err">200</span></code>.
NGINX does not change the response from the custom default backend.</p> NGINX does not change the response from the custom default backend.</p>
</div> </div>
<p>An example of such custom backend is available inside the source repository at <a href="https://github.com/kubernetes/ingress-nginx/tree/master/images/custom-error-pages">images/custom-error-pages</a>.</p> <p>An example of such custom backend is available inside the source repository at <a href="https://github.com/kubernetes/ingress-nginx/tree/master/images/custom-error-pages">images/custom-error-pages</a>.</p>
@ -1212,6 +1212,7 @@ NGINX does not change the response from the custom default backend.</p>
</article> </article>
</div> </div>
</div> </div>
@ -1260,9 +1261,9 @@ NGINX does not change the response from the custom default backend.</p>
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1272,7 +1273,7 @@ NGINX does not change the response from the custom default backend.</p>
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#default-backend" tabindex="1" class="md-skip"> <a href="#default-backend" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1153,12 +1153,12 @@
(i.e., all the requests that are not mapped with an Ingress).</p> (i.e., all the requests that are not mapped with an Ingress).</p>
<p>Basically a default backend exposes two URLs:</p> <p>Basically a default backend exposes two URLs:</p>
<ul> <ul>
<li><code class="codehilite">/healthz</code> that returns 200</li> <li><code class="codehilite"><span class="err">/healthz</span></code> that returns 200</li>
<li><code class="codehilite">/</code> that returns 404</li> <li><code class="codehilite"><span class="err">/</span></code> that returns 404</li>
</ul> </ul>
<div class="admonition example"> <div class="admonition example">
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<p>The sub-directory <a href="https://github.com/kubernetes/ingress-nginx/tree/master/images/custom-error-pages"><code class="codehilite">/images/custom-error-pages</code></a> <p>The sub-directory <a href="https://github.com/kubernetes/ingress-nginx/tree/master/images/custom-error-pages"><code class="codehilite"><span class="err">/images/custom-error-pages</span></code></a>
provides an additional service for the purpose of customizing the error pages served via the default backend.</p> provides an additional service for the purpose of customizing the error pages served via the default backend.</p>
</div> </div>
@ -1170,6 +1170,7 @@ provides an additional service for the purpose of customizing the error pages se
</article> </article>
</div> </div>
</div> </div>
@ -1218,9 +1219,9 @@ provides an additional service for the purpose of customizing the error pages se
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1230,7 +1231,7 @@ provides an additional service for the purpose of customizing the error pages se
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#exposing-tcp-and-udp-services" tabindex="1" class="md-skip"> <a href="#exposing-tcp-and-udp-services" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1149,33 +1149,33 @@
<h1 id="exposing-tcp-and-udp-services">Exposing TCP and UDP services<a class="headerlink" href="#exposing-tcp-and-udp-services" title="Permanent link"></a></h1> <h1 id="exposing-tcp-and-udp-services">Exposing TCP and UDP services<a class="headerlink" href="#exposing-tcp-and-udp-services" title="Permanent link"></a></h1>
<p>Ingress does not support TCP or UDP services. For this reason this Ingress controller uses the flags <code class="codehilite">--tcp-services-configmap</code> and <code class="codehilite">--udp-services-configmap</code> to point to an existing config map where the key is the external port to use and the value indicates the service to expose using the format: <p>Ingress does not support TCP or UDP services. For this reason this Ingress controller uses the flags <code class="codehilite"><span class="err">--tcp-services-configmap</span></code> and <code class="codehilite"><span class="err">--udp-services-configmap</span></code> to point to an existing config map where the key is the external port to use and the value indicates the service to expose using the format:
<code class="codehilite">&lt;namespace/service name&gt;:&lt;service port&gt;:[PROXY]:[PROXY]</code></p> <code class="codehilite"><span class="o">&lt;</span><span class="n">namespace</span><span class="o">/</span><span class="n">service</span><span class="w"> </span><span class="n">name</span><span class="o">&gt;</span><span class="err">:</span><span class="o">&lt;</span><span class="n">service</span><span class="w"> </span><span class="n">port</span><span class="o">&gt;</span><span class="err">:</span><span class="o">[</span><span class="n">PROXY</span><span class="o">]</span><span class="err">:</span><span class="o">[</span><span class="n">PROXY</span><span class="o">]</span><span class="w"></span></code></p>
<p>It is also possible to use a number or the name of the port. The two last fields are optional. <p>It is also possible to use a number or the name of the port. The two last fields are optional.
Adding <code class="codehilite">PROXY</code> in either or both of the two last fields we can use Proxy Protocol decoding (listen) and/or encoding (proxy_pass) in a TCP service https://www.nginx.com/resources/admin-guide/proxy-protocol</p> Adding <code class="codehilite"><span class="err">PROXY</span></code> in either or both of the two last fields we can use Proxy Protocol decoding (listen) and/or encoding (proxy_pass) in a TCP service https://www.nginx.com/resources/admin-guide/proxy-protocol</p>
<p>The next example shows how to expose the service <code class="codehilite">example-go</code> running in the namespace <code class="codehilite">default</code> in the port <code class="codehilite">8080</code> using the port <code class="codehilite">9000</code></p> <p>The next example shows how to expose the service <code class="codehilite"><span class="err">example-go</span></code> running in the namespace <code class="codehilite"><span class="err">default</span></code> in the port <code class="codehilite"><span class="err">8080</span></code> using the port <code class="codehilite"><span class="err">9000</span></code></p>
<div class="codehilite"><pre><span></span><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span> <div class="codehilite"><pre><span></span><code><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span>
<span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ConfigMap</span> <span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ConfigMap</span>
<span class="nt">metadata</span><span class="p">:</span> <span class="nt">metadata</span><span class="p">:</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">tcp-services</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">tcp-services</span>
<span class="nt">namespace</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress-nginx</span> <span class="nt">namespace</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress-nginx</span>
<span class="nt">data</span><span class="p">:</span> <span class="nt">data</span><span class="p">:</span>
<span class="nt">9000</span><span class="p">:</span> <span class="s">&quot;default/example-go:8080&quot;</span> <span class="nt">9000</span><span class="p">:</span> <span class="s">&quot;default/example-go:8080&quot;</span>
</pre></div> </code></pre></div>
<p>Since 1.9.13 NGINX provides <a href="https://www.nginx.com/blog/announcing-udp-load-balancing/">UDP Load Balancing</a>. <p>Since 1.9.13 NGINX provides <a href="https://www.nginx.com/blog/announcing-udp-load-balancing/">UDP Load Balancing</a>.
The next example shows how to expose the service <code class="codehilite">kube-dns</code> running in the namespace <code class="codehilite">kube-system</code> in the port <code class="codehilite">53</code> using the port <code class="codehilite">53</code></p> The next example shows how to expose the service <code class="codehilite"><span class="err">kube-dns</span></code> running in the namespace <code class="codehilite"><span class="err">kube-system</span></code> in the port <code class="codehilite"><span class="err">53</span></code> using the port <code class="codehilite"><span class="err">53</span></code></p>
<div class="codehilite"><pre><span></span><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span> <div class="codehilite"><pre><span></span><code><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span>
<span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ConfigMap</span> <span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ConfigMap</span>
<span class="nt">metadata</span><span class="p">:</span> <span class="nt">metadata</span><span class="p">:</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">udp-services</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">udp-services</span>
<span class="nt">namespace</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress-nginx</span> <span class="nt">namespace</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress-nginx</span>
<span class="nt">data</span><span class="p">:</span> <span class="nt">data</span><span class="p">:</span>
<span class="nt">53</span><span class="p">:</span> <span class="s">&quot;kube-system/kube-dns:53&quot;</span> <span class="nt">53</span><span class="p">:</span> <span class="s">&quot;kube-system/kube-dns:53&quot;</span>
</pre></div> </code></pre></div>
<p>If TCP/UDP proxy support is used, then those ports need to be exposed in the Service defined for the Ingress.</p> <p>If TCP/UDP proxy support is used, then those ports need to be exposed in the Service defined for the Ingress.</p>
<div class="codehilite"><pre><span></span><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span> <div class="codehilite"><pre><span></span><code><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span>
<span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Service</span> <span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Service</span>
<span class="nt">metadata</span><span class="p">:</span> <span class="nt">metadata</span><span class="p">:</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress-nginx</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress-nginx</span>
@ -1201,7 +1201,8 @@ The next example shows how to expose the service <code class="codehilite">kube-d
<span class="nt">selector</span><span class="p">:</span> <span class="nt">selector</span><span class="p">:</span>
<span class="nt">app.kubernetes.io/name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress-nginx</span> <span class="nt">app.kubernetes.io/name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress-nginx</span>
<span class="nt">app.kubernetes.io/part-of</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress-nginx</span> <span class="nt">app.kubernetes.io/part-of</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress-nginx</span>
</pre></div> </code></pre></div>
@ -1259,9 +1260,9 @@ The next example shows how to expose the service <code class="codehilite">kube-d
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1271,7 +1272,7 @@ The next example shows how to expose the service <code class="codehilite">kube-d
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#external-articles" tabindex="1" class="md-skip"> <a href="#external-articles" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1164,6 +1164,7 @@
</article> </article>
</div> </div>
</div> </div>
@ -1212,9 +1213,9 @@
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1224,7 +1225,7 @@
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#exposing-fastcgi-servers" tabindex="1" class="md-skip"> <a href="#exposing-fastcgi-servers" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -688,20 +688,13 @@
</li> </li>
<li class="md-nav__item"> <li class="md-nav__item">
<a href="#the-fastcgi-ingress-annotations" class="md-nav__link"> <a href="#fastcgi-ingress-annotations" class="md-nav__link">
The FastCGI Ingress Annotations FastCGI Ingress Annotations
</a> </a>
<nav class="md-nav"> <nav class="md-nav">
<ul class="md-nav__list"> <ul class="md-nav__list">
<li class="md-nav__item">
<a href="#the-nginxingresskubernetesiobackend-protocol-annotation" class="md-nav__link">
The nginx.ingress.kubernetes.io/backend-protocol Annotation
</a>
</li>
<li class="md-nav__item"> <li class="md-nav__item">
<a href="#the-nginxingresskubernetesiofastcgi-index-annotation" class="md-nav__link"> <a href="#the-nginxingresskubernetesiofastcgi-index-annotation" class="md-nav__link">
The nginx.ingress.kubernetes.io/fastcgi-index Annotation The nginx.ingress.kubernetes.io/fastcgi-index Annotation
@ -1209,20 +1202,13 @@
</li> </li>
<li class="md-nav__item"> <li class="md-nav__item">
<a href="#the-fastcgi-ingress-annotations" class="md-nav__link"> <a href="#fastcgi-ingress-annotations" class="md-nav__link">
The FastCGI Ingress Annotations FastCGI Ingress Annotations
</a> </a>
<nav class="md-nav"> <nav class="md-nav">
<ul class="md-nav__list"> <ul class="md-nav__list">
<li class="md-nav__item">
<a href="#the-nginxingresskubernetesiobackend-protocol-annotation" class="md-nav__link">
The nginx.ingress.kubernetes.io/backend-protocol Annotation
</a>
</li>
<li class="md-nav__item"> <li class="md-nav__item">
<a href="#the-nginxingresskubernetesiofastcgi-index-annotation" class="md-nav__link"> <a href="#the-nginxingresskubernetesiofastcgi-index-annotation" class="md-nav__link">
The nginx.ingress.kubernetes.io/fastcgi-index Annotation The nginx.ingress.kubernetes.io/fastcgi-index Annotation
@ -1266,10 +1252,10 @@
<p><strong>FastCGI</strong> is a <a href="https://en.wikipedia.org/wiki/Binary_protocol" title="Binary protocol">binary protocol</a> for interfacing interactive programs with a <a href="https://en.wikipedia.org/wiki/Web_server" title="Web server">web server</a>. [...] (It's) aim is to reduce the overhead related to interfacing between web server and CGI programs, allowing a server to handle more web page requests per unit of time.</p> <p><strong>FastCGI</strong> is a <a href="https://en.wikipedia.org/wiki/Binary_protocol" title="Binary protocol">binary protocol</a> for interfacing interactive programs with a <a href="https://en.wikipedia.org/wiki/Web_server" title="Web server">web server</a>. [...] (It's) aim is to reduce the overhead related to interfacing between web server and CGI programs, allowing a server to handle more web page requests per unit of time.</p>
<p>&mdash; Wikipedia</p> <p>&mdash; Wikipedia</p>
</blockquote> </blockquote>
<p>The <em>ingress-nginx</em> ingress controller can be used to directly expose <a href="https://en.wikipedia.org/wiki/FastCGI">FastCGI</a> servers. Enabling FastCGI in your Ingress only requires setting the <em>backend-protocol</em> annotation to <code class="codehilite">FCGI</code>, and with a couple more annotations you can customize the way <em>ingress-nginx</em> handles the communication with your FastCGI <em>server</em>.</p> <p>The <em>ingress-nginx</em> ingress controller can be used to directly expose <a href="https://en.wikipedia.org/wiki/FastCGI">FastCGI</a> servers. Enabling FastCGI in your Ingress only requires setting the <em>backend-protocol</em> annotation to <code class="codehilite"><span class="err">FCGI</span></code>, and with a couple more annotations you can customize the way <em>ingress-nginx</em> handles the communication with your FastCGI <em>server</em>.</p>
<h2 id="example-objects-to-expose-a-fastcgi-pod">Example Objects to Expose a FastCGI Pod<a class="headerlink" href="#example-objects-to-expose-a-fastcgi-pod" title="Permanent link"></a></h2> <h2 id="example-objects-to-expose-a-fastcgi-pod">Example Objects to Expose a FastCGI Pod<a class="headerlink" href="#example-objects-to-expose-a-fastcgi-pod" title="Permanent link"></a></h2>
<p>The <em>Pod</em> example object below exposes port <code class="codehilite">9000</code>, which is the conventional FastCGI port.</p> <p>The <em>Pod</em> example object below exposes port <code class="codehilite"><span class="err">9000</span></code>, which is the conventional FastCGI port.</p>
<div class="codehilite"><pre><span></span><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span> <div class="codehilite"><pre><span></span><code><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span>
<span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Pod</span> <span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Pod</span>
<span class="nt">metadata</span><span class="p">:</span> <span class="nt">metadata</span><span class="p">:</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">example-app</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">example-app</span>
@ -1282,10 +1268,10 @@
<span class="nt">ports</span><span class="p">:</span> <span class="nt">ports</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="nt">containerPort</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">9000</span> <span class="p p-Indicator">-</span> <span class="nt">containerPort</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">9000</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">fastcgi</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">fastcgi</span>
</pre></div> </code></pre></div>
<p>The <em>Service</em> object example below matches port <code class="codehilite">9000</code> from the <em>Pod</em> object above.</p> <p>The <em>Service</em> object example below matches port <code class="codehilite"><span class="err">9000</span></code> from the <em>Pod</em> object above.</p>
<div class="codehilite"><pre><span></span><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span> <div class="codehilite"><pre><span></span><code><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span>
<span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Service</span> <span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Service</span>
<span class="nt">metadata</span><span class="p">:</span> <span class="nt">metadata</span><span class="p">:</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">example-service</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">example-service</span>
@ -1296,10 +1282,10 @@
<span class="p p-Indicator">-</span> <span class="nt">port</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">9000</span> <span class="p p-Indicator">-</span> <span class="nt">port</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">9000</span>
<span class="nt">targetPort</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">9000</span> <span class="nt">targetPort</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">9000</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">fastcgi</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">fastcgi</span>
</pre></div> </code></pre></div>
<p>And the <em>Ingress</em> and <em>ConfigMap</em> objects below demonstrates the supported <em>FastCGI</em> specific annotations (NGINX actually has 50 FastCGI directives, all of which have not been exposed in the ingress yet), and matches the service <code class="codehilite">example-service</code>, and the port named <code class="codehilite">fastcgi</code> from above. The <em>ConfigMap</em> <strong>must</strong> be created first for the <em>Ingress Controller</em> to be able to find it when the <em>Ingress</em> object is created, otherwise you will need to restart the <em>Ingress Controller</em> pods.</p> <p>And the <em>Ingress</em> and <em>ConfigMap</em> objects below demonstrates the supported <em>FastCGI</em> specific annotations (NGINX actually has 50 FastCGI directives, all of which have not been exposed in the ingress yet), and matches the service <code class="codehilite"><span class="err">example-service</span></code>, and the port named <code class="codehilite"><span class="err">fastcgi</span></code> from above. The <em>ConfigMap</em> <strong>must</strong> be created first for the <em>Ingress Controller</em> to be able to find it when the <em>Ingress</em> object is created, otherwise you will need to restart the <em>Ingress Controller</em> pods.</p>
<div class="codehilite"><pre><span></span><span class="c1"># The ConfigMap MUST be created first for the ingress controller to be able to</span> <div class="codehilite"><pre><span></span><code><span class="c1"># The ConfigMap MUST be created first for the ingress controller to be able to</span>
<span class="c1"># find it when the Ingress object is created.</span> <span class="c1"># find it when the Ingress object is created.</span>
<span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span> <span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span>
@ -1328,37 +1314,36 @@
<span class="p p-Indicator">-</span> <span class="nt">backend</span><span class="p">:</span> <span class="p p-Indicator">-</span> <span class="nt">backend</span><span class="p">:</span>
<span class="nt">serviceName</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">example-service</span> <span class="nt">serviceName</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">example-service</span>
<span class="nt">servicePort</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">fastcgi</span> <span class="nt">servicePort</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">fastcgi</span>
</pre></div> </code></pre></div>
<h2 id="the-fastcgi-ingress-annotations">The FastCGI Ingress Annotations<a class="headerlink" href="#the-fastcgi-ingress-annotations" title="Permanent link"></a></h2> <h2 id="fastcgi-ingress-annotations">FastCGI Ingress Annotations<a class="headerlink" href="#fastcgi-ingress-annotations" title="Permanent link"></a></h2>
<h3 id="the-nginxingresskubernetesiobackend-protocol-annotation">The <code class="codehilite">nginx.ingress.kubernetes.io/backend-protocol</code> Annotation<a class="headerlink" href="#the-nginxingresskubernetesiobackend-protocol-annotation" title="Permanent link"></a></h3> <p>To enable FastCGI, the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/backend-protocol</span></code> annotation needs to be set to <code class="codehilite"><span class="err">FCGI</span></code>, which overrides the default <code class="codehilite"><span class="err">HTTP</span></code> value.</p>
<p>To enable FastCGI, the <code class="codehilite">backend-protocol</code> annotation needs to be set to <code class="codehilite">FCGI</code>, which overrides the default <code class="codehilite">HTTP</code> value.</p>
<blockquote> <blockquote>
<p><code class="codehilite">nginx.ingress.kubernetes.io/backend-protocol: &quot;FCGI&quot;</code></p> <p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/backend-protocol: &quot;FCGI&quot;</span></code></p>
</blockquote> </blockquote>
<p>This enables the <em>FastCGI</em> mode for the whole <em>Ingress</em> object.</p> <p><strong>This enables the <em>FastCGI</em> mode for all paths defined in the <em>Ingress</em> object</strong></p>
<h3 id="the-nginxingresskubernetesiofastcgi-index-annotation">The <code class="codehilite">nginx.ingress.kubernetes.io/fastcgi-index</code> Annotation<a class="headerlink" href="#the-nginxingresskubernetesiofastcgi-index-annotation" title="Permanent link"></a></h3> <h3 id="the-nginxingresskubernetesiofastcgi-index-annotation">The <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/fastcgi-index</span></code> Annotation<a class="headerlink" href="#the-nginxingresskubernetesiofastcgi-index-annotation" title="Permanent link"></a></h3>
<p>To specify an index file, the <code class="codehilite">fastcgi-index</code> annotation value can optionally be set. In the example below, the value is set to <code class="codehilite">index.php</code>. This annotation corresponds to <a href="http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_index">the <em>NGINX</em> <code class="codehilite">fastcgi_index</code> directive</a>.</p> <p>To specify an index file, the <code class="codehilite"><span class="err">fastcgi-index</span></code> annotation value can optionally be set. In the example below, the value is set to <code class="codehilite"><span class="err">index.php</span></code>. This annotation corresponds to <a href="http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_index">the <em>NGINX</em> <code class="codehilite"><span class="err">fastcgi_index</span></code> directive</a>.</p>
<blockquote> <blockquote>
<p><code class="codehilite">nginx.ingress.kubernetes.io/fastcgi-index: &quot;index.php&quot;</code></p> <p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/fastcgi-index: &quot;index.php&quot;</span></code></p>
</blockquote> </blockquote>
<h3 id="the-nginxingresskubernetesiofastcgi-params-configmap-annotation">The <code class="codehilite">nginx.ingress.kubernetes.io/fastcgi-params-configmap</code> Annotation<a class="headerlink" href="#the-nginxingresskubernetesiofastcgi-params-configmap-annotation" title="Permanent link"></a></h3> <h3 id="the-nginxingresskubernetesiofastcgi-params-configmap-annotation">The <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/fastcgi-params-configmap</span></code> Annotation<a class="headerlink" href="#the-nginxingresskubernetesiofastcgi-params-configmap-annotation" title="Permanent link"></a></h3>
<p>To specify <a href="http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_param"><em>NGINX</em> <code class="codehilite">fastcgi_param</code> directives</a>, the <code class="codehilite">fastcgi-params-configmap</code> annotation is used, which in turn must lead to a <em>ConfigMap</em> object containing the <em>NGINX</em> <code class="codehilite">fastcgi_param</code> directives as key/values.</p> <p>To specify <a href="http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_param"><em>NGINX</em> <code class="codehilite"><span class="err">fastcgi_param</span></code> directives</a>, the <code class="codehilite"><span class="err">fastcgi-params-configmap</span></code> annotation is used, which in turn must lead to a <em>ConfigMap</em> object containing the <em>NGINX</em> <code class="codehilite"><span class="err">fastcgi_param</span></code> directives as key/values.</p>
<blockquote> <blockquote>
<p><code class="codehilite">nginx.ingress.kubernetes.io/fastcgi-params-configmap: &quot;example-configmap&quot;</code></p> <p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/fastcgi-params-configmap: &quot;example-configmap&quot;</span></code></p>
</blockquote> </blockquote>
<p>And the <em>ConfigMap</em> object to specify the <code class="codehilite">SCRIPT_FILENAME</code> and <code class="codehilite">HTTP_PROXY</code> <em>NGINX's</em> <code class="codehilite">fastcgi_param</code> directives will look like the following:</p> <p>And the <em>ConfigMap</em> object to specify the <code class="codehilite"><span class="err">SCRIPT_FILENAME</span></code> and <code class="codehilite"><span class="err">HTTP_PROXY</span></code> <em>NGINX's</em> <code class="codehilite"><span class="err">fastcgi_param</span></code> directives will look like the following:</p>
<p><div class="codehilite"><pre><span></span><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span> <p><div class="codehilite"><pre><span></span><code><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span>
<span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ConfigMap</span> <span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ConfigMap</span>
<span class="nt">metadata</span><span class="p">:</span> <span class="nt">metadata</span><span class="p">:</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">example-configmap</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">example-configmap</span>
<span class="nt">data</span><span class="p">:</span> <span class="nt">data</span><span class="p">:</span>
<span class="nt">SCRIPT_FILENAME</span><span class="p">:</span> <span class="s">&quot;/example/index.php&quot;</span> <span class="nt">SCRIPT_FILENAME</span><span class="p">:</span> <span class="s">&quot;/example/index.php&quot;</span>
<span class="nt">HTTP_PROXY</span><span class="p">:</span> <span class="s">&quot;&quot;</span> <span class="nt">HTTP_PROXY</span><span class="p">:</span> <span class="s">&quot;&quot;</span>
</pre></div> </code></pre></div>
Using the <em>namespace/</em> prefix is also supported, for example:</p> Using the <em>namespace/</em> prefix is also supported, for example:</p>
<blockquote> <blockquote>
<p><code class="codehilite">nginx.ingress.kubernetes.io/fastcgi-params-configmap: &quot;example-namespace/example-configmap&quot;</code></p> <p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/fastcgi-params-configmap: &quot;example-namespace/example-configmap&quot;</span></code></p>
</blockquote> </blockquote>
@ -1369,6 +1354,7 @@ Using the <em>namespace/</em> prefix is also supported, for example:</p>
</article> </article>
</div> </div>
</div> </div>
@ -1417,9 +1403,9 @@ Using the <em>namespace/</em> prefix is also supported, for example:</p>
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1429,7 +1415,7 @@ Using the <em>namespace/</em> prefix is also supported, for example:</p>
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#ingress-path-matching" tabindex="1" class="md-skip"> <a href="#ingress-path-matching" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1277,17 +1277,17 @@
<h2 id="regular-expression-support">Regular Expression Support<a class="headerlink" href="#regular-expression-support" title="Permanent link"></a></h2> <h2 id="regular-expression-support">Regular Expression Support<a class="headerlink" href="#regular-expression-support" title="Permanent link"></a></h2>
<div class="admonition important"> <div class="admonition important">
<p class="admonition-title">Important</p> <p class="admonition-title">Important</p>
<p>Regular expressions and wild cards are not supported in the <code class="codehilite">spec.rules.host</code> field. Full hostnames must be used.</p> <p>Regular expressions and wild cards are not supported in the <code class="codehilite"><span class="err">spec.rules.host</span></code> field. Full hostnames must be used.</p>
</div> </div>
<p>The ingress controller supports <strong>case insensitive</strong> regular expressions in the <code class="codehilite">spec.rules.http.paths.path</code> field. <p>The ingress controller supports <strong>case insensitive</strong> regular expressions in the <code class="codehilite"><span class="err">spec.rules.http.paths.path</span></code> field.
This can be enabled by setting the <code class="codehilite">nginx.ingress.kubernetes.io/use-regex</code> annotation to <code class="codehilite">true</code> (the default is false).</p> This can be enabled by setting the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/use-regex</span></code> annotation to <code class="codehilite"><span class="err">true</span></code> (the default is false).</p>
<div class="admonition hint"> <div class="admonition hint">
<p class="admonition-title">Hint</p> <p class="admonition-title">Hint</p>
</div>
<p>Kubernetes only accept expressions that comply with the RE2 engine syntax. It is possible that valid expressions accepted by NGINX cannot be used with ingress-nginx, because the PCRE library (used in NGINX) supports a wider syntax than RE2. <p>Kubernetes only accept expressions that comply with the RE2 engine syntax. It is possible that valid expressions accepted by NGINX cannot be used with ingress-nginx, because the PCRE library (used in NGINX) supports a wider syntax than RE2.
See the <a href="https://github.com/google/re2/wiki/Syntax">RE2 Syntax</a> documentation for differences.</p> See the <a href="https://github.com/google/re2/wiki/Syntax">RE2 Syntax</a> documentation for differences.</p>
<p>See the <a href="../nginx-configuration/annotations/#use-regex">description</a> of the <code class="codehilite">use-regex</code> annotation for more details.</p> </div>
<div class="codehilite"><pre><span></span><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">networking.k8s.io/v1beta1</span> <p>See the <a href="../nginx-configuration/annotations/#use-regex">description</a> of the <code class="codehilite"><span class="err">use-regex</span></code> annotation for more details.</p>
<div class="codehilite"><pre><span></span><code><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">networking.k8s.io/v1beta1</span>
<span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Ingress</span> <span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Ingress</span>
<span class="nt">metadata</span><span class="p">:</span> <span class="nt">metadata</span><span class="p">:</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">test-ingress</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">test-ingress</span>
@ -1302,20 +1302,20 @@ See the <a href="https://github.com/google/re2/wiki/Syntax">RE2 Syntax</a> docum
<span class="nt">backend</span><span class="p">:</span> <span class="nt">backend</span><span class="p">:</span>
<span class="nt">serviceName</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">test</span> <span class="nt">serviceName</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">test</span>
<span class="nt">servicePort</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">80</span> <span class="nt">servicePort</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">80</span>
</pre></div> </code></pre></div>
<p>The preceding ingress definition would translate to the following location block within the NGINX configuration for the <code class="codehilite">test.com</code> server:</p> <p>The preceding ingress definition would translate to the following location block within the NGINX configuration for the <code class="codehilite"><span class="err">test.com</span></code> server:</p>
<div class="codehilite"><pre><span></span>location ~* &quot;^/foo/.*&quot; { <div class="codehilite"><pre><span></span><code><span class="err">location ~* &quot;^/foo/.*&quot; {</span>
... <span class="err"> ...</span>
} <span class="err">}</span>
</pre></div> </code></pre></div>
<h2 id="path-priority">Path Priority<a class="headerlink" href="#path-priority" title="Permanent link"></a></h2> <h2 id="path-priority">Path Priority<a class="headerlink" href="#path-priority" title="Permanent link"></a></h2>
<p>In NGINX, regular expressions follow a <strong>first match</strong> policy. In order to enable more accurate path matching, ingress-nginx first orders the paths by descending length before writing them to the NGINX template as location blocks.</p> <p>In NGINX, regular expressions follow a <strong>first match</strong> policy. In order to enable more accurate path matching, ingress-nginx first orders the paths by descending length before writing them to the NGINX template as location blocks.</p>
<p><strong>Please read the <a href="#warning">warning</a> before using regular expressions in your ingress definitions.</strong></p> <p><strong>Please read the <a href="#warning">warning</a> before using regular expressions in your ingress definitions.</strong></p>
<h3 id="example">Example<a class="headerlink" href="#example" title="Permanent link"></a></h3> <h3 id="example">Example<a class="headerlink" href="#example" title="Permanent link"></a></h3>
<p>Let the following two ingress definitions be created:</p> <p>Let the following two ingress definitions be created:</p>
<div class="codehilite"><pre><span></span><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">networking.k8s.io/v1beta1</span> <div class="codehilite"><pre><span></span><code><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">networking.k8s.io/v1beta1</span>
<span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Ingress</span> <span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Ingress</span>
<span class="nt">metadata</span><span class="p">:</span> <span class="nt">metadata</span><span class="p">:</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">test-ingress-1</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">test-ingress-1</span>
@ -1332,9 +1332,9 @@ See the <a href="https://github.com/google/re2/wiki/Syntax">RE2 Syntax</a> docum
<span class="nt">backend</span><span class="p">:</span> <span class="nt">backend</span><span class="p">:</span>
<span class="nt">serviceName</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">service2</span> <span class="nt">serviceName</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">service2</span>
<span class="nt">servicePort</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">80</span> <span class="nt">servicePort</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">80</span>
</pre></div> </code></pre></div>
<div class="codehilite"><pre><span></span><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">networking.k8s.io/v1beta1</span> <div class="codehilite"><pre><span></span><code><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">networking.k8s.io/v1beta1</span>
<span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Ingress</span> <span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Ingress</span>
<span class="nt">metadata</span><span class="p">:</span> <span class="nt">metadata</span><span class="p">:</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">test-ingress-2</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">test-ingress-2</span>
@ -1349,38 +1349,38 @@ See the <a href="https://github.com/google/re2/wiki/Syntax">RE2 Syntax</a> docum
<span class="nt">backend</span><span class="p">:</span> <span class="nt">backend</span><span class="p">:</span>
<span class="nt">serviceName</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">service3</span> <span class="nt">serviceName</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">service3</span>
<span class="nt">servicePort</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">80</span> <span class="nt">servicePort</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">80</span>
</pre></div> </code></pre></div>
<p>The ingress controller would define the following location blocks, in order of descending length, within the NGINX template for the <code class="codehilite">test.com</code> server:</p> <p>The ingress controller would define the following location blocks, in order of descending length, within the NGINX template for the <code class="codehilite"><span class="err">test.com</span></code> server:</p>
<div class="codehilite"><pre><span></span>location ~* ^/foo/bar/.+ { <div class="codehilite"><pre><span></span><code><span class="k">location</span> <span class="o">~*</span> <span class="o">^/</span><span class="n">foo</span><span class="o">/</span><span class="n">bar</span><span class="o">/</span><span class="p">.</span><span class="o">+</span> <span class="err">{</span>
... <span class="p">...</span>
} <span class="err">}</span>
location ~* &quot;^/foo/bar/&quot; { <span class="k">location</span> <span class="o">~*</span> <span class="ss">&quot;^/foo/bar/&quot;</span> <span class="err">{</span>
... <span class="p">...</span>
} <span class="err">}</span>
location ~* &quot;^/foo/bar&quot; { <span class="k">location</span> <span class="o">~*</span> <span class="ss">&quot;^/foo/bar&quot;</span> <span class="err">{</span>
... <span class="p">...</span>
} <span class="err">}</span>
</pre></div> </code></pre></div>
<p>The following request URI's would match the corresponding location blocks:</p> <p>The following request URI's would match the corresponding location blocks:</p>
<ul> <ul>
<li><code class="codehilite">test.com/foo/bar/1</code> matches <code class="codehilite">~* ^/foo/bar/.+</code> and will go to service 3.</li> <li><code class="codehilite"><span class="err">test.com/foo/bar/1</span></code> matches <code class="codehilite"><span class="err">~* ^/foo/bar/.+</span></code> and will go to service 3.</li>
<li><code class="codehilite">test.com/foo/bar/</code> matches <code class="codehilite">~* ^/foo/bar/</code> and will go to service 2.</li> <li><code class="codehilite"><span class="err">test.com/foo/bar/</span></code> matches <code class="codehilite"><span class="err">~* ^/foo/bar/</span></code> and will go to service 2.</li>
<li><code class="codehilite">test.com/foo/bar</code> matches <code class="codehilite">~* ^/foo/bar</code> and will go to service 1.</li> <li><code class="codehilite"><span class="err">test.com/foo/bar</span></code> matches <code class="codehilite"><span class="err">~* ^/foo/bar</span></code> and will go to service 1.</li>
</ul> </ul>
<p><strong>IMPORTANT NOTES</strong>:</p> <p><strong>IMPORTANT NOTES</strong>:</p>
<ul> <ul>
<li>If the <code class="codehilite">use-regex</code> OR <code class="codehilite">rewrite-target</code> annotation is used on any Ingress for a given host, then the case insensitive regular expression <a href="https://nginx.org/en/docs/http/ngx_http_core_module.html#location">location modifier</a> will be enforced on ALL paths for a given host regardless of what Ingress they are defined on.</li> <li>If the <code class="codehilite"><span class="err">use-regex</span></code> OR <code class="codehilite"><span class="err">rewrite-target</span></code> annotation is used on any Ingress for a given host, then the case insensitive regular expression <a href="https://nginx.org/en/docs/http/ngx_http_core_module.html#location">location modifier</a> will be enforced on ALL paths for a given host regardless of what Ingress they are defined on.</li>
</ul> </ul>
<h2 id="warning">Warning<a class="headerlink" href="#warning" title="Permanent link"></a></h2> <h2 id="warning">Warning<a class="headerlink" href="#warning" title="Permanent link"></a></h2>
<p>The following example describes a case that may inflict unwanted path matching behaviour.</p> <p>The following example describes a case that may inflict unwanted path matching behaviour.</p>
<p>This case is expected and a result of NGINX's a first match policy for paths that use the regular expression <a href="https://nginx.org/en/docs/http/ngx_http_core_module.html#location">location modifier</a>. For more information about how a path is chosen, please read the following article: <a href="https://www.digitalocean.com/community/tutorials/understanding-nginx-server-and-location-block-selection-algorithms">"Understanding Nginx Server and Location Block Selection Algorithms"</a>.</p> <p>This case is expected and a result of NGINX's a first match policy for paths that use the regular expression <a href="https://nginx.org/en/docs/http/ngx_http_core_module.html#location">location modifier</a>. For more information about how a path is chosen, please read the following article: <a href="https://www.digitalocean.com/community/tutorials/understanding-nginx-server-and-location-block-selection-algorithms">"Understanding Nginx Server and Location Block Selection Algorithms"</a>.</p>
<h3 id="example_1">Example<a class="headerlink" href="#example_1" title="Permanent link"></a></h3> <h3 id="example_1">Example<a class="headerlink" href="#example_1" title="Permanent link"></a></h3>
<p>Let the following ingress be defined:</p> <p>Let the following ingress be defined:</p>
<div class="codehilite"><pre><span></span><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">networking.k8s.io/v1beta1</span> <div class="codehilite"><pre><span></span><code><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">networking.k8s.io/v1beta1</span>
<span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Ingress</span> <span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Ingress</span>
<span class="nt">metadata</span><span class="p">:</span> <span class="nt">metadata</span><span class="p">:</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">test-ingress-3</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">test-ingress-3</span>
@ -1399,19 +1399,20 @@ location ~* &quot;^/foo/bar&quot; {
<span class="nt">backend</span><span class="p">:</span> <span class="nt">backend</span><span class="p">:</span>
<span class="nt">serviceName</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">test</span> <span class="nt">serviceName</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">test</span>
<span class="nt">servicePort</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">80</span> <span class="nt">servicePort</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">80</span>
</pre></div> </code></pre></div>
<p>The ingress controller would define the following location blocks (in this order) within the NGINX template for the <code class="codehilite">test.com</code> server:</p> <p>The ingress controller would define the following location blocks (in this order) within the NGINX template for the <code class="codehilite"><span class="err">test.com</span></code> server:</p>
<div class="codehilite"><pre><span></span>location ~* &quot;^/foo/bar/[A-Z0-9]{3}&quot; { <div class="codehilite"><pre><span></span><code><span class="k">location</span> <span class="o">~*</span> <span class="ss">&quot;^/foo/bar/[A-Z0-9]{3}&quot;</span> <span class="err">{</span>
... <span class="p">...</span>
} <span class="err">}</span>
location ~* &quot;^/foo/bar/bar&quot; { <span class="k">location</span> <span class="o">~*</span> <span class="ss">&quot;^/foo/bar/bar&quot;</span> <span class="err">{</span>
... <span class="p">...</span>
} <span class="err">}</span>
</pre></div> </code></pre></div>
<p>A request to <code class="codehilite"><span class="err">test.com/foo/bar/bar</span></code> would match the <code class="codehilite"><span class="err">^/foo/[A-Z0-9]{3}</span></code> location block instead of the longest EXACT matching path.</p>
<p>A request to <code class="codehilite">test.com/foo/bar/bar</code> would match the <code class="codehilite">^/foo/[A-Z0-9]{3}</code> location block instead of the longest EXACT matching path.</p>
@ -1469,9 +1470,9 @@ location ~* &quot;^/foo/bar/bar&quot; {
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1481,7 +1482,7 @@ location ~* &quot;^/foo/bar/bar&quot; {
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#miscellaneous" tabindex="1" class="md-skip"> <a href="#miscellaneous" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1279,32 +1279,32 @@
<h1 id="miscellaneous">Miscellaneous<a class="headerlink" href="#miscellaneous" title="Permanent link"></a></h1> <h1 id="miscellaneous">Miscellaneous<a class="headerlink" href="#miscellaneous" title="Permanent link"></a></h1>
<h2 id="source-ip-address">Source IP address<a class="headerlink" href="#source-ip-address" title="Permanent link"></a></h2> <h2 id="source-ip-address">Source IP address<a class="headerlink" href="#source-ip-address" title="Permanent link"></a></h2>
<p>By default NGINX uses the content of the header <code class="codehilite">X-Forwarded-For</code> as the source of truth to get information about the client IP address. This works without issues in L7 <strong>if we configure the setting <code class="codehilite">proxy-real-ip-cidr</code></strong> with the correct information of the IP/network address of trusted external load balancer.</p> <p>By default NGINX uses the content of the header <code class="codehilite"><span class="err">X-Forwarded-For</span></code> as the source of truth to get information about the client IP address. This works without issues in L7 <strong>if we configure the setting <code class="codehilite"><span class="err">proxy-real-ip-cidr</span></code></strong> with the correct information of the IP/network address of trusted external load balancer.</p>
<p>If the ingress controller is running in AWS we need to use the VPC IPv4 CIDR.</p> <p>If the ingress controller is running in AWS we need to use the VPC IPv4 CIDR.</p>
<p>Another option is to enable proxy protocol using <code class="codehilite">use-proxy-protocol: &quot;true&quot;</code>.</p> <p>Another option is to enable proxy protocol using <code class="codehilite"><span class="c">use-proxy-protocol: &quot;true&quot;</span></code>.</p>
<p>In this mode NGINX does not use the content of the header to get the source IP address of the connection.</p> <p>In this mode NGINX does not use the content of the header to get the source IP address of the connection.</p>
<h2 id="proxy-protocol">Proxy Protocol<a class="headerlink" href="#proxy-protocol" title="Permanent link"></a></h2> <h2 id="proxy-protocol">Proxy Protocol<a class="headerlink" href="#proxy-protocol" title="Permanent link"></a></h2>
<p>If you are using a L4 proxy to forward the traffic to the NGINX pods and terminate HTTP/HTTPS there, you will lose the remote endpoint's IP address. To prevent this you could use the <a href="http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt">Proxy Protocol</a> for forwarding traffic, this will send the connection details before forwarding the actual TCP connection itself.</p> <p>If you are using a L4 proxy to forward the traffic to the NGINX pods and terminate HTTP/HTTPS there, you will lose the remote endpoint's IP address. To prevent this you could use the <a href="http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt">Proxy Protocol</a> for forwarding traffic, this will send the connection details before forwarding the actual TCP connection itself.</p>
<p>Amongst others <a href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-proxy-protocol.html">ELBs in AWS</a> and <a href="http://www.haproxy.org/">HAProxy</a> support Proxy Protocol.</p> <p>Amongst others <a href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-proxy-protocol.html">ELBs in AWS</a> and <a href="http://www.haproxy.org/">HAProxy</a> support Proxy Protocol.</p>
<h2 id="websockets">Websockets<a class="headerlink" href="#websockets" title="Permanent link"></a></h2> <h2 id="websockets">Websockets<a class="headerlink" href="#websockets" title="Permanent link"></a></h2>
<p>Support for websockets is provided by NGINX out of the box. No special configuration required.</p> <p>Support for websockets is provided by NGINX out of the box. No special configuration required.</p>
<p>The only requirement to avoid the close of connections is the increase of the values of <code class="codehilite">proxy-read-timeout</code> and <code class="codehilite">proxy-send-timeout</code>.</p> <p>The only requirement to avoid the close of connections is the increase of the values of <code class="codehilite"><span class="err">proxy-read-timeout</span></code> and <code class="codehilite"><span class="err">proxy-send-timeout</span></code>.</p>
<p>The default value of this settings is <code class="codehilite">60 seconds</code>.</p> <p>The default value of this settings is <code class="codehilite"><span class="err">60 seconds</span></code>.</p>
<p>A more adequate value to support websockets is a value higher than one hour (<code class="codehilite">3600</code>).</p> <p>A more adequate value to support websockets is a value higher than one hour (<code class="codehilite"><span class="err">3600</span></code>).</p>
<div class="admonition important"> <div class="admonition important">
<p class="admonition-title">Important</p> <p class="admonition-title">Important</p>
<p>If the NGINX ingress controller is exposed with a service <code class="codehilite">type=LoadBalancer</code> make sure the protocol between the loadbalancer and NGINX is TCP.</p> <p>If the NGINX ingress controller is exposed with a service <code class="codehilite"><span class="err">type=LoadBalancer</span></code> make sure the protocol between the loadbalancer and NGINX is TCP.</p>
</div> </div>
<h2 id="optimizing-tls-time-to-first-byte-tttfb">Optimizing TLS Time To First Byte (TTTFB)<a class="headerlink" href="#optimizing-tls-time-to-first-byte-tttfb" title="Permanent link"></a></h2> <h2 id="optimizing-tls-time-to-first-byte-tttfb">Optimizing TLS Time To First Byte (TTTFB)<a class="headerlink" href="#optimizing-tls-time-to-first-byte-tttfb" title="Permanent link"></a></h2>
<p>NGINX provides the configuration option <a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_buffer_size">ssl_buffer_size</a> to allow the optimization of the TLS record size.</p> <p>NGINX provides the configuration option <a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_buffer_size">ssl_buffer_size</a> to allow the optimization of the TLS record size.</p>
<p>This improves the <a href="https://www.igvita.com/2013/12/16/optimizing-nginx-tls-time-to-first-byte/">TLS Time To First Byte</a> (TTTFB). <p>This improves the <a href="https://www.igvita.com/2013/12/16/optimizing-nginx-tls-time-to-first-byte/">TLS Time To First Byte</a> (TTTFB).
The default value in the Ingress controller is <code class="codehilite">4k</code> (NGINX default is <code class="codehilite">16k</code>).</p> The default value in the Ingress controller is <code class="codehilite"><span class="err">4k</span></code> (NGINX default is <code class="codehilite"><span class="err">16k</span></code>).</p>
<h2 id="retries-in-non-idempotent-methods">Retries in non-idempotent methods<a class="headerlink" href="#retries-in-non-idempotent-methods" title="Permanent link"></a></h2> <h2 id="retries-in-non-idempotent-methods">Retries in non-idempotent methods<a class="headerlink" href="#retries-in-non-idempotent-methods" title="Permanent link"></a></h2>
<p>Since 1.9.13 NGINX will not retry non-idempotent requests (POST, LOCK, PATCH) in case of an error. <p>Since 1.9.13 NGINX will not retry non-idempotent requests (POST, LOCK, PATCH) in case of an error.
The previous behavior can be restored using <code class="codehilite">retry-non-idempotent=true</code> in the configuration ConfigMap.</p> The previous behavior can be restored using <code class="codehilite"><span class="err">retry-non-idempotent=true</span></code> in the configuration ConfigMap.</p>
<h2 id="limitations">Limitations<a class="headerlink" href="#limitations" title="Permanent link"></a></h2> <h2 id="limitations">Limitations<a class="headerlink" href="#limitations" title="Permanent link"></a></h2>
<ul> <ul>
<li>Ingress rules for TLS require the definition of the field <code class="codehilite">host</code></li> <li>Ingress rules for TLS require the definition of the field <code class="codehilite"><span class="err">host</span></code></li>
</ul> </ul>
<h2 id="why-endpoints-and-not-services">Why endpoints and not services<a class="headerlink" href="#why-endpoints-and-not-services" title="Permanent link"></a></h2> <h2 id="why-endpoints-and-not-services">Why endpoints and not services<a class="headerlink" href="#why-endpoints-and-not-services" title="Permanent link"></a></h2>
<p>The NGINX ingress controller does not use <a href="http://kubernetes.io/docs/user-guide/services">Services</a> to route traffic to the pods. Instead it uses the Endpoints API in order to bypass <a href="http://kubernetes.io/docs/admin/kube-proxy/">kube-proxy</a> to allow NGINX features like session affinity and custom load balancing algorithms. It also removes some overhead, such as conntrack entries for iptables DNAT.</p> <p>The NGINX ingress controller does not use <a href="http://kubernetes.io/docs/user-guide/services">Services</a> to route traffic to the pods. Instead it uses the Endpoints API in order to bypass <a href="http://kubernetes.io/docs/admin/kube-proxy/">kube-proxy</a> to allow NGINX features like session affinity and custom load balancing algorithms. It also removes some overhead, such as conntrack entries for iptables DNAT.</p>
@ -1317,6 +1317,7 @@ The previous behavior can be restored using <code class="codehilite">retry-non-i
</article> </article>
</div> </div>
</div> </div>
@ -1365,9 +1366,9 @@ The previous behavior can be restored using <code class="codehilite">retry-non-i
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1377,7 +1378,7 @@ The previous behavior can be restored using <code class="codehilite">retry-non-i
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#prometheus-and-grafana-installation" tabindex="1" class="md-skip"> <a href="#prometheus-and-grafana-installation" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1251,7 +1251,7 @@
<p>This tutorial will show you how to install <a href="https://prometheus.io/">Prometheus</a> and <a href="https://grafana.com/">Grafana</a> for scraping the metrics of the NGINX Ingress controller.</p> <p>This tutorial will show you how to install <a href="https://prometheus.io/">Prometheus</a> and <a href="https://grafana.com/">Grafana</a> for scraping the metrics of the NGINX Ingress controller.</p>
<div class="admonition important"> <div class="admonition important">
<p class="admonition-title">Important</p> <p class="admonition-title">Important</p>
<p>This example uses <code class="codehilite">emptyDir</code> volumes for Prometheus and Grafana. This means once the pod gets terminated you will lose all the data.</p> <p>This example uses <code class="codehilite"><span class="err">emptyDir</span></code> volumes for Prometheus and Grafana. This means once the pod gets terminated you will lose all the data.</p>
</div> </div>
<h2 id="before-you-begin">Before You Begin<a class="headerlink" href="#before-you-begin" title="Permanent link"></a></h2> <h2 id="before-you-begin">Before You Begin<a class="headerlink" href="#before-you-begin" title="Permanent link"></a></h2>
<p>The NGINX Ingress controller should already be deployed according to the deployment instructions <a href="../../deploy/">here</a>.</p> <p>The NGINX Ingress controller should already be deployed according to the deployment instructions <a href="../../deploy/">here</a>.</p>
@ -1260,45 +1260,45 @@
<p>The Prometheus server must be configured so that it can discover endpoints of services. If a Prometheus server is already running in the cluster and if it is configured in a way that it can find the ingress controller pods, no extra configuration is needed.</p> <p>The Prometheus server must be configured so that it can discover endpoints of services. If a Prometheus server is already running in the cluster and if it is configured in a way that it can find the ingress controller pods, no extra configuration is needed.</p>
<p>If there is no existing Prometheus server running, the rest of this tutorial will guide you through the steps needed to deploy a properly configured Prometheus server.</p> <p>If there is no existing Prometheus server running, the rest of this tutorial will guide you through the steps needed to deploy a properly configured Prometheus server.</p>
<p>Running the following command deploys prometheus in Kubernetes:</p> <p>Running the following command deploys prometheus in Kubernetes:</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl apply --kustomize github.com/kubernetes/ingress-nginx/deploy/prometheus/</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl apply --kustomize github.com/kubernetes/ingress-nginx/deploy/prometheus/</span>
</pre></div> </code></pre></div>
<h3 id="prometheus-dashboard">Prometheus Dashboard<a class="headerlink" href="#prometheus-dashboard" title="Permanent link"></a></h3> <h3 id="prometheus-dashboard">Prometheus Dashboard<a class="headerlink" href="#prometheus-dashboard" title="Permanent link"></a></h3>
<p>Open Prometheus dashboard in a web browser:</p> <p>Open Prometheus dashboard in a web browser:</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl get svc -n ingress-nginx</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl get svc -n ingress-nginx</span>
<span class="go">NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE</span> <span class="go">NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE</span>
<span class="go">default-http-backend ClusterIP 10.103.59.201 &lt;none&gt; 80/TCP 3d</span> <span class="go">default-http-backend ClusterIP 10.103.59.201 &lt;none&gt; 80/TCP 3d</span>
<span class="go">ingress-nginx NodePort 10.97.44.72 &lt;none&gt; 80:30100/TCP,443:30154/TCP,10254:32049/TCP 5h</span> <span class="go">ingress-nginx NodePort 10.97.44.72 &lt;none&gt; 80:30100/TCP,443:30154/TCP,10254:32049/TCP 5h</span>
<span class="go">prometheus-server NodePort 10.98.233.86 &lt;none&gt; 9090:32630/TCP 1m</span> <span class="go">prometheus-server NodePort 10.98.233.86 &lt;none&gt; 9090:32630/TCP 1m</span>
</pre></div> </code></pre></div>
<p>Obtain the IP address of the nodes in the running cluster:</p> <p>Obtain the IP address of the nodes in the running cluster:</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl get nodes -o wide</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl get nodes -o wide</span>
</pre></div> </code></pre></div>
<p>In some cases where the node only have internal IP addresses we need to execute:</p> <p>In some cases where the node only have internal IP addresses we need to execute:</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl get nodes --selector=kubernetes.io/role!=master -o jsonpath={.items[*].status.addresses[?\(@.type==\&quot;InternalIP\&quot;\)].address}</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl get nodes --selector=kubernetes.io/role!=master -o jsonpath={.items[*].status.addresses[?\(@.type==\&quot;InternalIP\&quot;\)].address}</span>
<span class="go">10.192.0.2 10.192.0.3 10.192.0.4</span> <span class="go">10.192.0.2 10.192.0.3 10.192.0.4</span>
</pre></div> </code></pre></div>
<p>Open your browser and visit the following URL: <em>http://{node IP address}:{prometheus-svc-nodeport}</em> to load the Prometheus Dashboard.</p> <p>Open your browser and visit the following URL: <em>http://{node IP address}:{prometheus-svc-nodeport}</em> to load the Prometheus Dashboard.</p>
<p>According to the above example, this URL will be http://10.192.0.3:32630</p> <p>According to the above example, this URL will be http://10.192.0.3:32630</p>
<p><img alt="Dashboard" src="../../images/prometheus-dashboard.png" /></p> <p><img alt="Dashboard" src="../../images/prometheus-dashboard.png" /></p>
<h3 id="grafana">Grafana<a class="headerlink" href="#grafana" title="Permanent link"></a></h3> <h3 id="grafana">Grafana<a class="headerlink" href="#grafana" title="Permanent link"></a></h3>
<div class="codehilite"><pre><span></span><span class="go">kubectl apply --kustomize github.com/kubernetes/ingress-nginx/deploy/grafana/</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl apply --kustomize github.com/kubernetes/ingress-nginx/deploy/grafana/</span>
</pre></div> </code></pre></div>
<div class="codehilite"><pre><span></span><span class="go">kubectl get svc -n ingress-nginx</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl get svc -n ingress-nginx</span>
<span class="go">NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE</span> <span class="go">NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE</span>
<span class="go">default-http-backend ClusterIP 10.103.59.201 &lt;none&gt; 80/TCP 3d</span> <span class="go">default-http-backend ClusterIP 10.103.59.201 &lt;none&gt; 80/TCP 3d</span>
<span class="go">ingress-nginx NodePort 10.97.44.72 &lt;none&gt; 80:30100/TCP,443:30154/TCP,10254:32049/TCP 5h</span> <span class="go">ingress-nginx NodePort 10.97.44.72 &lt;none&gt; 80:30100/TCP,443:30154/TCP,10254:32049/TCP 5h</span>
<span class="go">prometheus-server NodePort 10.98.233.86 &lt;none&gt; 9090:32630/TCP 10m</span> <span class="go">prometheus-server NodePort 10.98.233.86 &lt;none&gt; 9090:32630/TCP 10m</span>
<span class="go">grafana NodePort 10.98.233.87 &lt;none&gt; 3000:31086/TCP 10m</span> <span class="go">grafana NodePort 10.98.233.87 &lt;none&gt; 3000:31086/TCP 10m</span>
</pre></div> </code></pre></div>
<p>Open your browser and visit the following URL: <em>http://{node IP address}:{grafana-svc-nodeport}</em> to load the Grafana Dashboard. <p>Open your browser and visit the following URL: <em>http://{node IP address}:{grafana-svc-nodeport}</em> to load the Grafana Dashboard.
According to the above example, this URL will be http://10.192.0.3:31086</p> According to the above example, this URL will be http://10.192.0.3:31086</p>
<p>The username and password is <code class="codehilite">admin</code></p> <p>The username and password is <code class="codehilite"><span class="err">admin</span></code></p>
<p>After the login you can import the Grafana dashboard from <em>https://github.com/kubernetes/ingress-nginx/tree/master/deploy/grafana/dashboards</em></p> <p>After the login you can import the Grafana dashboard from <em>https://github.com/kubernetes/ingress-nginx/tree/master/deploy/grafana/dashboards</em></p>
<p><img alt="Dashboard" src="../../images/grafana.png" /></p> <p><img alt="Dashboard" src="../../images/grafana.png" /></p>
@ -1310,6 +1310,7 @@ According to the above example, this URL will be http://10.192.0.3:31086</p>
</article> </article>
</div> </div>
</div> </div>
@ -1358,9 +1359,9 @@ According to the above example, this URL will be http://10.192.0.3:31086</p>
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1370,7 +1371,7 @@ According to the above example, this URL will be http://10.192.0.3:31086</p>
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#multiple-ingress-controllers" tabindex="1" class="md-skip"> <a href="#multiple-ingress-controllers" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1195,20 +1195,20 @@
<h1 id="multiple-ingress-controllers">Multiple Ingress controllers<a class="headerlink" href="#multiple-ingress-controllers" title="Permanent link"></a></h1> <h1 id="multiple-ingress-controllers">Multiple Ingress controllers<a class="headerlink" href="#multiple-ingress-controllers" title="Permanent link"></a></h1>
<p>If you're running multiple ingress controllers, or running on a cloud provider that natively handles ingress such as GKE, <p>If you're running multiple ingress controllers, or running on a cloud provider that natively handles ingress such as GKE,
you need to specify the annotation <code class="codehilite">kubernetes.io/ingress.class: &quot;nginx&quot;</code> in all ingresses that you would like the ingress-nginx controller to claim.</p> you need to specify the annotation <code class="codehilite"><span class="err">kubernetes.io/ingress.class: &quot;nginx&quot;</span></code> in all ingresses that you would like the ingress-nginx controller to claim.</p>
<p>For instance,</p> <p>For instance,</p>
<div class="codehilite"><pre><span></span><span class="nt">metadata</span><span class="p">:</span> <div class="codehilite"><pre><span></span><code><span class="nt">metadata</span><span class="p">:</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">foo</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">foo</span>
<span class="nt">annotations</span><span class="p">:</span> <span class="nt">annotations</span><span class="p">:</span>
<span class="nt">kubernetes.io/ingress.class</span><span class="p">:</span> <span class="s">&quot;gce&quot;</span> <span class="nt">kubernetes.io/ingress.class</span><span class="p">:</span> <span class="s">&quot;gce&quot;</span>
</pre></div> </code></pre></div>
<p>will target the GCE controller, forcing the nginx controller to ignore it, while an annotation like</p> <p>will target the GCE controller, forcing the nginx controller to ignore it, while an annotation like</p>
<div class="codehilite"><pre><span></span><span class="nt">metadata</span><span class="p">:</span> <div class="codehilite"><pre><span></span><code><span class="nt">metadata</span><span class="p">:</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">foo</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">foo</span>
<span class="nt">annotations</span><span class="p">:</span> <span class="nt">annotations</span><span class="p">:</span>
<span class="nt">kubernetes.io/ingress.class</span><span class="p">:</span> <span class="s">&quot;nginx&quot;</span> <span class="nt">kubernetes.io/ingress.class</span><span class="p">:</span> <span class="s">&quot;nginx&quot;</span>
</pre></div> </code></pre></div>
<p>will target the nginx controller, forcing the GCE controller to ignore it.</p> <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. <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.
@ -1216,9 +1216,9 @@ If you are only running a single NGINX ingress controller, this can be achieved
<p>Do this if you wish to use one of the other Ingress controllers at the same time as the NGINX controller.</p> <p>Do this if you wish to use one of the other Ingress controllers at the same time as the NGINX controller.</p>
<h2 id="multiple-ingress-nginx-controllers">Multiple ingress-nginx controllers<a class="headerlink" href="#multiple-ingress-nginx-controllers" title="Permanent link"></a></h2> <h2 id="multiple-ingress-nginx-controllers">Multiple ingress-nginx controllers<a class="headerlink" href="#multiple-ingress-nginx-controllers" title="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). <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 class="codehilite">--ingress-class</code> must be changed to a value unique for the cluster within the definition of the replication controller. To do this, the option <code class="codehilite"><span class="err">--ingress-class</span></code> must be changed to a value unique for the cluster within the definition of the replication controller.
Here is a partial example:</p> Here is a partial example:</p>
<div class="codehilite"><pre><span></span><span class="nt">spec</span><span class="p">:</span> <div class="codehilite"><pre><span></span><code><span class="nt">spec</span><span class="p">:</span>
<span class="nt">template</span><span class="p">:</span> <span class="nt">template</span><span class="p">:</span>
<span class="nt">spec</span><span class="p">:</span> <span class="nt">spec</span><span class="p">:</span>
<span class="nt">containers</span><span class="p">:</span> <span class="nt">containers</span><span class="p">:</span>
@ -1228,14 +1228,14 @@ Here is a partial example:</p>
<span class="p p-Indicator">-</span> <span class="s">&#39;--election-id=ingress-controller-leader-internal&#39;</span> <span class="p p-Indicator">-</span> <span class="s">&#39;--election-id=ingress-controller-leader-internal&#39;</span>
<span class="p p-Indicator">-</span> <span class="s">&#39;--ingress-class=nginx-internal&#39;</span> <span class="p p-Indicator">-</span> <span class="s">&#39;--ingress-class=nginx-internal&#39;</span>
<span class="p p-Indicator">-</span> <span class="s">&#39;--configmap=ingress/nginx-ingress-internal-controller&#39;</span> <span class="p p-Indicator">-</span> <span class="s">&#39;--configmap=ingress/nginx-ingress-internal-controller&#39;</span>
</pre></div> </code></pre></div>
<div class="admonition important"> <div class="admonition important">
<p class="admonition-title">Important</p> <p class="admonition-title">Important</p>
<p>Deploying multiple Ingress controllers, of different types (e.g., <code class="codehilite">ingress-nginx</code> &amp; <code class="codehilite">gce</code>), and not specifying a class annotation will <p>Deploying multiple Ingress controllers, of different types (e.g., <code class="codehilite"><span class="err">ingress-nginx</span></code> &amp; <code class="codehilite"><span class="err">gce</span></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> 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 <p>When running multiple ingress-nginx controllers, it will only process an unset class annotation if one of the controllers uses the default
<code class="codehilite">--ingress-class</code> value (see <code class="codehilite">IsValid</code> method in <code class="codehilite">internal/ingress/annotations/class/main.go</code>), otherwise the class annotation become required.</p> <code class="codehilite"><span class="err">--ingress-class</span></code> value (see <code class="codehilite"><span class="err">IsValid</span></code> method in <code class="codehilite"><span class="err">internal/ingress/annotations/class/main.go</span></code>), otherwise the class annotation become required.</p>
</div> </div>
@ -1246,6 +1246,7 @@ result in both or all controllers fighting to satisfy the Ingress, and all of th
</article> </article>
</div> </div>
</div> </div>
@ -1294,9 +1295,9 @@ result in both or all controllers fighting to satisfy the Ingress, and all of th
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1306,7 +1307,7 @@ result in both or all controllers fighting to satisfy the Ingress, and all of th
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#annotations" tabindex="1" class="md-skip"> <a href="#annotations" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1965,13 +1965,13 @@
<p class="admonition-title">Tip</p> <p class="admonition-title">Tip</p>
<p>Annotation keys and values can only be strings. <p>Annotation keys and values can only be strings.
Other types, such as boolean or numeric values must be quoted, Other types, such as boolean or numeric values must be quoted,
i.e. <code class="codehilite">&quot;true&quot;</code>, <code class="codehilite">&quot;false&quot;</code>, <code class="codehilite">&quot;100&quot;</code>.</p> i.e. <code class="codehilite"><span class="err">&quot;true&quot;</span></code>, <code class="codehilite"><span class="err">&quot;false&quot;</span></code>, <code class="codehilite"><span class="err">&quot;100&quot;</span></code>.</p>
</div> </div>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
<p>The annotation prefix can be changed using the <p>The annotation prefix can be changed using the
<a href="../../cli-arguments/"><code class="codehilite">--annotations-prefix</code> command line argument</a>, <a href="../../cli-arguments/"><code class="codehilite"><span class="err">--annotations-prefix</span></code> command line argument</a>,
but the default is <code class="codehilite">nginx.ingress.kubernetes.io</code>, as described in the but the default is <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io</span></code>, as described in the
table below.</p> table below.</p>
</div> </div>
<table> <table>
@ -2405,71 +2405,71 @@ table below.</p>
</tbody> </tbody>
</table> </table>
<h3 id="canary">Canary<a class="headerlink" href="#canary" title="Permanent link"></a></h3> <h3 id="canary">Canary<a class="headerlink" href="#canary" title="Permanent link"></a></h3>
<p>In some cases, you may want to "canary" a new set of changes by sending a small number of requests to a different service than the production service. The canary annotation enables the Ingress spec to act as an alternative service for requests to route to depending on the rules applied. The following annotations to configure canary can be enabled after <code class="codehilite">nginx.ingress.kubernetes.io/canary: &quot;true&quot;</code> is set:</p> <p>In some cases, you may want to "canary" a new set of changes by sending a small number of requests to a different service than the production service. The canary annotation enables the Ingress spec to act as an alternative service for requests to route to depending on the rules applied. The following annotations to configure canary can be enabled after <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/canary: &quot;true&quot;</span></code> is set:</p>
<ul> <ul>
<li> <li>
<p><code class="codehilite">nginx.ingress.kubernetes.io/canary-by-header</code>: The header to use for notifying the Ingress to route the request to the service specified in the Canary Ingress. When the request header is set to <code class="codehilite">always</code>, it will be routed to the canary. When the header is set to <code class="codehilite">never</code>, it will never be routed to the canary. For any other value, the header will be ignored and the request compared against the other canary rules by precedence.</p> <p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/canary-by-header</span></code>: The header to use for notifying the Ingress to route the request to the service specified in the Canary Ingress. When the request header is set to <code class="codehilite"><span class="err">always</span></code>, it will be routed to the canary. When the header is set to <code class="codehilite"><span class="err">never</span></code>, it will never be routed to the canary. For any other value, the header will be ignored and the request compared against the other canary rules by precedence.</p>
</li> </li>
<li> <li>
<p><code class="codehilite">nginx.ingress.kubernetes.io/canary-by-header-value</code>: The header value to match for notifying the Ingress to route the request to the service specified in the Canary Ingress. When the request header is set to this value, it will be routed to the canary. For any other header value, the header will be ignored and the request compared against the other canary rules by precedence. This annotation has to be used together with . The annotation is an extension of the <code class="codehilite">nginx.ingress.kubernetes.io/canary-by-header</code> to allow customizing the header value instead of using hardcoded values. It doesn't have any effect if the <code class="codehilite">nginx.ingress.kubernetes.io/canary-by-header</code> annotation is not defined.</p> <p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/canary-by-header-value</span></code>: The header value to match for notifying the Ingress to route the request to the service specified in the Canary Ingress. When the request header is set to this value, it will be routed to the canary. For any other header value, the header will be ignored and the request compared against the other canary rules by precedence. This annotation has to be used together with . The annotation is an extension of the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/canary-by-header</span></code> to allow customizing the header value instead of using hardcoded values. It doesn't have any effect if the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/canary-by-header</span></code> annotation is not defined.</p>
</li> </li>
<li> <li>
<p><code class="codehilite">nginx.ingress.kubernetes.io/canary-by-cookie</code>: The cookie to use for notifying the Ingress to route the request to the service specified in the Canary Ingress. When the cookie value is set to <code class="codehilite">always</code>, it will be routed to the canary. When the cookie is set to <code class="codehilite">never</code>, it will never be routed to the canary. For any other value, the cookie will be ignored and the request compared against the other canary rules by precedence.</p> <p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/canary-by-cookie</span></code>: The cookie to use for notifying the Ingress to route the request to the service specified in the Canary Ingress. When the cookie value is set to <code class="codehilite"><span class="err">always</span></code>, it will be routed to the canary. When the cookie is set to <code class="codehilite"><span class="err">never</span></code>, it will never be routed to the canary. For any other value, the cookie will be ignored and the request compared against the other canary rules by precedence.</p>
</li> </li>
<li> <li>
<p><code class="codehilite">nginx.ingress.kubernetes.io/canary-weight</code>: The integer based (0 - 100) percent of random requests that should be routed to the service specified in the canary Ingress. A weight of 0 implies that no requests will be sent to the service in the Canary ingress by this canary rule. A weight of 100 means implies all requests will be sent to the alternative service specified in the Ingress.</p> <p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/canary-weight</span></code>: The integer based (0 - 100) percent of random requests that should be routed to the service specified in the canary Ingress. A weight of 0 implies that no requests will be sent to the service in the Canary ingress by this canary rule. A weight of 100 means implies all requests will be sent to the alternative service specified in the Ingress.</p>
</li> </li>
</ul> </ul>
<p>Canary rules are evaluated in order of precedence. Precedence is as follows: <p>Canary rules are evaluated in order of precedence. Precedence is as follows:
<code class="codehilite">canary-by-header -&gt; canary-by-cookie -&gt; canary-weight</code></p> <code class="codehilite"><span class="err">canary-by-header -&gt; canary-by-cookie -&gt; canary-weight</span></code></p>
<p><strong>Note</strong> that when you mark an ingress as canary, then all the other non-canary annotations will be ignored (inherited from the corresponding main ingress) except <code class="codehilite">nginx.ingress.kubernetes.io/load-balance</code> and <code class="codehilite">nginx.ingress.kubernetes.io/upstream-hash-by</code>.</p> <p><strong>Note</strong> that when you mark an ingress as canary, then all the other non-canary annotations will be ignored (inherited from the corresponding main ingress) except <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/load-balance</span></code> and <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/upstream-hash-by</span></code>.</p>
<p><strong>Known Limitations</strong></p> <p><strong>Known Limitations</strong></p>
<p>Currently a maximum of one canary ingress can be applied per Ingress rule.</p> <p>Currently a maximum of one canary ingress can be applied per Ingress rule.</p>
<h3 id="rewrite">Rewrite<a class="headerlink" href="#rewrite" title="Permanent link"></a></h3> <h3 id="rewrite">Rewrite<a class="headerlink" href="#rewrite" title="Permanent link"></a></h3>
<p>In some scenarios the exposed URL in the backend service differs from the specified path in the Ingress rule. Without a rewrite any request will return 404. <p>In some scenarios the exposed URL in the backend service differs from the specified path in the Ingress rule. Without a rewrite any request will return 404.
Set the annotation <code class="codehilite">nginx.ingress.kubernetes.io/rewrite-target</code> to the path expected by the service.</p> Set the annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/rewrite-target</span></code> to the path expected by the service.</p>
<p>If the Application Root is exposed in a different path and needs to be redirected, set the annotation <code class="codehilite">nginx.ingress.kubernetes.io/app-root</code> to redirect requests for <code class="codehilite">/</code>.</p> <p>If the Application Root is exposed in a different path and needs to be redirected, set the annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/app-root</span></code> to redirect requests for <code class="codehilite"><span class="err">/</span></code>.</p>
<div class="admonition example"> <div class="admonition example">
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<p>Please check the <a href="../../../examples/rewrite/">rewrite</a> example.</p> <p>Please check the <a href="../../../examples/rewrite/">rewrite</a> example.</p>
</div> </div>
<h3 id="session-affinity">Session Affinity<a class="headerlink" href="#session-affinity" title="Permanent link"></a></h3> <h3 id="session-affinity">Session Affinity<a class="headerlink" href="#session-affinity" title="Permanent link"></a></h3>
<p>The annotation <code class="codehilite">nginx.ingress.kubernetes.io/affinity</code> enables and sets the affinity type in all Upstreams of an Ingress. This way, a request will always be directed to the same upstream server. <p>The annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/affinity</span></code> enables and sets the affinity type in all Upstreams of an Ingress. This way, a request will always be directed to the same upstream server.
The only affinity type available for NGINX is <code class="codehilite">cookie</code>.</p> The only affinity type available for NGINX is <code class="codehilite"><span class="err">cookie</span></code>.</p>
<p>The annotation <code class="codehilite">nginx.ingress.kubernetes.io/affinity-mode</code> defines the stickyness of a session. Setting this to <code class="codehilite">balanced</code> (default) will redistribute some sessions if a deployment gets scaled up, therefore rebalancing the load on the servers. Setting this to <code class="codehilite">persistent</code> will not rebalance sessions to new servers, therefore providing maximum stickyness.</p> <p>The annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/affinity-mode</span></code> defines the stickyness of a session. Setting this to <code class="codehilite"><span class="err">balanced</span></code> (default) will redistribute some sessions if a deployment gets scaled up, therefore rebalancing the load on the servers. Setting this to <code class="codehilite"><span class="err">persistent</span></code> will not rebalance sessions to new servers, therefore providing maximum stickyness.</p>
<div class="admonition attention"> <div class="admonition attention">
<p class="admonition-title">Attention</p> <p class="admonition-title">Attention</p>
<p>If more than one Ingress is defined for a host and at least one Ingress uses <code class="codehilite">nginx.ingress.kubernetes.io/affinity: cookie</code>, then only paths on the Ingress using <code class="codehilite">nginx.ingress.kubernetes.io/affinity</code> will use session cookie affinity. All paths defined on other Ingresses for the host will be load balanced through the random selection of a backend server.</p> <p>If more than one Ingress is defined for a host and at least one Ingress uses <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/affinity: cookie</span></code>, then only paths on the Ingress using <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/affinity</span></code> will use session cookie affinity. All paths defined on other Ingresses for the host will be load balanced through the random selection of a backend server.</p>
</div> </div>
<div class="admonition example"> <div class="admonition example">
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<p>Please check the <a href="../../../examples/affinity/cookie/">affinity</a> example.</p> <p>Please check the <a href="../../../examples/affinity/cookie/">affinity</a> example.</p>
</div> </div>
<h4 id="cookie-affinity">Cookie affinity<a class="headerlink" href="#cookie-affinity" title="Permanent link"></a></h4> <h4 id="cookie-affinity">Cookie affinity<a class="headerlink" href="#cookie-affinity" title="Permanent link"></a></h4>
<p>If you use the <code class="codehilite">cookie</code> affinity type you can also specify the name of the cookie that will be used to route the requests with the annotation <code class="codehilite">nginx.ingress.kubernetes.io/session-cookie-name</code>. The default is to create a cookie named 'INGRESSCOOKIE'.</p> <p>If you use the <code class="codehilite"><span class="err">cookie</span></code> affinity type you can also specify the name of the cookie that will be used to route the requests with the annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/session-cookie-name</span></code>. The default is to create a cookie named 'INGRESSCOOKIE'.</p>
<p>The NGINX annotation <code class="codehilite">nginx.ingress.kubernetes.io/session-cookie-path</code> defines the path that will be set on the cookie. This is optional unless the annotation <code class="codehilite">nginx.ingress.kubernetes.io/use-regex</code> is set to true; Session cookie paths do not support regex.</p> <p>The NGINX annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/session-cookie-path</span></code> defines the path that will be set on the cookie. This is optional unless the annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/use-regex</span></code> is set to true; Session cookie paths do not support regex.</p>
<p>Use <code class="codehilite">nginx.ingress.kubernetes.io/session-cookie-samesite</code> to apply a <code class="codehilite">SameSite</code> attribute to the sticky cookie. Browser accepted values are <code class="codehilite">None</code>, <code class="codehilite">Lax</code>, and <code class="codehilite">Strict</code>. Some older browsers reject cookies with the more-recently-defined <code class="codehilite">SameSite=None</code>. To omit <code class="codehilite">SameSite=None</code> from these older browsers, add the annotation <code class="codehilite">nginx.ingress.kubernetes.io/session-cookie-conditional-samesite-none: &quot;true&quot;</code>.</p> <p>Use <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/session-cookie-samesite</span></code> to apply a <code class="codehilite"><span class="err">SameSite</span></code> attribute to the sticky cookie. Browser accepted values are <code class="codehilite"><span class="err">None</span></code>, <code class="codehilite"><span class="err">Lax</span></code>, and <code class="codehilite"><span class="err">Strict</span></code>. Some older browsers reject cookies with the more-recently-defined <code class="codehilite"><span class="err">SameSite=None</span></code>. To omit <code class="codehilite"><span class="err">SameSite=None</span></code> from these older browsers, add the annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/session-cookie-conditional-samesite-none: &quot;true&quot;</span></code>.</p>
<h3 id="authentication">Authentication<a class="headerlink" href="#authentication" title="Permanent link"></a></h3> <h3 id="authentication">Authentication<a class="headerlink" href="#authentication" title="Permanent link"></a></h3>
<p>Is possible to add authentication adding additional annotations in the Ingress rule. The source of the authentication is a secret that contains usernames and passwords.</p> <p>Is possible to add authentication adding additional annotations in the Ingress rule. The source of the authentication is a secret that contains usernames and passwords.</p>
<p>The annotations are: <p>The annotations are:
<div class="codehilite"><pre><span></span>nginx.ingress.kubernetes.io/auth-type: [basic|digest] <div class="codehilite"><pre><span></span><code><span class="err">nginx.ingress.kubernetes.io/auth-type: [basic|digest]</span>
</pre></div></p> </code></pre></div></p>
<p>Indicates the <a href="https://tools.ietf.org/html/rfc2617">HTTP Authentication Type: Basic or Digest Access Authentication</a>.</p> <p>Indicates the <a href="https://tools.ietf.org/html/rfc2617">HTTP Authentication Type: Basic or Digest Access Authentication</a>.</p>
<div class="codehilite"><pre><span></span>nginx.ingress.kubernetes.io/auth-secret: secretName <div class="codehilite"><pre><span></span><code><span class="err">nginx.ingress.kubernetes.io/auth-secret: secretName</span>
</pre></div> </code></pre></div>
<p>The name of the Secret that contains the usernames and passwords which are granted access to the <code class="codehilite">path</code>s defined in the Ingress rules. <p>The name of the Secret that contains the usernames and passwords which are granted access to the <code class="codehilite"><span class="err">path</span></code>s defined in the Ingress rules.
This annotation also accepts the alternative form "namespace/secretName", in which case the Secret lookup is performed in the referenced namespace instead of the Ingress namespace.</p> This annotation also accepts the alternative form "namespace/secretName", in which case the Secret lookup is performed in the referenced namespace instead of the Ingress namespace.</p>
<div class="codehilite"><pre><span></span>nginx.ingress.kubernetes.io/auth-secret-type: [auth-file|auth-map] <div class="codehilite"><pre><span></span><code><span class="err">nginx.ingress.kubernetes.io/auth-secret-type: [auth-file|auth-map]</span>
</pre></div> </code></pre></div>
<p>The <code class="codehilite">auth-secret</code> can have two forms:</p> <p>The <code class="codehilite"><span class="err">auth-secret</span></code> can have two forms:</p>
<ul> <ul>
<li><code class="codehilite">auth-file</code> - default, an htpasswd file in the key <code class="codehilite">auth</code> within the secret</li> <li><code class="codehilite"><span class="err">auth-file</span></code> - default, an htpasswd file in the key <code class="codehilite"><span class="err">auth</span></code> within the secret</li>
<li><code class="codehilite">auth-map</code> - the keys of the secret are the usernames, and the values are the hashed passwords</li> <li><code class="codehilite"><span class="err">auth-map</span></code> - the keys of the secret are the usernames, and the values are the hashed passwords</li>
</ul> </ul>
<div class="codehilite"><pre><span></span>nginx.ingress.kubernetes.io/auth-realm: &quot;realm string&quot; <div class="codehilite"><pre><span></span><code><span class="err">nginx.ingress.kubernetes.io/auth-realm: &quot;realm string&quot;</span>
</pre></div> </code></pre></div>
<div class="admonition example"> <div class="admonition example">
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
@ -2479,30 +2479,30 @@ This annotation also accepts the alternative form "namespace/secretName", in whi
<p>NGINX supports load balancing by client-server mapping based on <a href="http://nginx.org/en/docs/http/ngx_http_upstream_module.html#hash">consistent hashing</a> for a given key. The key can contain text, variables or any combination thereof. This feature allows for request stickiness other than client IP or cookies. The <a href="http://www.last.fm/user/RJ/journal/2007/04/10/392555/">ketama</a> consistent hashing method will be used which ensures only a few keys would be remapped to different servers on upstream group changes.</p> <p>NGINX supports load balancing by client-server mapping based on <a href="http://nginx.org/en/docs/http/ngx_http_upstream_module.html#hash">consistent hashing</a> for a given key. The key can contain text, variables or any combination thereof. This feature allows for request stickiness other than client IP or cookies. The <a href="http://www.last.fm/user/RJ/journal/2007/04/10/392555/">ketama</a> consistent hashing method will be used which ensures only a few keys would be remapped to different servers on upstream group changes.</p>
<p>There is a special mode of upstream hashing called subset. In this mode, upstream servers are grouped into subsets, and stickiness works by mapping keys to a subset instead of individual upstream servers. Specific server is chosen uniformly at random from the selected sticky subset. It provides a balance between stickiness and load distribution.</p> <p>There is a special mode of upstream hashing called subset. In this mode, upstream servers are grouped into subsets, and stickiness works by mapping keys to a subset instead of individual upstream servers. Specific server is chosen uniformly at random from the selected sticky subset. It provides a balance between stickiness and load distribution.</p>
<p>To enable consistent hashing for a backend:</p> <p>To enable consistent hashing for a backend:</p>
<p><code class="codehilite">nginx.ingress.kubernetes.io/upstream-hash-by</code>: the nginx variable, text value or any combination thereof to use for consistent hashing. For example <code class="codehilite">nginx.ingress.kubernetes.io/upstream-hash-by: &quot;$request_uri&quot;</code> to consistently hash upstream requests by the current request URI.</p> <p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/upstream-hash-by</span></code>: the nginx variable, text value or any combination thereof to use for consistent hashing. For example <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/upstream-hash-by: &quot;$request_uri&quot;</span></code> to consistently hash upstream requests by the current request URI.</p>
<p>"subset" hashing can be enabled setting <code class="codehilite">nginx.ingress.kubernetes.io/upstream-hash-by-subset</code>: "true". This maps requests to subset of nodes instead of a single one. <code class="codehilite">upstream-hash-by-subset-size</code> determines the size of each subset (default 3).</p> <p>"subset" hashing can be enabled setting <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/upstream-hash-by-subset</span></code>: "true". This maps requests to subset of nodes instead of a single one. <code class="codehilite"><span class="err">upstream-hash-by-subset-size</span></code> determines the size of each subset (default 3).</p>
<p>Please check the <a href="../../../examples/chashsubset/deployment.yaml">chashsubset</a> example.</p> <p>Please check the <a href="../../../examples/chashsubset/deployment.yaml">chashsubset</a> example.</p>
<h3 id="custom-nginx-load-balancing">Custom NGINX load balancing<a class="headerlink" href="#custom-nginx-load-balancing" title="Permanent link"></a></h3> <h3 id="custom-nginx-load-balancing">Custom NGINX load balancing<a class="headerlink" href="#custom-nginx-load-balancing" title="Permanent link"></a></h3>
<p>This is similar to <a href="../configmap/#load-balance"><code class="codehilite">load-balance</code> in ConfigMap</a>, but configures load balancing algorithm per ingress.</p> <p>This is similar to <a href="../configmap/#load-balance"><code class="codehilite"><span class="err">load-balance</span></code> in ConfigMap</a>, but configures load balancing algorithm per ingress.</p>
<blockquote> <blockquote>
<p>Note that <code class="codehilite">nginx.ingress.kubernetes.io/upstream-hash-by</code> takes preference over this. If this and <code class="codehilite">nginx.ingress.kubernetes.io/upstream-hash-by</code> are not set then we fallback to using globally configured load balancing algorithm.</p> <p>Note that <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/upstream-hash-by</span></code> takes preference over this. If this and <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/upstream-hash-by</span></code> are not set then we fallback to using globally configured load balancing algorithm.</p>
</blockquote> </blockquote>
<h3 id="custom-nginx-upstream-vhost">Custom NGINX upstream vhost<a class="headerlink" href="#custom-nginx-upstream-vhost" title="Permanent link"></a></h3> <h3 id="custom-nginx-upstream-vhost">Custom NGINX upstream vhost<a class="headerlink" href="#custom-nginx-upstream-vhost" title="Permanent link"></a></h3>
<p>This configuration setting allows you to control the value for host in the following statement: <code class="codehilite">proxy_set_header Host $host</code>, which forms part of the location block. This is useful if you need to call the upstream server by something other than <code class="codehilite">$host</code>.</p> <p>This configuration setting allows you to control the value for host in the following statement: <code class="codehilite"><span class="err">proxy_set_header Host $host</span></code>, which forms part of the location block. This is useful if you need to call the upstream server by something other than <code class="codehilite"><span class="err">$host</span></code>.</p>
<h3 id="client-certificate-authentication">Client Certificate Authentication<a class="headerlink" href="#client-certificate-authentication" title="Permanent link"></a></h3> <h3 id="client-certificate-authentication">Client Certificate Authentication<a class="headerlink" href="#client-certificate-authentication" title="Permanent link"></a></h3>
<p>It is possible to enable Client Certificate Authentication using additional annotations in Ingress Rule.</p> <p>It is possible to enable Client Certificate Authentication using additional annotations in Ingress Rule.</p>
<p>The annotations are:</p> <p>The annotations are:</p>
<ul> <ul>
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-tls-secret: secretName</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-tls-secret: secretName</span></code>:
The name of the Secret that contains the full Certificate Authority chain <code class="codehilite">ca.crt</code> that is enabled to authenticate against this Ingress. The name of the Secret that contains the full Certificate Authority chain <code class="codehilite"><span class="err">ca.crt</span></code> that is enabled to authenticate against this Ingress.
This annotation also accepts the alternative form "namespace/secretName", in which case the Secret lookup is performed in the referenced namespace instead of the Ingress namespace.</li> This annotation also accepts the alternative form "namespace/secretName", in which case the Secret lookup is performed in the referenced namespace instead of the Ingress namespace.</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-tls-verify-depth</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-tls-verify-depth</span></code>:
The validation depth between the provided client certificate and the Certification Authority chain.</li> The validation depth between the provided client certificate and the Certification Authority chain.</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-tls-verify-client</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-tls-verify-client</span></code>:
Enables verification of client certificates.</li> Enables verification of client certificates.</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-tls-error-page</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-tls-error-page</span></code>:
The URL/Page that user should be redirected in case of a Certificate Authentication Error</li> The URL/Page that user should be redirected in case of a Certificate Authentication Error</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-tls-pass-certificate-to-upstream</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-tls-pass-certificate-to-upstream</span></code>:
Indicates if the received certificates should be passed or not to the upstream server. By default this is disabled.</li> Indicates if the received certificates should be passed or not to the upstream server. By default this is disabled.</li>
</ul> </ul>
<div class="admonition example"> <div class="admonition example">
@ -2518,78 +2518,78 @@ This annotation also accepts the alternative form "namespace/secretName", in whi
<h3 id="backend-certificate-authentication">Backend Certificate Authentication<a class="headerlink" href="#backend-certificate-authentication" title="Permanent link"></a></h3> <h3 id="backend-certificate-authentication">Backend Certificate Authentication<a class="headerlink" href="#backend-certificate-authentication" title="Permanent link"></a></h3>
<p>It is possible to authenticate to a proxied HTTPS backend with certificate using additional annotations in Ingress Rule.</p> <p>It is possible to authenticate to a proxied HTTPS backend with certificate using additional annotations in Ingress Rule.</p>
<ul> <ul>
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-ssl-secret: secretName</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-ssl-secret: secretName</span></code>:
Specifies a Secret with the certificate <code class="codehilite">tls.crt</code>, key <code class="codehilite">tls.key</code> in PEM format used for authentication to a proxied HTTPS server. It should also contain trusted CA certificates <code class="codehilite">ca.crt</code> in PEM format used to verify the certificate of the proxied HTTPS server. Specifies a Secret with the certificate <code class="codehilite"><span class="err">tls.crt</span></code>, key <code class="codehilite"><span class="err">tls.key</span></code> in PEM format used for authentication to a proxied HTTPS server. It should also contain trusted CA certificates <code class="codehilite"><span class="err">ca.crt</span></code> in PEM format used to verify the certificate of the proxied HTTPS server.
This annotation also accepts the alternative form "namespace/secretName", in which case the Secret lookup is performed in the referenced namespace instead of the Ingress namespace.</li> This annotation also accepts the alternative form "namespace/secretName", in which case the Secret lookup is performed in the referenced namespace instead of the Ingress namespace.</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-ssl-verify</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-ssl-verify</span></code>:
Enables or disables verification of the proxied HTTPS server certificate. (default: off)</li> Enables or disables verification of the proxied HTTPS server certificate. (default: off)</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-ssl-verify-depth</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-ssl-verify-depth</span></code>:
Sets the verification depth in the proxied HTTPS server certificates chain. (default: 1)</li> Sets the verification depth in the proxied HTTPS server certificates chain. (default: 1)</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-ssl-ciphers</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-ssl-ciphers</span></code>:
Specifies the enabled <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ssl_ciphers">ciphers</a> for requests to a proxied HTTPS server. The ciphers are specified in the format understood by the OpenSSL library.</li> Specifies the enabled <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ssl_ciphers">ciphers</a> for requests to a proxied HTTPS server. The ciphers are specified in the format understood by the OpenSSL library.</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-ssl-protocols</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-ssl-protocols</span></code>:
Enables the specified <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ssl_protocols">protocols</a> for requests to a proxied HTTPS server.</li> Enables the specified <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ssl_protocols">protocols</a> for requests to a proxied HTTPS server.</li>
</ul> </ul>
<h3 id="configuration-snippet">Configuration snippet<a class="headerlink" href="#configuration-snippet" title="Permanent link"></a></h3> <h3 id="configuration-snippet">Configuration snippet<a class="headerlink" href="#configuration-snippet" title="Permanent link"></a></h3>
<p>Using this annotation you can add additional configuration to the NGINX location. For example:</p> <p>Using this annotation you can add additional configuration to the NGINX location. For example:</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/configuration-snippet</span><span class="p">:</span> <span class="p p-Indicator">|</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/configuration-snippet</span><span class="p">:</span> <span class="p p-Indicator">|</span>
<span class="no">more_set_headers &quot;Request-Id: $req_id&quot;;</span> <span class="no">more_set_headers &quot;Request-Id: $req_id&quot;;</span>
</pre></div> </code></pre></div>
<h3 id="custom-http-errors">Custom HTTP Errors<a class="headerlink" href="#custom-http-errors" title="Permanent link"></a></h3> <h3 id="custom-http-errors">Custom HTTP Errors<a class="headerlink" href="#custom-http-errors" title="Permanent link"></a></h3>
<p>Like the <a href="../configmap/#custom-http-errors"><code class="codehilite">custom-http-errors</code></a> value in the ConfigMap, this annotation will set NGINX <code class="codehilite">proxy-intercept-errors</code>, but only for the NGINX location associated with this ingress. If a <a href="#default-backend">default backend annotation</a> is specified on the ingress, the errors will be routed to that annotation's default backend service (instead of the global default backend). <p>Like the <a href="../configmap/#custom-http-errors"><code class="codehilite"><span class="err">custom-http-errors</span></code></a> value in the ConfigMap, this annotation will set NGINX <code class="codehilite"><span class="err">proxy-intercept-errors</span></code>, but only for the NGINX location associated with this ingress. If a <a href="#default-backend">default backend annotation</a> is specified on the ingress, the errors will be routed to that annotation's default backend service (instead of the global default backend).
Different ingresses can specify different sets of error codes. Even if multiple ingress objects share the same hostname, this annotation can be used to intercept different error codes for each ingress (for example, different error codes to be intercepted for different paths on the same hostname, if each path is on a different ingress). Different ingresses can specify different sets of error codes. Even if multiple ingress objects share the same hostname, this annotation can be used to intercept different error codes for each ingress (for example, different error codes to be intercepted for different paths on the same hostname, if each path is on a different ingress).
If <code class="codehilite">custom-http-errors</code> is also specified globally, the error values specified in this annotation will override the global value for the given ingress' hostname and path.</p> If <code class="codehilite"><span class="err">custom-http-errors</span></code> is also specified globally, the error values specified in this annotation will override the global value for the given ingress' hostname and path.</p>
<p>Example usage: <p>Example usage:
<div class="codehilite"><pre><span></span>nginx.ingress.kubernetes.io/custom-http-errors: &quot;404,415&quot; <div class="codehilite"><pre><span></span><code><span class="err">nginx.ingress.kubernetes.io/custom-http-errors: &quot;404,415&quot;</span>
</pre></div></p> </code></pre></div></p>
<h3 id="default-backend">Default Backend<a class="headerlink" href="#default-backend" title="Permanent link"></a></h3> <h3 id="default-backend">Default Backend<a class="headerlink" href="#default-backend" title="Permanent link"></a></h3>
<p>This annotation is of the form <code class="codehilite">nginx.ingress.kubernetes.io/default-backend: &lt;svc name&gt;</code> to specify a custom default backend. This <code class="codehilite">&lt;svc name&gt;</code> is a reference to a service inside of the same namespace in which you are applying this annotation. This annotation overrides the global default backend.</p> <p>This annotation is of the form <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/default-backend: &lt;svc name&gt;</span></code> to specify a custom default backend. This <code class="codehilite"><span class="err">&lt;svc name&gt;</span></code> is a reference to a service inside of the same namespace in which you are applying this annotation. This annotation overrides the global default backend.</p>
<p>This service will be handle the response when the service in the Ingress rule does not have active endpoints. It will also handle the error responses if both this annotation and the <a href="#custom-http-errors">custom-http-errors annotation</a> is set.</p> <p>This service will be handle the response when the service in the Ingress rule does not have active endpoints. It will also handle the error responses if both this annotation and the <a href="#custom-http-errors">custom-http-errors annotation</a> is set.</p>
<h3 id="enable-cors">Enable CORS<a class="headerlink" href="#enable-cors" title="Permanent link"></a></h3> <h3 id="enable-cors">Enable CORS<a class="headerlink" href="#enable-cors" title="Permanent link"></a></h3>
<p>To enable Cross-Origin Resource Sharing (CORS) in an Ingress rule, add the annotation <p>To enable Cross-Origin Resource Sharing (CORS) in an Ingress rule, add the annotation
<code class="codehilite">nginx.ingress.kubernetes.io/enable-cors: &quot;true&quot;</code>. This will add a section in the server <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/enable-cors: &quot;true&quot;</span></code>. This will add a section in the server
location enabling this functionality.</p> location enabling this functionality.</p>
<p>CORS can be controlled with the following annotations:</p> <p>CORS can be controlled with the following annotations:</p>
<ul> <ul>
<li><code class="codehilite">nginx.ingress.kubernetes.io/cors-allow-methods</code> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/cors-allow-methods</span></code>
controls which methods are accepted. This is a multi-valued field, separated by ',' and controls which methods are accepted. This is a multi-valued field, separated by ',' and
accepts only letters (upper and lower case).</li> accepts only letters (upper and lower case).</li>
<li>Default: <code class="codehilite">GET, PUT, POST, DELETE, PATCH, OPTIONS</code></li> <li>Default: <code class="codehilite"><span class="err">GET, PUT, POST, DELETE, PATCH, OPTIONS</span></code></li>
<li> <li>
<p>Example: <code class="codehilite">nginx.ingress.kubernetes.io/cors-allow-methods: &quot;PUT, GET, POST, OPTIONS&quot;</code></p> <p>Example: <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/cors-allow-methods: &quot;PUT, GET, POST, OPTIONS&quot;</span></code></p>
</li> </li>
<li> <li>
<p><code class="codehilite">nginx.ingress.kubernetes.io/cors-allow-headers</code> <p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/cors-allow-headers</span></code>
controls which headers are accepted. This is a multi-valued field, separated by ',' and accepts letters, controls which headers are accepted. This is a multi-valued field, separated by ',' and accepts letters,
numbers, _ and -.</p> numbers, _ and -.</p>
</li> </li>
<li>Default: <code class="codehilite">DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization</code></li> <li>Default: <code class="codehilite"><span class="err">DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization</span></code></li>
<li> <li>
<p>Example: <code class="codehilite">nginx.ingress.kubernetes.io/cors-allow-headers: &quot;X-Forwarded-For, X-app123-XPTO&quot;</code></p> <p>Example: <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/cors-allow-headers: &quot;X-Forwarded-For, X-app123-XPTO&quot;</span></code></p>
</li> </li>
<li> <li>
<p><code class="codehilite">nginx.ingress.kubernetes.io/cors-allow-origin</code> <p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/cors-allow-origin</span></code>
controls what's the accepted Origin for CORS. controls what's the accepted Origin for CORS.
This is a single field value, with the following format: <code class="codehilite">http(s)://origin-site.com</code> or <code class="codehilite">http(s)://origin-site.com:port</code></p> This is a single field value, with the following format: <code class="codehilite"><span class="err">http(s)://origin-site.com</span></code> or <code class="codehilite"><span class="err">http(s)://origin-site.com:port</span></code></p>
</li> </li>
<li>Default: <code class="codehilite">*</code></li> <li>Default: <code class="codehilite"><span class="err">*</span></code></li>
<li> <li>
<p>Example: <code class="codehilite">nginx.ingress.kubernetes.io/cors-allow-origin: &quot;https://origin-site.com:4443&quot;</code></p> <p>Example: <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/cors-allow-origin: &quot;https://origin-site.com:4443&quot;</span></code></p>
</li> </li>
<li> <li>
<p><code class="codehilite">nginx.ingress.kubernetes.io/cors-allow-credentials</code> <p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/cors-allow-credentials</span></code>
controls if credentials can be passed during CORS operations.</p> controls if credentials can be passed during CORS operations.</p>
</li> </li>
<li>Default: <code class="codehilite">true</code></li> <li>Default: <code class="codehilite"><span class="err">true</span></code></li>
<li> <li>
<p>Example: <code class="codehilite">nginx.ingress.kubernetes.io/cors-allow-credentials: &quot;false&quot;</code></p> <p>Example: <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/cors-allow-credentials: &quot;false&quot;</span></code></p>
</li> </li>
<li> <li>
<p><code class="codehilite">nginx.ingress.kubernetes.io/cors-max-age</code> <p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/cors-max-age</span></code>
controls how long preflight requests can be cached. controls how long preflight requests can be cached.
Default: <code class="codehilite">1728000</code> Default: <code class="codehilite"><span class="err">1728000</span></code>
Example: <code class="codehilite">nginx.ingress.kubernetes.io/cors-max-age: 600</code></p> Example: <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/cors-max-age: 600</span></code></p>
</li> </li>
</ul> </ul>
<div class="admonition note"> <div class="admonition note">
@ -2601,22 +2601,22 @@ location enabling this functionality.</p>
<div class="admonition example"> <div class="admonition example">
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<ul> <ul>
<li><code class="codehilite">nginx.ingress.kubernetes.io/http2-push-preload: &quot;true&quot;</code></li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/http2-push-preload: &quot;true&quot;</span></code></li>
</ul> </ul>
</div> </div>
<h3 id="server-alias">Server Alias<a class="headerlink" href="#server-alias" title="Permanent link"></a></h3> <h3 id="server-alias">Server Alias<a class="headerlink" href="#server-alias" title="Permanent link"></a></h3>
<p>Allows the definition of one or more aliases in the server definition of the NGINX configuration using the annotation <code class="codehilite">nginx.ingress.kubernetes.io/server-alias: &quot;&lt;alias 1&gt;,&lt;alias 2&gt;&quot;</code>. <p>Allows the definition of one or more aliases in the server definition of the NGINX configuration using the annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/server-alias: &quot;&lt;alias 1&gt;,&lt;alias 2&gt;&quot;</span></code>.
This will create a server with the same configuration, but adding new values to the <code class="codehilite">server_name</code> directive.</p> This will create a server with the same configuration, but adding new values to the <code class="codehilite"><span class="err">server_name</span></code> directive.</p>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
<p>A server-alias name cannot conflict with the hostname of an existing server. If it does, the server-alias annotation will be ignored. <p>A server-alias name cannot conflict with the hostname of an existing server. If it does, the server-alias annotation will be ignored.
If a server-alias is created and later a new server with the same hostname is created, the new server configuration will take If a server-alias is created and later a new server with the same hostname is created, the new server configuration will take
place over the alias configuration.</p> place over the alias configuration.</p>
</div> </div>
<p>For more information please see <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name">the <code class="codehilite">server_name</code> documentation</a>.</p> <p>For more information please see <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name">the <code class="codehilite"><span class="err">server_name</span></code> documentation</a>.</p>
<h3 id="server-snippet">Server snippet<a class="headerlink" href="#server-snippet" title="Permanent link"></a></h3> <h3 id="server-snippet">Server snippet<a class="headerlink" href="#server-snippet" title="Permanent link"></a></h3>
<p>Using the annotation <code class="codehilite">nginx.ingress.kubernetes.io/server-snippet</code> it is possible to add custom configuration in the server configuration block.</p> <p>Using the annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/server-snippet</span></code> it is possible to add custom configuration in the server configuration block.</p>
<div class="codehilite"><pre><span></span><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">networking.k8s.io/v1beta1</span> <div class="codehilite"><pre><span></span><code><span class="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">networking.k8s.io/v1beta1</span>
<span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Ingress</span> <span class="nt">kind</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Ingress</span>
<span class="nt">metadata</span><span class="p">:</span> <span class="nt">metadata</span><span class="p">:</span>
<span class="nt">annotations</span><span class="p">:</span> <span class="nt">annotations</span><span class="p">:</span>
@ -2630,7 +2630,7 @@ place over the alias configuration.</p>
<span class="no">if ( $agentflag = 1 ) {</span> <span class="no">if ( $agentflag = 1 ) {</span>
<span class="no">return 301 https://m.example.com;</span> <span class="no">return 301 https://m.example.com;</span>
<span class="no">}</span> <span class="no">}</span>
</pre></div> </code></pre></div>
<div class="admonition attention"> <div class="admonition attention">
<p class="admonition-title">Attention</p> <p class="admonition-title">Attention</p>
@ -2648,82 +2648,85 @@ applied to each location provided in the ingress rule.</p>
<div class="admonition example"> <div class="admonition example">
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<ul> <ul>
<li><code class="codehilite">nginx.ingress.kubernetes.io/client-body-buffer-size: &quot;1000&quot;</code> # 1000 bytes</li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/client-body-buffer-size: &quot;1000&quot;</span></code> # 1000 bytes</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/client-body-buffer-size: 1k</code> # 1 kilobyte</li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/client-body-buffer-size: 1k</span></code> # 1 kilobyte</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/client-body-buffer-size: 1K</code> # 1 kilobyte</li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/client-body-buffer-size: 1K</span></code> # 1 kilobyte</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/client-body-buffer-size: 1m</code> # 1 megabyte</li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/client-body-buffer-size: 1m</span></code> # 1 megabyte</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/client-body-buffer-size: 1M</code> # 1 megabyte</li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/client-body-buffer-size: 1M</span></code> # 1 megabyte</li>
</ul> </ul>
</div> </div>
<p>For more information please see <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_buffer_size">http://nginx.org</a></p> <p>For more information please see <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_buffer_size">http://nginx.org</a></p>
<h3 id="external-authentication">External Authentication<a class="headerlink" href="#external-authentication" title="Permanent link"></a></h3> <h3 id="external-authentication">External Authentication<a class="headerlink" href="#external-authentication" title="Permanent link"></a></h3>
<p>To use an existing service that provides authentication the Ingress rule can be annotated with <code class="codehilite">nginx.ingress.kubernetes.io/auth-url</code> to indicate the URL where the HTTP request should be sent.</p> <p>To use an existing service that provides authentication the Ingress rule can be annotated with <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-url</span></code> to indicate the URL where the HTTP request should be sent.</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/auth-url</span><span class="p">:</span> <span class="s">&quot;URL</span><span class="nv"> </span><span class="s">to</span><span class="nv"> </span><span class="s">the</span><span class="nv"> </span><span class="s">authentication</span><span class="nv"> </span><span class="s">service&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/auth-url</span><span class="p">:</span> <span class="s">&quot;URL</span><span class="nv"> </span><span class="s">to</span><span class="nv"> </span><span class="s">the</span><span class="nv"> </span><span class="s">authentication</span><span class="nv"> </span><span class="s">service&quot;</span>
</pre></div> </code></pre></div>
<p>Additionally it is possible to set:</p> <p>Additionally it is possible to set:</p>
<ul> <ul>
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-method</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-method</span></code>:
<code class="codehilite">&lt;Method&gt;</code> to specify the HTTP method to use.</li> <code class="codehilite"><span class="err">&lt;Method&gt;</span></code> to specify the HTTP method to use.</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-signin</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-signin</span></code>:
<code class="codehilite">&lt;SignIn_URL&gt;</code> to specify the location of the error page.</li> <code class="codehilite"><span class="err">&lt;SignIn_URL&gt;</span></code> to specify the location of the error page.</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-response-headers</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-response-headers</span></code>:
<code class="codehilite">&lt;Response_Header_1, ..., Response_Header_n&gt;</code> to specify headers to pass to backend once authentication request completes.</li> <code class="codehilite"><span class="err">&lt;Response_Header_1, ..., Response_Header_n&gt;</span></code> to specify headers to pass to backend once authentication request completes.</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-proxy-set-headers</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-proxy-set-headers</span></code>:
<code class="codehilite">&lt;ConfigMap&gt;</code> the name of a ConfigMap that specifies headers to pass to the authentication service</li> <code class="codehilite"><span class="err">&lt;ConfigMap&gt;</span></code> the name of a ConfigMap that specifies headers to pass to the authentication service</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-request-redirect</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-request-redirect</span></code>:
<code class="codehilite">&lt;Request_Redirect_URL&gt;</code> to specify the X-Auth-Request-Redirect header value.</li> <code class="codehilite"><span class="err">&lt;Request_Redirect_URL&gt;</span></code> to specify the X-Auth-Request-Redirect header value.</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-cache-key</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-cache-key</span></code>:
<code class="codehilite">&lt;Cache_Key&gt;</code> this enables caching for auth requests. specify a lookup key for auth responses. e.g. <code class="codehilite">$remote_user$http_authorization</code>. Each server and location has it's own keyspace. Hence a cached response is only valid on a per-server and per-location basis.</li> <code class="codehilite"><span class="err">&lt;Cache_Key&gt;</span></code> this enables caching for auth requests. specify a lookup key for auth responses. e.g. <code class="codehilite"><span class="err">$remote_user$http_authorization</span></code>. Each server and location has it's own keyspace. Hence a cached response is only valid on a per-server and per-location basis.</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-cache-duration</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-cache-duration</span></code>:
<code class="codehilite">&lt;Cache_duration&gt;</code> to specify a caching time for auth responses based on their response codes, e.g. <code class="codehilite">200 202 30m</code>. See <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_valid">proxy_cache_valid</a> for details. You may specify multiple, comma-separated values: <code class="codehilite">200 202 10m, 401 5m</code>. defaults to <code class="codehilite">200 202 401 5m</code>.</li> <code class="codehilite"><span class="err">&lt;Cache_duration&gt;</span></code> to specify a caching time for auth responses based on their response codes, e.g. <code class="codehilite"><span class="err">200 202 30m</span></code>. See <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_valid">proxy_cache_valid</a> for details. You may specify multiple, comma-separated values: <code class="codehilite"><span class="err">200 202 10m, 401 5m</span></code>. defaults to <code class="codehilite"><span class="err">200 202 401 5m</span></code>.</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-snippet</code>: <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-snippet</span></code>:
<code class="codehilite">&lt;Auth_Snippet&gt;</code> to specify a custom snippet to use with external authentication, e.g.</li> <code class="codehilite"><span class="err">&lt;Auth_Snippet&gt;</span></code> to specify a custom snippet to use with external authentication, e.g.</li>
</ul> </ul>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/auth-url</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">http://foo.com/external-auth</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/auth-url</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">http://foo.com/external-auth</span>
<span class="nt">nginx.ingress.kubernetes.io/auth-snippet</span><span class="p">:</span> <span class="p p-Indicator">|</span> <span class="nt">nginx.ingress.kubernetes.io/auth-snippet</span><span class="p">:</span> <span class="p p-Indicator">|</span>
<span class="no">proxy_set_header Foo-Header 42;</span> <span class="no">proxy_set_header Foo-Header 42;</span>
</pre></div> </code></pre></div>
<blockquote> <blockquote>
<p>Note: <code class="codehilite">nginx.ingress.kubernetes.io/auth-snippet</code> is an optional annotation. However, it may only be used in conjunction with <code class="codehilite">nginx.ingress.kubernetes.io/auth-url</code> and will be ignored if <code class="codehilite">nginx.ingress.kubernetes.io/auth-url</code> is not set</p> <p>Note: <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-snippet</span></code> is an optional annotation. However, it may only be used in conjunction with <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-url</span></code> and will be ignored if <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-url</span></code> is not set</p>
</blockquote> </blockquote>
<div class="admonition example"> <div class="admonition example">
<p class="admonition-title">Example</p> <p class="admonition-title">Example</p>
<p>Please check the <a href="../../../examples/auth/external-auth/">external-auth</a> example.</p> <p>Please check the <a href="../../../examples/auth/external-auth/">external-auth</a> example.</p>
</div> </div>
<h4 id="global-external-authentication">Global External Authentication<a class="headerlink" href="#global-external-authentication" title="Permanent link"></a></h4> <h4 id="global-external-authentication">Global External Authentication<a class="headerlink" href="#global-external-authentication" title="Permanent link"></a></h4>
<p>By default the controller redirects all requests to an existing service that provides authentication if <code class="codehilite">global-auth-url</code> is set in the NGINX ConfigMap. If you want to disable this behavior for that ingress, you can use <code class="codehilite">enable-global-auth: &quot;false&quot;</code> in the NGINX ConfigMap. <p>By default the controller redirects all requests to an existing service that provides authentication if <code class="codehilite"><span class="err">global-auth-url</span></code> is set in the NGINX ConfigMap. If you want to disable this behavior for that ingress, you can use <code class="codehilite"><span class="c">enable-global-auth: &quot;false&quot;</span></code> in the NGINX ConfigMap.
<code class="codehilite">nginx.ingress.kubernetes.io/enable-global-auth</code>: <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/enable-global-auth</span></code>:
indicates if GlobalExternalAuth configuration should be applied or not to this Ingress rule. Default values is set to <code class="codehilite">&quot;true&quot;</code>.</p> indicates if GlobalExternalAuth configuration should be applied or not to this Ingress rule. Default values is set to <code class="codehilite"><span class="err">&quot;true&quot;</span></code>.</p>
<p>!!! note For more information please see <a href="../configmap/#global-auth-url">global-auth-url</a>.</p> <div class="admonition note">
<p class="admonition-title">Note</p>
<p>For more information please see <a href="../configmap/#global-auth-url">global-auth-url</a>.</p>
</div>
<h3 id="rate-limiting">Rate limiting<a class="headerlink" href="#rate-limiting" title="Permanent link"></a></h3> <h3 id="rate-limiting">Rate limiting<a class="headerlink" href="#rate-limiting" title="Permanent link"></a></h3>
<p>These annotations define limits on connections and transmission rates. These can be used to mitigate <a href="https://www.nginx.com/blog/mitigating-ddos-attacks-with-nginx-and-nginx-plus">DDoS Attacks</a>.</p> <p>These annotations define limits on connections and transmission rates. These can be used to mitigate <a href="https://www.nginx.com/blog/mitigating-ddos-attacks-with-nginx-and-nginx-plus">DDoS Attacks</a>.</p>
<ul> <ul>
<li><code class="codehilite">nginx.ingress.kubernetes.io/limit-connections</code>: number of concurrent connections allowed from a single IP address. A 503 error is returned when exceeding this limit.</li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/limit-connections</span></code>: number of concurrent connections allowed from a single IP address. A 503 error is returned when exceeding this limit.</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/limit-rps</code>: number of requests accepted from a given IP each second. The burst limit is set to 5 times the limit. When clients exceed this limit, <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#limit-req-status-code">limit-req-status-code</a> <strong><em>default:</em></strong> 503 is returned.</li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/limit-rps</span></code>: number of requests accepted from a given IP each second. The burst limit is set to 5 times the limit. When clients exceed this limit, <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#limit-req-status-code">limit-req-status-code</a> <strong><em>default:</em></strong> 503 is returned.</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/limit-rpm</code>: number of requests accepted from a given IP each minute. The burst limit is set to 5 times the limit. When clients exceed this limit, <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#limit-req-status-code">limit-req-status-code</a> <strong><em>default:</em></strong> 503 is returned.</li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/limit-rpm</span></code>: number of requests accepted from a given IP each minute. The burst limit is set to 5 times the limit. When clients exceed this limit, <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#limit-req-status-code">limit-req-status-code</a> <strong><em>default:</em></strong> 503 is returned.</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/limit-rate-after</code>: initial number of kilobytes after which the further transmission of a response to a given connection will be rate limited. This feature must be used with <a href="#proxy-buffering">proxy-buffering</a> enabled.</li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/limit-rate-after</span></code>: initial number of kilobytes after which the further transmission of a response to a given connection will be rate limited. This feature must be used with <a href="#proxy-buffering">proxy-buffering</a> enabled.</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/limit-rate</code>: number of kilobytes per second allowed to send to a given connection. The zero value disables rate limiting. This feature must be used with <a href="#proxy-buffering">proxy-buffering</a> enabled.</li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/limit-rate</span></code>: number of kilobytes per second allowed to send to a given connection. The zero value disables rate limiting. This feature must be used with <a href="#proxy-buffering">proxy-buffering</a> enabled.</li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/limit-whitelist</code>: client IP source ranges to be excluded from rate-limiting. The value is a comma separated list of CIDRs.</li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/limit-whitelist</span></code>: client IP source ranges to be excluded from rate-limiting. The value is a comma separated list of CIDRs.</li>
</ul> </ul>
<p>If you specify multiple annotations in a single Ingress rule, limits are applied in the order <code class="codehilite">limit-connections</code>, <code class="codehilite">limit-rpm</code>, <code class="codehilite">limit-rps</code>.</p> <p>If you specify multiple annotations in a single Ingress rule, limits are applied in the order <code class="codehilite"><span class="err">limit-connections</span></code>, <code class="codehilite"><span class="err">limit-rpm</span></code>, <code class="codehilite"><span class="err">limit-rps</span></code>.</p>
<p>To configure settings globally for all Ingress rules, the <code class="codehilite">limit-rate-after</code> and <code class="codehilite">limit-rate</code> values may be set in the <a href="../configmap/#limit-rate">NGINX ConfigMap</a>. The value set in an Ingress annotation will override the global setting.</p> <p>To configure settings globally for all Ingress rules, the <code class="codehilite"><span class="err">limit-rate-after</span></code> and <code class="codehilite"><span class="err">limit-rate</span></code> values may be set in the <a href="../configmap/#limit-rate">NGINX ConfigMap</a>. The value set in an Ingress annotation will override the global setting.</p>
<p>The client IP address will be set based on the use of <a href="../configmap/#use-proxy-protocol">PROXY protocol</a> or from the <code class="codehilite">X-Forwarded-For</code> header value when <a href="../configmap/#use-forwarded-headers">use-forwarded-headers</a> is enabled.</p> <p>The client IP address will be set based on the use of <a href="../configmap/#use-proxy-protocol">PROXY protocol</a> or from the <code class="codehilite"><span class="err">X-Forwarded-For</span></code> header value when <a href="../configmap/#use-forwarded-headers">use-forwarded-headers</a> is enabled.</p>
<h3 id="permanent-redirect">Permanent Redirect<a class="headerlink" href="#permanent-redirect" title="Permanent link"></a></h3> <h3 id="permanent-redirect">Permanent Redirect<a class="headerlink" href="#permanent-redirect" title="Permanent link"></a></h3>
<p>This annotation allows to return a permanent redirect instead of sending data to the upstream. For example <code class="codehilite">nginx.ingress.kubernetes.io/permanent-redirect: https://www.google.com</code> would redirect everything to Google.</p> <p>This annotation allows to return a permanent redirect instead of sending data to the upstream. For example <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/permanent-redirect: https://www.google.com</span></code> would redirect everything to Google.</p>
<h3 id="permanent-redirect-code">Permanent Redirect Code<a class="headerlink" href="#permanent-redirect-code" title="Permanent link"></a></h3> <h3 id="permanent-redirect-code">Permanent Redirect Code<a class="headerlink" href="#permanent-redirect-code" title="Permanent link"></a></h3>
<p>This annotation allows you to modify the status code used for permanent redirects. For example <code class="codehilite">nginx.ingress.kubernetes.io/permanent-redirect-code: &#39;308&#39;</code> would return your permanent-redirect with a 308.</p> <p>This annotation allows you to modify the status code used for permanent redirects. For example <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/permanent-redirect-code: &#39;308&#39;</span></code> would return your permanent-redirect with a 308.</p>
<h3 id="temporal-redirect">Temporal Redirect<a class="headerlink" href="#temporal-redirect" title="Permanent link"></a></h3> <h3 id="temporal-redirect">Temporal Redirect<a class="headerlink" href="#temporal-redirect" title="Permanent link"></a></h3>
<p>This annotation allows you to return a temporal redirect (Return Code 302) instead of sending data to the upstream. For example <code class="codehilite">nginx.ingress.kubernetes.io/temporal-redirect: https://www.google.com</code> would redirect everything to Google with a Return Code of 302 (Moved Temporarily)</p> <p>This annotation allows you to return a temporal redirect (Return Code 302) instead of sending data to the upstream. For example <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/temporal-redirect: https://www.google.com</span></code> would redirect everything to Google with a Return Code of 302 (Moved Temporarily)</p>
<h3 id="ssl-passthrough">SSL Passthrough<a class="headerlink" href="#ssl-passthrough" title="Permanent link"></a></h3> <h3 id="ssl-passthrough">SSL Passthrough<a class="headerlink" href="#ssl-passthrough" title="Permanent link"></a></h3>
<p>The annotation <code class="codehilite">nginx.ingress.kubernetes.io/ssl-passthrough</code> instructs the controller to send TLS connections directly <p>The annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/ssl-passthrough</span></code> instructs the controller to send TLS connections directly
to the backend instead of letting NGINX decrypt the communication. See also <a href="../../tls/#ssl-passthrough">TLS/HTTPS</a> in to the backend instead of letting NGINX decrypt the communication. See also <a href="../../tls/#ssl-passthrough">TLS/HTTPS</a> in
the User guide.</p> the User guide.</p>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
<p>SSL Passthrough is <strong>disabled by default</strong> and requires starting the controller with the <p>SSL Passthrough is <strong>disabled by default</strong> and requires starting the controller with the
<a href="../../cli-arguments/"><code class="codehilite">--enable-ssl-passthrough</code></a> flag.</p> <a href="../../cli-arguments/"><code class="codehilite"><span class="err">--enable-ssl-passthrough</span></code></a> flag.</p>
</div> </div>
<div class="admonition attention"> <div class="admonition attention">
<p class="admonition-title">Attention</p> <p class="admonition-title">Attention</p>
@ -2732,37 +2735,37 @@ invalidates all the other annotations set on an Ingress object.</p>
</div> </div>
<h3 id="service-upstream">Service Upstream<a class="headerlink" href="#service-upstream" title="Permanent link"></a></h3> <h3 id="service-upstream">Service Upstream<a class="headerlink" href="#service-upstream" title="Permanent link"></a></h3>
<p>By default the NGINX ingress controller uses a list of all endpoints (Pod IP/port) in the NGINX upstream configuration.</p> <p>By default the NGINX ingress controller uses a list of all endpoints (Pod IP/port) in the NGINX upstream configuration.</p>
<p>The <code class="codehilite">nginx.ingress.kubernetes.io/service-upstream</code> annotation disables that behavior and instead uses a single upstream in NGINX, the service's Cluster IP and port.</p> <p>The <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/service-upstream</span></code> annotation disables that behavior and instead uses a single upstream in NGINX, the service's Cluster IP and port.</p>
<p>This can be desirable for things like zero-downtime deployments as it reduces the need to reload NGINX configuration when Pods come up and down. See issue <a href="https://github.com/kubernetes/ingress-nginx/issues/257">#257</a>.</p> <p>This can be desirable for things like zero-downtime deployments as it reduces the need to reload NGINX configuration when Pods come up and down. See issue <a href="https://github.com/kubernetes/ingress-nginx/issues/257">#257</a>.</p>
<h4 id="known-issues">Known Issues<a class="headerlink" href="#known-issues" title="Permanent link"></a></h4> <h4 id="known-issues">Known Issues<a class="headerlink" href="#known-issues" title="Permanent link"></a></h4>
<p>If the <code class="codehilite">service-upstream</code> annotation is specified the following things should be taken into consideration:</p> <p>If the <code class="codehilite"><span class="err">service-upstream</span></code> annotation is specified the following things should be taken into consideration:</p>
<ul> <ul>
<li>Sticky Sessions will not work as only round-robin load balancing is supported.</li> <li>Sticky Sessions will not work as only round-robin load balancing is supported.</li>
<li>The <code class="codehilite">proxy_next_upstream</code> directive will not have any effect meaning on error the request will not be dispatched to another upstream.</li> <li>The <code class="codehilite"><span class="err">proxy_next_upstream</span></code> directive will not have any effect meaning on error the request will not be dispatched to another upstream.</li>
</ul> </ul>
<h3 id="server-side-https-enforcement-through-redirect">Server-side HTTPS enforcement through redirect<a class="headerlink" href="#server-side-https-enforcement-through-redirect" title="Permanent link"></a></h3> <h3 id="server-side-https-enforcement-through-redirect">Server-side HTTPS enforcement through redirect<a class="headerlink" href="#server-side-https-enforcement-through-redirect" title="Permanent link"></a></h3>
<p>By default the controller redirects (308) to HTTPS if TLS is enabled for that ingress. <p>By default the controller redirects (308) to HTTPS if TLS is enabled for that ingress.
If you want to disable this behavior globally, you can use <code class="codehilite">ssl-redirect: &quot;false&quot;</code> in the NGINX <a href="../configmap/#ssl-redirect">ConfigMap</a>.</p> If you want to disable this behavior globally, you can use <code class="codehilite"><span class="c">ssl-redirect: &quot;false&quot;</span></code> in the NGINX <a href="../configmap/#ssl-redirect">ConfigMap</a>.</p>
<p>To configure this feature for specific ingress resources, you can use the <code class="codehilite">nginx.ingress.kubernetes.io/ssl-redirect: &quot;false&quot;</code> <p>To configure this feature for specific ingress resources, you can use the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/ssl-redirect: &quot;false&quot;</span></code>
annotation in the particular resource.</p> annotation in the particular resource.</p>
<p>When using SSL offloading outside of cluster (e.g. AWS ELB) it may be useful to enforce a redirect to HTTPS <p>When using SSL offloading outside of cluster (e.g. AWS ELB) it may be useful to enforce a redirect to HTTPS
even when there is no TLS certificate available. even when there is no TLS certificate available.
This can be achieved by using the <code class="codehilite">nginx.ingress.kubernetes.io/force-ssl-redirect: &quot;true&quot;</code> annotation in the particular resource.</p> This can be achieved by using the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/force-ssl-redirect: &quot;true&quot;</span></code> annotation in the particular resource.</p>
<h3 id="redirect-fromto-www">Redirect from/to www<a class="headerlink" href="#redirect-fromto-www" title="Permanent link"></a></h3> <h3 id="redirect-fromto-www">Redirect from/to www<a class="headerlink" href="#redirect-fromto-www" title="Permanent link"></a></h3>
<p>In some scenarios is required to redirect from <code class="codehilite">www.domain.com</code> to <code class="codehilite">domain.com</code> or vice versa. <p>In some scenarios is required to redirect from <code class="codehilite"><span class="err">www.domain.com</span></code> to <code class="codehilite"><span class="err">domain.com</span></code> or vice versa.
To enable this feature use the annotation <code class="codehilite">nginx.ingress.kubernetes.io/from-to-www-redirect: &quot;true&quot;</code></p> To enable this feature use the annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/from-to-www-redirect: &quot;true&quot;</span></code></p>
<div class="admonition attention"> <div class="admonition attention">
<p class="admonition-title">Attention</p> <p class="admonition-title">Attention</p>
<p>If at some point a new Ingress is created with a host equal to one of the options (like <code class="codehilite">domain.com</code>) the annotation will be omitted.</p> <p>If at some point a new Ingress is created with a host equal to one of the options (like <code class="codehilite"><span class="err">domain.com</span></code>) the annotation will be omitted.</p>
</div> </div>
<div class="admonition attention"> <div class="admonition attention">
<p class="admonition-title">Attention</p> <p class="admonition-title">Attention</p>
<p>For HTTPS to HTTPS redirects is mandatory the SSL Certificate defined in the Secret, located in the TLS section of Ingress, contains both FQDN in the common name of the certificate.</p> <p>For HTTPS to HTTPS redirects is mandatory the SSL Certificate defined in the Secret, located in the TLS section of Ingress, contains both FQDN in the common name of the certificate.</p>
</div> </div>
<h3 id="whitelist-source-range">Whitelist source range<a class="headerlink" href="#whitelist-source-range" title="Permanent link"></a></h3> <h3 id="whitelist-source-range">Whitelist source range<a class="headerlink" href="#whitelist-source-range" title="Permanent link"></a></h3>
<p>You can specify allowed client IP source ranges through the <code class="codehilite">nginx.ingress.kubernetes.io/whitelist-source-range</code> annotation. <p>You can specify allowed client IP source ranges through the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/whitelist-source-range</span></code> annotation.
The value is a comma separated list of <a href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing">CIDRs</a>, e.g. <code class="codehilite">10.0.0.0/24,172.10.0.1</code>.</p> The value is a comma separated list of <a href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing">CIDRs</a>, e.g. <code class="codehilite"><span class="err">10.0.0.0/24,172.10.0.1</span></code>.</p>
<p>To configure this setting globally for all Ingress rules, the <code class="codehilite">whitelist-source-range</code> value may be set in the <a href="../configmap/#whitelist-source-range">NGINX ConfigMap</a>.</p> <p>To configure this setting globally for all Ingress rules, the <code class="codehilite"><span class="err">whitelist-source-range</span></code> value may be set in the <a href="../configmap/#whitelist-source-range">NGINX ConfigMap</a>.</p>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
<p>Adding an annotation to an Ingress rule overrides any global restriction.</p> <p>Adding an annotation to an Ingress rule overrides any global restriction.</p>
@ -2771,135 +2774,135 @@ The value is a comma separated list of <a href="https://en.wikipedia.org/wiki/Cl
<p>Using the configuration configmap it is possible to set the default global timeout for connections to the upstream servers. <p>Using the configuration configmap it is possible to set the default global timeout for connections to the upstream servers.
In some scenarios is required to have different values. To allow this we provide annotations that allows this customization:</p> In some scenarios is required to have different values. To allow this we provide annotations that allows this customization:</p>
<ul> <ul>
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-connect-timeout</code></li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-connect-timeout</span></code></li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-send-timeout</code></li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-send-timeout</span></code></li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-read-timeout</code></li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-read-timeout</span></code></li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-next-upstream</code></li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-next-upstream</span></code></li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-next-upstream-timeout</code></li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-next-upstream-timeout</span></code></li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-next-upstream-tries</code></li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-next-upstream-tries</span></code></li>
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-request-buffering</code></li> <li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-request-buffering</span></code></li>
</ul> </ul>
<h3 id="proxy-redirect">Proxy redirect<a class="headerlink" href="#proxy-redirect" title="Permanent link"></a></h3> <h3 id="proxy-redirect">Proxy redirect<a class="headerlink" href="#proxy-redirect" title="Permanent link"></a></h3>
<p>With the annotations <code class="codehilite">nginx.ingress.kubernetes.io/proxy-redirect-from</code> and <code class="codehilite">nginx.ingress.kubernetes.io/proxy-redirect-to</code> it is possible to <p>With the annotations <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-redirect-from</span></code> and <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-redirect-to</span></code> it is possible to
set the text that should be changed in the <code class="codehilite">Location</code> and <code class="codehilite">Refresh</code> header fields of a <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_redirect">proxied server response</a></p> set the text that should be changed in the <code class="codehilite"><span class="err">Location</span></code> and <code class="codehilite"><span class="err">Refresh</span></code> header fields of a <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_redirect">proxied server response</a></p>
<p>Setting "off" or "default" in the annotation <code class="codehilite">nginx.ingress.kubernetes.io/proxy-redirect-from</code> disables <code class="codehilite">nginx.ingress.kubernetes.io/proxy-redirect-to</code>, <p>Setting "off" or "default" in the annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-redirect-from</span></code> disables <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-redirect-to</span></code>,
otherwise, both annotations must be used in unison. Note that each annotation must be a string without spaces.</p> otherwise, both annotations must be used in unison. Note that each annotation must be a string without spaces.</p>
<p>By default the value of each annotation is "off".</p> <p>By default the value of each annotation is "off".</p>
<h3 id="custom-max-body-size">Custom max body size<a class="headerlink" href="#custom-max-body-size" title="Permanent link"></a></h3> <h3 id="custom-max-body-size">Custom max body size<a class="headerlink" href="#custom-max-body-size" title="Permanent link"></a></h3>
<p>For NGINX, an 413 error will be returned to the client when the size in a request exceeds the maximum allowed size of the client request body. This size can be configured by the parameter <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size"><code class="codehilite">client_max_body_size</code></a>.</p> <p>For NGINX, an 413 error will be returned to the client when the size in a request exceeds the maximum allowed size of the client request body. This size can be configured by the parameter <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size"><code class="codehilite"><span class="err">client_max_body_size</span></code></a>.</p>
<p>To configure this setting globally for all Ingress rules, the <code class="codehilite">proxy-body-size</code> value may be set in the <a href="../configmap/#proxy-body-size">NGINX ConfigMap</a>. <p>To configure this setting globally for all Ingress rules, the <code class="codehilite"><span class="err">proxy-body-size</span></code> value may be set in the <a href="../configmap/#proxy-body-size">NGINX ConfigMap</a>.
To use custom values in an Ingress rule define these annotation:</p> To use custom values in an Ingress rule define these annotation:</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/proxy-body-size</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">8m</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/proxy-body-size</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">8m</span>
</pre></div> </code></pre></div>
<h3 id="proxy-cookie-domain">Proxy cookie domain<a class="headerlink" href="#proxy-cookie-domain" title="Permanent link"></a></h3> <h3 id="proxy-cookie-domain">Proxy cookie domain<a class="headerlink" href="#proxy-cookie-domain" title="Permanent link"></a></h3>
<p>Sets a text that <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cookie_domain">should be changed in the domain attribute</a> of the "Set-Cookie" header fields of a proxied server response.</p> <p>Sets a text that <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cookie_domain">should be changed in the domain attribute</a> of the "Set-Cookie" header fields of a proxied server response.</p>
<p>To configure this setting globally for all Ingress rules, the <code class="codehilite">proxy-cookie-domain</code> value may be set in the <a href="../configmap/#proxy-cookie-domain">NGINX ConfigMap</a>.</p> <p>To configure this setting globally for all Ingress rules, the <code class="codehilite"><span class="err">proxy-cookie-domain</span></code> value may be set in the <a href="../configmap/#proxy-cookie-domain">NGINX ConfigMap</a>.</p>
<h3 id="proxy-cookie-path">Proxy cookie path<a class="headerlink" href="#proxy-cookie-path" title="Permanent link"></a></h3> <h3 id="proxy-cookie-path">Proxy cookie path<a class="headerlink" href="#proxy-cookie-path" title="Permanent link"></a></h3>
<p>Sets a text that <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cookie_path">should be changed in the path attribute</a> of the "Set-Cookie" header fields of a proxied server response.</p> <p>Sets a text that <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cookie_path">should be changed in the path attribute</a> of the "Set-Cookie" header fields of a proxied server response.</p>
<p>To configure this setting globally for all Ingress rules, the <code class="codehilite">proxy-cookie-path</code> value may be set in the <a href="../configmap/#proxy-cookie-path">NGINX ConfigMap</a>.</p> <p>To configure this setting globally for all Ingress rules, the <code class="codehilite"><span class="err">proxy-cookie-path</span></code> value may be set in the <a href="../configmap/#proxy-cookie-path">NGINX ConfigMap</a>.</p>
<h3 id="proxy-buffering">Proxy buffering<a class="headerlink" href="#proxy-buffering" title="Permanent link"></a></h3> <h3 id="proxy-buffering">Proxy buffering<a class="headerlink" href="#proxy-buffering" title="Permanent link"></a></h3>
<p>Enable or disable proxy buffering <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering"><code class="codehilite">proxy_buffering</code></a>. <p>Enable or disable proxy buffering <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering"><code class="codehilite"><span class="err">proxy_buffering</span></code></a>.
By default proxy buffering is disabled in the NGINX config.</p> By default proxy buffering is disabled in the NGINX config.</p>
<p>To configure this setting globally for all Ingress rules, the <code class="codehilite">proxy-buffering</code> value may be set in the <a href="../configmap/#proxy-buffering">NGINX ConfigMap</a>. <p>To configure this setting globally for all Ingress rules, the <code class="codehilite"><span class="err">proxy-buffering</span></code> value may be set in the <a href="../configmap/#proxy-buffering">NGINX ConfigMap</a>.
To use custom values in an Ingress rule define these annotation:</p> To use custom values in an Ingress rule define these annotation:</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/proxy-buffering</span><span class="p">:</span> <span class="s">&quot;on&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/proxy-buffering</span><span class="p">:</span> <span class="s">&quot;on&quot;</span>
</pre></div> </code></pre></div>
<h3 id="proxy-buffers-number">Proxy buffers Number<a class="headerlink" href="#proxy-buffers-number" title="Permanent link"></a></h3> <h3 id="proxy-buffers-number">Proxy buffers Number<a class="headerlink" href="#proxy-buffers-number" title="Permanent link"></a></h3>
<p>Sets the number of the buffers in <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffers"><code class="codehilite">proxy_buffers</code></a> used for reading the first part of the response received from the proxied server. <p>Sets the number of the buffers in <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffers"><code class="codehilite"><span class="err">proxy_buffers</span></code></a> used for reading the first part of the response received from the proxied server.
By default proxy buffers number is set as 4</p> By default proxy buffers number is set as 4</p>
<p>To configure this setting globally, set <code class="codehilite">proxy-buffers-number</code> in <a href="../configmap/#proxy-buffers-number">NGINX ConfigMap</a>. To use custom values in an Ingress rule, define this annotation: <p>To configure this setting globally, set <code class="codehilite"><span class="err">proxy-buffers-number</span></code> in <a href="../configmap/#proxy-buffers-number">NGINX ConfigMap</a>. To use custom values in an Ingress rule, define this annotation:
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/proxy-buffers-number</span><span class="p">:</span> <span class="s">&quot;4&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/proxy-buffers-number</span><span class="p">:</span> <span class="s">&quot;4&quot;</span>
</pre></div></p> </code></pre></div></p>
<h3 id="proxy-buffer-size">Proxy buffer size<a class="headerlink" href="#proxy-buffer-size" title="Permanent link"></a></h3> <h3 id="proxy-buffer-size">Proxy buffer size<a class="headerlink" href="#proxy-buffer-size" title="Permanent link"></a></h3>
<p>Sets the size of the buffer <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffer_size"><code class="codehilite">proxy_buffer_size</code></a> used for reading the first part of the response received from the proxied server. <p>Sets the size of the buffer <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffer_size"><code class="codehilite"><span class="err">proxy_buffer_size</span></code></a> used for reading the first part of the response received from the proxied server.
By default proxy buffer size is set as "4k"</p> By default proxy buffer size is set as "4k"</p>
<p>To configure this setting globally, set <code class="codehilite">proxy-buffer-size</code> in <a href="../configmap/#proxy-buffer-size">NGINX ConfigMap</a>. To use custom values in an Ingress rule, define this annotation: <p>To configure this setting globally, set <code class="codehilite"><span class="err">proxy-buffer-size</span></code> in <a href="../configmap/#proxy-buffer-size">NGINX ConfigMap</a>. To use custom values in an Ingress rule, define this annotation:
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/proxy-buffer-size</span><span class="p">:</span> <span class="s">&quot;8k&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/proxy-buffer-size</span><span class="p">:</span> <span class="s">&quot;8k&quot;</span>
</pre></div></p> </code></pre></div></p>
<h3 id="proxy-max-temp-file-size">Proxy max temp file size<a class="headerlink" href="#proxy-max-temp-file-size" title="Permanent link"></a></h3> <h3 id="proxy-max-temp-file-size">Proxy max temp file size<a class="headerlink" href="#proxy-max-temp-file-size" title="Permanent link"></a></h3>
<p>When <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering"><code class="codehilite">buffering</code></a> of responses from the proxied server is enabled, and the whole response does not fit into the buffers set by the <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffer_size"><code class="codehilite">proxy_buffer_size</code></a> and <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffers"><code class="codehilite">proxy_buffers</code></a> directives, a part of the response can be saved to a temporary file. This directive sets the maximum <code class="codehilite">size</code> of the temporary file setting the <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_max_temp_file_size"><code class="codehilite">proxy_max_temp_file_size</code></a>. The size of data written to the temporary file at a time is set by the <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_temp_file_write_size"><code class="codehilite">proxy_temp_file_write_size</code></a> directive.</p> <p>When <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering"><code class="codehilite"><span class="err">buffering</span></code></a> of responses from the proxied server is enabled, and the whole response does not fit into the buffers set by the <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffer_size"><code class="codehilite"><span class="err">proxy_buffer_size</span></code></a> and <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffers"><code class="codehilite"><span class="err">proxy_buffers</span></code></a> directives, a part of the response can be saved to a temporary file. This directive sets the maximum <code class="codehilite"><span class="err">size</span></code> of the temporary file setting the <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_max_temp_file_size"><code class="codehilite"><span class="err">proxy_max_temp_file_size</span></code></a>. The size of data written to the temporary file at a time is set by the <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_temp_file_write_size"><code class="codehilite"><span class="err">proxy_temp_file_write_size</span></code></a> directive.</p>
<p>The zero value disables buffering of responses to temporary files.</p> <p>The zero value disables buffering of responses to temporary files.</p>
<p>To use custom values in an Ingress rule, define this annotation: <p>To use custom values in an Ingress rule, define this annotation:
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/proxy-max-temp-file-size</span><span class="p">:</span> <span class="s">&quot;1024m&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/proxy-max-temp-file-size</span><span class="p">:</span> <span class="s">&quot;1024m&quot;</span>
</pre></div></p> </code></pre></div></p>
<h3 id="proxy-http-version">Proxy HTTP version<a class="headerlink" href="#proxy-http-version" title="Permanent link"></a></h3> <h3 id="proxy-http-version">Proxy HTTP version<a class="headerlink" href="#proxy-http-version" title="Permanent link"></a></h3>
<p>Using this annotation sets the <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_version"><code class="codehilite">proxy_http_version</code></a> that the Nginx reverse proxy will use to communicate with the backend. <p>Using this annotation sets the <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_version"><code class="codehilite"><span class="err">proxy_http_version</span></code></a> that the Nginx reverse proxy will use to communicate with the backend.
By default this is set to "1.1".</p> By default this is set to "1.1".</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/proxy-http-version</span><span class="p">:</span> <span class="s">&quot;1.0&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/proxy-http-version</span><span class="p">:</span> <span class="s">&quot;1.0&quot;</span>
</pre></div> </code></pre></div>
<h3 id="ssl-ciphers">SSL ciphers<a class="headerlink" href="#ssl-ciphers" title="Permanent link"></a></h3> <h3 id="ssl-ciphers">SSL ciphers<a class="headerlink" href="#ssl-ciphers" title="Permanent link"></a></h3>
<p>Specifies the <a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_ciphers">enabled ciphers</a>.</p> <p>Specifies the <a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_ciphers">enabled ciphers</a>.</p>
<p>Using this annotation will set the <code class="codehilite">ssl_ciphers</code> directive at the server level. This configuration is active for all the paths in the host.</p> <p>Using this annotation will set the <code class="codehilite"><span class="err">ssl_ciphers</span></code> directive at the server level. This configuration is active for all the paths in the host.</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/ssl-ciphers</span><span class="p">:</span> <span class="s">&quot;ALL:!aNULL:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/ssl-ciphers</span><span class="p">:</span> <span class="s">&quot;ALL:!aNULL:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP&quot;</span>
</pre></div> </code></pre></div>
<h3 id="connection-proxy-header">Connection proxy header<a class="headerlink" href="#connection-proxy-header" title="Permanent link"></a></h3> <h3 id="connection-proxy-header">Connection proxy header<a class="headerlink" href="#connection-proxy-header" title="Permanent link"></a></h3>
<p>Using this annotation will override the default connection header set by NGINX. <p>Using this annotation will override the default connection header set by NGINX.
To use custom values in an Ingress rule, define the annotation:</p> To use custom values in an Ingress rule, define the annotation:</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/connection-proxy-header</span><span class="p">:</span> <span class="s">&quot;keep-alive&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/connection-proxy-header</span><span class="p">:</span> <span class="s">&quot;keep-alive&quot;</span>
</pre></div> </code></pre></div>
<h3 id="enable-access-log">Enable Access Log<a class="headerlink" href="#enable-access-log" title="Permanent link"></a></h3> <h3 id="enable-access-log">Enable Access Log<a class="headerlink" href="#enable-access-log" title="Permanent link"></a></h3>
<p>Access logs are enabled by default, but in some scenarios access logs might be required to be disabled for a given <p>Access logs are enabled by default, but in some scenarios access logs might be required to be disabled for a given
ingress. To do this, use the annotation:</p> ingress. To do this, use the annotation:</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/enable-access-log</span><span class="p">:</span> <span class="s">&quot;false&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/enable-access-log</span><span class="p">:</span> <span class="s">&quot;false&quot;</span>
</pre></div> </code></pre></div>
<h3 id="enable-rewrite-log">Enable Rewrite Log<a class="headerlink" href="#enable-rewrite-log" title="Permanent link"></a></h3> <h3 id="enable-rewrite-log">Enable Rewrite Log<a class="headerlink" href="#enable-rewrite-log" title="Permanent link"></a></h3>
<p>Rewrite logs are not enabled by default. In some scenarios it could be required to enable NGINX rewrite logs. <p>Rewrite logs are not enabled by default. In some scenarios it could be required to enable NGINX rewrite logs.
Note that rewrite logs are sent to the error_log file at the notice level. To enable this feature use the annotation:</p> Note that rewrite logs are sent to the error_log file at the notice level. To enable this feature use the annotation:</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/enable-rewrite-log</span><span class="p">:</span> <span class="s">&quot;true&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/enable-rewrite-log</span><span class="p">:</span> <span class="s">&quot;true&quot;</span>
</pre></div> </code></pre></div>
<h3 id="enable-opentracing">Enable Opentracing<a class="headerlink" href="#enable-opentracing" title="Permanent link"></a></h3> <h3 id="enable-opentracing">Enable Opentracing<a class="headerlink" href="#enable-opentracing" title="Permanent link"></a></h3>
<p>Opentracing can be enabled or disabled globally through the ConfigMap but this will sometimes need to be overridden <p>Opentracing can be enabled or disabled globally through the ConfigMap but this will sometimes need to be overridden
to enable it or disable it for a specific ingress (e.g. to turn off tracing of external health check endpoints)</p> to enable it or disable it for a specific ingress (e.g. to turn off tracing of external health check endpoints)</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/enable-opentracing</span><span class="p">:</span> <span class="s">&quot;true&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/enable-opentracing</span><span class="p">:</span> <span class="s">&quot;true&quot;</span>
</pre></div> </code></pre></div>
<h3 id="x-forwarded-prefix-header">X-Forwarded-Prefix Header<a class="headerlink" href="#x-forwarded-prefix-header" title="Permanent link"></a></h3> <h3 id="x-forwarded-prefix-header">X-Forwarded-Prefix Header<a class="headerlink" href="#x-forwarded-prefix-header" title="Permanent link"></a></h3>
<p>To add the non-standard <code class="codehilite">X-Forwarded-Prefix</code> header to the upstream request with a string value, the following annotation can be used:</p> <p>To add the non-standard <code class="codehilite"><span class="err">X-Forwarded-Prefix</span></code> header to the upstream request with a string value, the following annotation can be used:</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/x-forwarded-prefix</span><span class="p">:</span> <span class="s">&quot;/path&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/x-forwarded-prefix</span><span class="p">:</span> <span class="s">&quot;/path&quot;</span>
</pre></div> </code></pre></div>
<h3 id="lua-resty-waf">Lua Resty WAF<a class="headerlink" href="#lua-resty-waf" title="Permanent link"></a></h3> <h3 id="lua-resty-waf">Lua Resty WAF<a class="headerlink" href="#lua-resty-waf" title="Permanent link"></a></h3>
<p>Using <code class="codehilite">lua-resty-waf-*</code> annotations we can enable and control the <a href="https://github.com/p0pr0ck5/lua-resty-waf">lua-resty-waf</a> <p>Using <code class="codehilite"><span class="err">lua-resty-waf-*</span></code> annotations we can enable and control the <a href="https://github.com/p0pr0ck5/lua-resty-waf">lua-resty-waf</a>
Web Application Firewall per location.</p> Web Application Firewall per location.</p>
<p>Following configuration will enable the WAF for the paths defined in the corresponding ingress:</p> <p>Following configuration will enable the WAF for the paths defined in the corresponding ingress:</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/lua-resty-waf</span><span class="p">:</span> <span class="s">&quot;active&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/lua-resty-waf</span><span class="p">:</span> <span class="s">&quot;active&quot;</span>
</pre></div> </code></pre></div>
<p>In order to run it in debugging mode you can set <code class="codehilite">nginx.ingress.kubernetes.io/lua-resty-waf-debug</code> to <code class="codehilite">&quot;true&quot;</code> in addition to the above configuration. <p>In order to run it in debugging mode you can set <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/lua-resty-waf-debug</span></code> to <code class="codehilite"><span class="err">&quot;true&quot;</span></code> in addition to the above configuration.
The other possible values for <code class="codehilite">nginx.ingress.kubernetes.io/lua-resty-waf</code> are <code class="codehilite">inactive</code> and <code class="codehilite">simulate</code>. The other possible values for <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/lua-resty-waf</span></code> are <code class="codehilite"><span class="err">inactive</span></code> and <code class="codehilite"><span class="err">simulate</span></code>.
In <code class="codehilite">inactive</code> mode WAF won't do anything, whereas in <code class="codehilite">simulate</code> mode it will log a warning message if there's a matching WAF rule for given request. This is useful to debug a rule and eliminate possible false positives before fully deploying it.</p> In <code class="codehilite"><span class="err">inactive</span></code> mode WAF won't do anything, whereas in <code class="codehilite"><span class="err">simulate</span></code> mode it will log a warning message if there's a matching WAF rule for given request. This is useful to debug a rule and eliminate possible false positives before fully deploying it.</p>
<p><code class="codehilite">lua-resty-waf</code> comes with predefined set of rules <a href="https://github.com/p0pr0ck5/lua-resty-waf/tree/84b4f40362500dd0cb98b9e71b5875cb1a40f1ad/rules">https://github.com/p0pr0ck5/lua-resty-waf/tree/84b4f40362500dd0cb98b9e71b5875cb1a40f1ad/rules</a> that covers ModSecurity CRS. <p><code class="codehilite"><span class="err">lua-resty-waf</span></code> comes with predefined set of rules <a href="https://github.com/p0pr0ck5/lua-resty-waf/tree/84b4f40362500dd0cb98b9e71b5875cb1a40f1ad/rules">https://github.com/p0pr0ck5/lua-resty-waf/tree/84b4f40362500dd0cb98b9e71b5875cb1a40f1ad/rules</a> that covers ModSecurity CRS.
You can use <code class="codehilite">nginx.ingress.kubernetes.io/lua-resty-waf-ignore-rulesets</code> to ignore a subset of those rulesets. For an example:</p> You can use <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/lua-resty-waf-ignore-rulesets</span></code> to ignore a subset of those rulesets. For an example:</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/lua-resty-waf-ignore-rulesets</span><span class="p">:</span> <span class="s">&quot;41000_sqli,</span><span class="nv"> </span><span class="s">42000_xss&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/lua-resty-waf-ignore-rulesets</span><span class="p">:</span> <span class="s">&quot;41000_sqli,</span><span class="nv"> </span><span class="s">42000_xss&quot;</span>
</pre></div> </code></pre></div>
<p>will ignore the two mentioned rulesets.</p> <p>will ignore the two mentioned rulesets.</p>
<p>It is also possible to configure custom WAF rules per ingress using the <code class="codehilite">nginx.ingress.kubernetes.io/lua-resty-waf-extra-rules</code> annotation. For an example the following snippet will configure a WAF rule to deny requests with query string value that contains word <code class="codehilite">foo</code>:</p> <p>It is also possible to configure custom WAF rules per ingress using the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/lua-resty-waf-extra-rules</span></code> annotation. For an example the following snippet will configure a WAF rule to deny requests with query string value that contains word <code class="codehilite"><span class="err">foo</span></code>:</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/lua-resty-waf-extra-rules</span><span class="p">:</span> <span class="s">&#39;[=[</span><span class="nv"> </span><span class="s">{</span><span class="nv"> </span><span class="s">&quot;access&quot;:</span><span class="nv"> </span><span class="s">[</span><span class="nv"> </span><span class="s">{</span><span class="nv"> </span><span class="s">&quot;actions&quot;:</span><span class="nv"> </span><span class="s">{</span><span class="nv"> </span><span class="s">&quot;disrupt&quot;</span><span class="nv"> </span><span class="s">:</span><span class="nv"> </span><span class="s">&quot;DENY&quot;</span><span class="nv"> </span><span class="s">},</span><span class="nv"> </span><span class="s">&quot;id&quot;:</span><span class="nv"> </span><span class="s">10001,</span><span class="nv"> </span><span class="s">&quot;msg&quot;:</span><span class="nv"> </span><span class="s">&quot;my</span><span class="nv"> </span><span class="s">custom</span><span class="nv"> </span><span class="s">rule&quot;,</span><span class="nv"> </span><span class="s">&quot;operator&quot;:</span><span class="nv"> </span><span class="s">&quot;STR_CONTAINS&quot;,</span><span class="nv"> </span><span class="s">&quot;pattern&quot;:</span><span class="nv"> </span><span class="s">&quot;foo&quot;,</span><span class="nv"> </span><span class="s">&quot;vars&quot;:</span><span class="nv"> </span><span class="s">[</span><span class="nv"> </span><span class="s">{</span><span class="nv"> </span><span class="s">&quot;parse&quot;:</span><span class="nv"> </span><span class="s">[</span><span class="nv"> </span><span class="s">&quot;values&quot;,</span><span class="nv"> </span><span class="s">1</span><span class="nv"> </span><span class="s">],</span><span class="nv"> </span><span class="s">&quot;type&quot;:</span><span class="nv"> </span><span class="s">&quot;REQUEST_ARGS&quot;</span><span class="nv"> </span><span class="s">}</span><span class="nv"> </span><span class="s">]</span><span class="nv"> </span><span class="s">}</span><span class="nv"> </span><span class="s">],</span><span class="nv"> </span><span class="s">&quot;body_filter&quot;:</span><span class="nv"> </span><span class="s">[],</span><span class="nv"> </span><span class="s">&quot;header_filter&quot;:[]</span><span class="nv"> </span><span class="s">}</span><span class="nv"> </span><span class="s">]=]&#39;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/lua-resty-waf-extra-rules</span><span class="p">:</span> <span class="s">&#39;[=[</span><span class="nv"> </span><span class="s">{</span><span class="nv"> </span><span class="s">&quot;access&quot;:</span><span class="nv"> </span><span class="s">[</span><span class="nv"> </span><span class="s">{</span><span class="nv"> </span><span class="s">&quot;actions&quot;:</span><span class="nv"> </span><span class="s">{</span><span class="nv"> </span><span class="s">&quot;disrupt&quot;</span><span class="nv"> </span><span class="s">:</span><span class="nv"> </span><span class="s">&quot;DENY&quot;</span><span class="nv"> </span><span class="s">},</span><span class="nv"> </span><span class="s">&quot;id&quot;:</span><span class="nv"> </span><span class="s">10001,</span><span class="nv"> </span><span class="s">&quot;msg&quot;:</span><span class="nv"> </span><span class="s">&quot;my</span><span class="nv"> </span><span class="s">custom</span><span class="nv"> </span><span class="s">rule&quot;,</span><span class="nv"> </span><span class="s">&quot;operator&quot;:</span><span class="nv"> </span><span class="s">&quot;STR_CONTAINS&quot;,</span><span class="nv"> </span><span class="s">&quot;pattern&quot;:</span><span class="nv"> </span><span class="s">&quot;foo&quot;,</span><span class="nv"> </span><span class="s">&quot;vars&quot;:</span><span class="nv"> </span><span class="s">[</span><span class="nv"> </span><span class="s">{</span><span class="nv"> </span><span class="s">&quot;parse&quot;:</span><span class="nv"> </span><span class="s">[</span><span class="nv"> </span><span class="s">&quot;values&quot;,</span><span class="nv"> </span><span class="s">1</span><span class="nv"> </span><span class="s">],</span><span class="nv"> </span><span class="s">&quot;type&quot;:</span><span class="nv"> </span><span class="s">&quot;REQUEST_ARGS&quot;</span><span class="nv"> </span><span class="s">}</span><span class="nv"> </span><span class="s">]</span><span class="nv"> </span><span class="s">}</span><span class="nv"> </span><span class="s">],</span><span class="nv"> </span><span class="s">&quot;body_filter&quot;:</span><span class="nv"> </span><span class="s">[],</span><span class="nv"> </span><span class="s">&quot;header_filter&quot;:[]</span><span class="nv"> </span><span class="s">}</span><span class="nv"> </span><span class="s">]=]&#39;</span>
</pre></div> </code></pre></div>
<p>Since the default allowed contents were <code class="codehilite">&quot;text/html&quot;, &quot;text/json&quot;, &quot;application/json&quot;</code> <p>Since the default allowed contents were <code class="codehilite"><span class="err">&quot;text/html&quot;, &quot;text/json&quot;, &quot;application/json&quot;</span></code>
We can enable the following annotation for allow all contents type:</p> We can enable the following annotation for allow all contents type:</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/lua-resty-waf-allow-unknown-content-types</span><span class="p">:</span> <span class="s">&quot;true&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/lua-resty-waf-allow-unknown-content-types</span><span class="p">:</span> <span class="s">&quot;true&quot;</span>
</pre></div> </code></pre></div>
<p>The default score of lua-resty-waf is 5, which usually triggered if hitting 2 default rules, you can modify the score threshold with following annotation:</p> <p>The default score of lua-resty-waf is 5, which usually triggered if hitting 2 default rules, you can modify the score threshold with following annotation:</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/lua-resty-waf-score-threshold</span><span class="p">:</span> <span class="s">&quot;10&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/lua-resty-waf-score-threshold</span><span class="p">:</span> <span class="s">&quot;10&quot;</span>
</pre></div> </code></pre></div>
<p>When you enabled HTTPS in the endpoint and since resty-lua will return 500 error when processing "multipart" contents <p>When you enabled HTTPS in the endpoint and since resty-lua will return 500 error when processing "multipart" contents
Reference for this <a href="https://github.com/p0pr0ck5/lua-resty-waf/issues/166">issue</a></p> Reference for this <a href="https://github.com/p0pr0ck5/lua-resty-waf/issues/166">issue</a></p>
<p>By default, it will be "true"</p> <p>By default, it will be "true"</p>
<p>You may enable the following annotation for work around:</p> <p>You may enable the following annotation for work around:</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/lua-resty-waf-process-multipart-body</span><span class="p">:</span> <span class="s">&quot;false&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/lua-resty-waf-process-multipart-body</span><span class="p">:</span> <span class="s">&quot;false&quot;</span>
</pre></div> </code></pre></div>
<p>For details on how to write WAF rules, please refer to <a href="https://github.com/p0pr0ck5/lua-resty-waf">https://github.com/p0pr0ck5/lua-resty-waf</a>.</p> <p>For details on how to write WAF rules, please refer to <a href="https://github.com/p0pr0ck5/lua-resty-waf">https://github.com/p0pr0ck5/lua-resty-waf</a>.</p>
<h3 id="modsecurity">ModSecurity<a class="headerlink" href="#modsecurity" title="Permanent link"></a></h3> <h3 id="modsecurity">ModSecurity<a class="headerlink" href="#modsecurity" title="Permanent link"></a></h3>
@ -2908,45 +2911,45 @@ of ingress locations. The ModSecurity module must first be enabled by enabling M
<a href="../configmap/#enable-modsecurity">ConfigMap</a>. Note this will enable ModSecurity for all paths, and each path <a href="../configmap/#enable-modsecurity">ConfigMap</a>. Note this will enable ModSecurity for all paths, and each path
must be disabled manually.</p> must be disabled manually.</p>
<p>It can be enabled using the following annotation: <p>It can be enabled using the following annotation:
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/enable-modsecurity</span><span class="p">:</span> <span class="s">&quot;true&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/enable-modsecurity</span><span class="p">:</span> <span class="s">&quot;true&quot;</span>
</pre></div> </code></pre></div>
ModSecurity will run in "Detection-Only" mode using the <a href="https://github.com/SpiderLabs/ModSecurity/blob/v3/master/modsecurity.conf-recommended">recommended configuration</a>.</p> ModSecurity will run in "Detection-Only" mode using the <a href="https://github.com/SpiderLabs/ModSecurity/blob/v3/master/modsecurity.conf-recommended">recommended configuration</a>.</p>
<p>You can enable the <a href="https://www.modsecurity.org/CRS/Documentation/">OWASP Core Rule Set</a> by <p>You can enable the <a href="https://www.modsecurity.org/CRS/Documentation/">OWASP Core Rule Set</a> by
setting the following annotation: setting the following annotation:
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/enable-owasp-core-rules</span><span class="p">:</span> <span class="s">&quot;true&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/enable-owasp-core-rules</span><span class="p">:</span> <span class="s">&quot;true&quot;</span>
</pre></div></p> </code></pre></div></p>
<p>You can pass transactionIDs from nginx by setting up the following: <p>You can pass transactionIDs from nginx by setting up the following:
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/modsecurity-transaction-id</span><span class="p">:</span> <span class="s">&quot;$request_id&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/modsecurity-transaction-id</span><span class="p">:</span> <span class="s">&quot;$request_id&quot;</span>
</pre></div></p> </code></pre></div></p>
<p>You can also add your own set of modsecurity rules via a snippet: <p>You can also add your own set of modsecurity rules via a snippet:
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/modsecurity-snippet</span><span class="p">:</span> <span class="p p-Indicator">|</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/modsecurity-snippet</span><span class="p">:</span> <span class="p p-Indicator">|</span>
<span class="l l-Scalar l-Scalar-Plain">SecRuleEngine On</span> <span class="l l-Scalar l-Scalar-Plain">SecRuleEngine On</span>
<span class="l l-Scalar l-Scalar-Plain">SecDebugLog /tmp/modsec_debug.log</span> <span class="l l-Scalar l-Scalar-Plain">SecDebugLog /tmp/modsec_debug.log</span>
</pre></div></p> </code></pre></div></p>
<p>Note: If you use both <code class="codehilite">enable-owasp-core-rules</code> and <code class="codehilite">modsecurity-snippet</code> annotations together, only the <p>Note: If you use both <code class="codehilite"><span class="err">enable-owasp-core-rules</span></code> and <code class="codehilite"><span class="err">modsecurity-snippet</span></code> annotations together, only the
<code class="codehilite">modsecurity-snippet</code> will take effect. If you wish to include the <a href="https://www.modsecurity.org/CRS/Documentation/">OWASP Core Rule Set</a> or <code class="codehilite"><span class="err">modsecurity-snippet</span></code> will take effect. If you wish to include the <a href="https://www.modsecurity.org/CRS/Documentation/">OWASP Core Rule Set</a> or
<a href="https://github.com/SpiderLabs/ModSecurity/blob/v3/master/modsecurity.conf-recommended">recommended configuration</a> simply use the include <a href="https://github.com/SpiderLabs/ModSecurity/blob/v3/master/modsecurity.conf-recommended">recommended configuration</a> simply use the include
statement:</p> statement:</p>
<p>nginx 0.24.1 and below <p>nginx 0.24.1 and below
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/modsecurity-snippet</span><span class="p">:</span> <span class="p p-Indicator">|</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/modsecurity-snippet</span><span class="p">:</span> <span class="p p-Indicator">|</span>
<span class="l l-Scalar l-Scalar-Plain">Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf</span> <span class="l l-Scalar l-Scalar-Plain">Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf</span>
<span class="l l-Scalar l-Scalar-Plain">Include /etc/nginx/modsecurity/modsecurity.conf</span> <span class="l l-Scalar l-Scalar-Plain">Include /etc/nginx/modsecurity/modsecurity.conf</span>
</pre></div> </code></pre></div>
nginx 0.25.0 and above nginx 0.25.0 and above
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/modsecurity-snippet</span><span class="p">:</span> <span class="p p-Indicator">|</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/modsecurity-snippet</span><span class="p">:</span> <span class="p p-Indicator">|</span>
<span class="l l-Scalar l-Scalar-Plain">Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf</span> <span class="l l-Scalar l-Scalar-Plain">Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf</span>
</pre></div></p> </code></pre></div></p>
<h3 id="influxdb">InfluxDB<a class="headerlink" href="#influxdb" title="Permanent link"></a></h3> <h3 id="influxdb">InfluxDB<a class="headerlink" href="#influxdb" title="Permanent link"></a></h3>
<p>Using <code class="codehilite">influxdb-*</code> annotations we can monitor requests passing through a Location by sending them to an InfluxDB backend exposing the UDP socket <p>Using <code class="codehilite"><span class="err">influxdb-*</span></code> annotations we can monitor requests passing through a Location by sending them to an InfluxDB backend exposing the UDP socket
using the <a href="https://github.com/influxdata/nginx-influxdb-module/">nginx-influxdb-module</a>.</p> using the <a href="https://github.com/influxdata/nginx-influxdb-module/">nginx-influxdb-module</a>.</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/enable-influxdb</span><span class="p">:</span> <span class="s">&quot;true&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/enable-influxdb</span><span class="p">:</span> <span class="s">&quot;true&quot;</span>
<span class="nt">nginx.ingress.kubernetes.io/influxdb-measurement</span><span class="p">:</span> <span class="s">&quot;nginx-reqs&quot;</span> <span class="nt">nginx.ingress.kubernetes.io/influxdb-measurement</span><span class="p">:</span> <span class="s">&quot;nginx-reqs&quot;</span>
<span class="nt">nginx.ingress.kubernetes.io/influxdb-port</span><span class="p">:</span> <span class="s">&quot;8089&quot;</span> <span class="nt">nginx.ingress.kubernetes.io/influxdb-port</span><span class="p">:</span> <span class="s">&quot;8089&quot;</span>
<span class="nt">nginx.ingress.kubernetes.io/influxdb-host</span><span class="p">:</span> <span class="s">&quot;127.0.0.1&quot;</span> <span class="nt">nginx.ingress.kubernetes.io/influxdb-host</span><span class="p">:</span> <span class="s">&quot;127.0.0.1&quot;</span>
<span class="nt">nginx.ingress.kubernetes.io/influxdb-server-name</span><span class="p">:</span> <span class="s">&quot;nginx-ingress&quot;</span> <span class="nt">nginx.ingress.kubernetes.io/influxdb-server-name</span><span class="p">:</span> <span class="s">&quot;nginx-ingress&quot;</span>
</pre></div> </code></pre></div>
<p>For the <code class="codehilite">influxdb-host</code> parameter you have two options:</p> <p>For the <code class="codehilite"><span class="err">influxdb-host</span></code> parameter you have two options:</p>
<ul> <ul>
<li>Use an InfluxDB server configured with the <a href="https://docs.influxdata.com/influxdb/v1.5/supported_protocols/udp/">UDP protocol</a> enabled.</li> <li>Use an InfluxDB server configured with the <a href="https://docs.influxdata.com/influxdb/v1.5/supported_protocols/udp/">UDP protocol</a> enabled.</li>
<li>Deploy Telegraf as a sidecar proxy to the Ingress controller configured to listen UDP with the <a href="https://github.com/influxdata/telegraf/tree/release-1.6/plugins/inputs/socket_listener">socket listener input</a> and to write using <li>Deploy Telegraf as a sidecar proxy to the Ingress controller configured to listen UDP with the <a href="https://github.com/influxdata/telegraf/tree/release-1.6/plugins/inputs/socket_listener">socket listener input</a> and to write using
@ -2954,48 +2957,49 @@ anyone of the <a href="https://github.com/influxdata/telegraf/tree/release-1.7/p
Prometheus, etc.. (recommended)</li> Prometheus, etc.. (recommended)</li>
</ul> </ul>
<p>It's important to remember that there's no DNS resolver at this stage so you will have to configure <p>It's important to remember that there's no DNS resolver at this stage so you will have to configure
an ip address to <code class="codehilite">nginx.ingress.kubernetes.io/influxdb-host</code>. If you deploy Influx or Telegraf as sidecar (another container in the same pod) this becomes straightforward since you can directly use <code class="codehilite">127.0.0.1</code>.</p> an ip address to <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/influxdb-host</span></code>. If you deploy Influx or Telegraf as sidecar (another container in the same pod) this becomes straightforward since you can directly use <code class="codehilite"><span class="err">127.0.0.1</span></code>.</p>
<h3 id="backend-protocol">Backend Protocol<a class="headerlink" href="#backend-protocol" title="Permanent link"></a></h3> <h3 id="backend-protocol">Backend Protocol<a class="headerlink" href="#backend-protocol" title="Permanent link"></a></h3>
<p>Using <code class="codehilite">backend-protocol</code> annotations is possible to indicate how NGINX should communicate with the backend service. (Replaces <code class="codehilite">secure-backends</code> in older versions) <p>Using <code class="codehilite"><span class="err">backend-protocol</span></code> annotations is possible to indicate how NGINX should communicate with the backend service. (Replaces <code class="codehilite"><span class="err">secure-backends</span></code> in older versions)
Valid Values: HTTP, HTTPS, GRPC, GRPCS and AJP</p> Valid Values: HTTP, HTTPS, GRPC, GRPCS and AJP</p>
<p>By default NGINX uses <code class="codehilite">HTTP</code>.</p> <p>By default NGINX uses <code class="codehilite"><span class="err">HTTP</span></code>.</p>
<p>Example:</p> <p>Example:</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/backend-protocol</span><span class="p">:</span> <span class="s">&quot;HTTPS&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/backend-protocol</span><span class="p">:</span> <span class="s">&quot;HTTPS&quot;</span>
</pre></div> </code></pre></div>
<h3 id="use-regex">Use Regex<a class="headerlink" href="#use-regex" title="Permanent link"></a></h3> <h3 id="use-regex">Use Regex<a class="headerlink" href="#use-regex" title="Permanent link"></a></h3>
<div class="admonition attention"> <div class="admonition attention">
<p class="admonition-title">Attention</p> <p class="admonition-title">Attention</p>
<p>When using this annotation with the NGINX annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/affinity</span></code> of type <code class="codehilite"><span class="err">cookie</span></code>, <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/session-cookie-path</span></code> must be also set; Session cookie paths do not support regex.</p>
</div> </div>
<p>When using this annotation with the NGINX annotation <code class="codehilite">nginx.ingress.kubernetes.io/affinity</code> of type <code class="codehilite">cookie</code>, <code class="codehilite">nginx.ingress.kubernetes.io/session-cookie-path</code> must be also set; Session cookie paths do not support regex.</p> <p>Using the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/use-regex</span></code> annotation will indicate whether or not the paths defined on an Ingress use regular expressions. The default value is <code class="codehilite"><span class="err">false</span></code>.</p>
<p>Using the <code class="codehilite">nginx.ingress.kubernetes.io/use-regex</code> annotation will indicate whether or not the paths defined on an Ingress use regular expressions. The default value is <code class="codehilite">false</code>.</p>
<p>The following will indicate that regular expression paths are being used: <p>The following will indicate that regular expression paths are being used:
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/use-regex</span><span class="p">:</span> <span class="s">&quot;true&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/use-regex</span><span class="p">:</span> <span class="s">&quot;true&quot;</span>
</pre></div></p> </code></pre></div></p>
<p>The following will indicate that regular expression paths are <strong>not</strong> being used: <p>The following will indicate that regular expression paths are <strong>not</strong> being used:
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/use-regex</span><span class="p">:</span> <span class="s">&quot;false&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/use-regex</span><span class="p">:</span> <span class="s">&quot;false&quot;</span>
</pre></div></p> </code></pre></div></p>
<p>When this annotation is set to <code class="codehilite">true</code>, the case insensitive regular expression <a href="https://nginx.org/en/docs/http/ngx_http_core_module.html#location">location modifier</a> will be enforced on ALL paths for a given host regardless of what Ingress they are defined on.</p> <p>When this annotation is set to <code class="codehilite"><span class="err">true</span></code>, the case insensitive regular expression <a href="https://nginx.org/en/docs/http/ngx_http_core_module.html#location">location modifier</a> will be enforced on ALL paths for a given host regardless of what Ingress they are defined on.</p>
<p>Additionally, if the <a href="#rewrite"><code class="codehilite">rewrite-target</code> annotation</a> is used on any Ingress for a given host, then the case insensitive regular expression <a href="https://nginx.org/en/docs/http/ngx_http_core_module.html#location">location modifier</a> will be enforced on ALL paths for a given host regardless of what Ingress they are defined on.</p> <p>Additionally, if the <a href="#rewrite"><code class="codehilite"><span class="err">rewrite-target</span></code> annotation</a> is used on any Ingress for a given host, then the case insensitive regular expression <a href="https://nginx.org/en/docs/http/ngx_http_core_module.html#location">location modifier</a> will be enforced on ALL paths for a given host regardless of what Ingress they are defined on.</p>
<p>Please read about <a href="../../ingress-path-matching/">ingress path matching</a> before using this modifier.</p> <p>Please read about <a href="../../ingress-path-matching/">ingress path matching</a> before using this modifier.</p>
<h3 id="satisfy">Satisfy<a class="headerlink" href="#satisfy" title="Permanent link"></a></h3> <h3 id="satisfy">Satisfy<a class="headerlink" href="#satisfy" title="Permanent link"></a></h3>
<p>By default, a request would need to satisfy all authentication requirements in order to be allowed. By using this annotation, requests that satisfy either any or all authentication requirements are allowed, based on the configuration value.</p> <p>By default, a request would need to satisfy all authentication requirements in order to be allowed. By using this annotation, requests that satisfy either any or all authentication requirements are allowed, based on the configuration value.</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/satisfy</span><span class="p">:</span> <span class="s">&quot;any&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/satisfy</span><span class="p">:</span> <span class="s">&quot;any&quot;</span>
</pre></div> </code></pre></div>
<h3 id="mirror">Mirror<a class="headerlink" href="#mirror" title="Permanent link"></a></h3> <h3 id="mirror">Mirror<a class="headerlink" href="#mirror" title="Permanent link"></a></h3>
<p>Enables a request to be mirrored to a mirror backend. Responses by mirror backends are ignored. This feature is useful, to see how requests will react in "test" backends.</p> <p>Enables a request to be mirrored to a mirror backend. Responses by mirror backends are ignored. This feature is useful, to see how requests will react in "test" backends.</p>
<p>The mirror backend can be set by applying:</p> <p>The mirror backend can be set by applying:</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/mirror-target</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">https://test.env.com/$request_uri</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/mirror-target</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">https://test.env.com/$request_uri</span>
</pre></div> </code></pre></div>
<p>By default the request-body is sent to the mirror backend, but can be turned off by applying:</p> <p>By default the request-body is sent to the mirror backend, but can be turned off by applying:</p>
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/mirror-request-body</span><span class="p">:</span> <span class="s">&quot;off&quot;</span> <div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/mirror-request-body</span><span class="p">:</span> <span class="s">&quot;off&quot;</span>
</pre></div> </code></pre></div>
<p><strong>Note:</strong> The mirror directive will be applied to all paths within the ingress resource.</p> <p><strong>Note:</strong> The mirror directive will be applied to all paths within the ingress resource.</p>
<p>The request sent to the mirror is linked to the orignial request. If you have a slow mirror backend, then the orignial request will throttle.</p> <p>The request sent to the mirror is linked to the orignial request. If you have a slow mirror backend, then the orignial request will throttle.</p>
<p>For more information on the mirror module see https://nginx.org/en/docs/http/ngx_http_mirror_module.html</p> <p>For more information on the mirror module see <a href="https://nginx.org/en/docs/http/ngx_http_mirror_module.html">ngx_http_mirror_module</a></p>
@ -3053,9 +3057,9 @@ Valid Values: HTTP, HTTPS, GRPC, GRPCS and AJP</p>
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -3065,7 +3069,7 @@ Valid Values: HTTP, HTTPS, GRPC, GRPCS and AJP</p>
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#configmaps" tabindex="1" class="md-skip"> <a href="#configmaps" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -3301,17 +3301,17 @@
components for the nginx-controller.</p> components for the nginx-controller.</p>
<p>In order to overwrite nginx-controller configuration values as seen in <a href="https://github.com/kubernetes/ingress-nginx/blob/master/internal/ingress/controller/config/config.go">config.go</a>, <p>In order to overwrite nginx-controller configuration values as seen in <a href="https://github.com/kubernetes/ingress-nginx/blob/master/internal/ingress/controller/config/config.go">config.go</a>,
you can add key-value pairs to the data section of the config-map. For Example:</p> you can add key-value pairs to the data section of the config-map. For Example:</p>
<div class="codehilite"><pre><span></span><span class="nt">data</span><span class="p">:</span> <div class="codehilite"><pre><span></span><code><span class="nt">data</span><span class="p">:</span>
<span class="nt">map-hash-bucket-size</span><span class="p">:</span> <span class="s">&quot;128&quot;</span> <span class="nt">map-hash-bucket-size</span><span class="p">:</span> <span class="s">&quot;128&quot;</span>
<span class="nt">ssl-protocols</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">SSLv2</span> <span class="nt">ssl-protocols</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">SSLv2</span>
</pre></div> </code></pre></div>
<div class="admonition important"> <div class="admonition important">
<p class="admonition-title">Important</p> <p class="admonition-title">Important</p>
<p>The key and values in a ConfigMap can only be strings. <p>The key and values in a ConfigMap can only be strings.
This means that we want a value with boolean values we need to quote the values, like "true" or "false". This means that we want a value with boolean values we need to quote the values, like "true" or "false".
Same for numbers, like "100".</p> Same for numbers, like "100".</p>
<p>"Slice" types (defined below as <code class="codehilite">[]string</code> or <code class="codehilite">[]int</code> can be provided as a comma-delimited string.</p> <p>"Slice" types (defined below as <code class="codehilite"><span class="err">[]string</span></code> or <code class="codehilite"><span class="err">[]int</span></code> can be provided as a comma-delimited string.</p>
</div> </div>
<h2 id="configuration-options">Configuration options<a class="headerlink" href="#configuration-options" title="Permanent link"></a></h2> <h2 id="configuration-options">Configuration options<a class="headerlink" href="#configuration-options" title="Permanent link"></a></h2>
<p>The following table shows a configuration option's name, type, and the default value:</p> <p>The following table shows a configuration option's name, type, and the default value:</p>
@ -3492,12 +3492,12 @@ Same for numbers, like "100".</p>
<tr> <tr>
<td align="left"><a href="#log-format-upstream">log-format-upstream</a></td> <td align="left"><a href="#log-format-upstream">log-format-upstream</a></td>
<td align="left">string</td> <td align="left">string</td>
<td align="left"><code class="codehilite">$remote_addr - $remote_user [$time_local] &quot;$request&quot; $status $body_bytes_sent &quot;$http_referer&quot; &quot;$http_user_agent&quot; $request_length $request_time [$proxy_upstream_name] [$proxy_alternative_upstream_name] $upstream_addr $upstream_response_length $upstream_response_time $upstream_status $req_id</code></td> <td align="left"><code class="codehilite"><span class="err">$remote_addr - $remote_user [$time_local] &quot;$request&quot; $status $body_bytes_sent &quot;$http_referer&quot; &quot;$http_user_agent&quot; $request_length $request_time [$proxy_upstream_name] [$proxy_alternative_upstream_name] $upstream_addr $upstream_response_length $upstream_response_time $upstream_status $req_id</span></code></td>
</tr> </tr>
<tr> <tr>
<td align="left"><a href="#log-format-stream">log-format-stream</a></td> <td align="left"><a href="#log-format-stream">log-format-stream</a></td>
<td align="left">string</td> <td align="left">string</td>
<td align="left"><code class="codehilite">[$remote_addr] [$time_local] $protocol $status $bytes_sent $bytes_received $session_time</code></td> <td align="left"><code class="codehilite"><span class="err">[$remote_addr] [$time_local] $protocol $status $bytes_sent $bytes_received $session_time</span></code></td>
</tr> </tr>
<tr> <tr>
<td align="left"><a href="#enable-multi-accept">enable-multi-accept</a></td> <td align="left"><a href="#enable-multi-accept">enable-multi-accept</a></td>
@ -3547,7 +3547,7 @@ Same for numbers, like "100".</p>
<tr> <tr>
<td align="left"><a href="#server-name-hash-bucket-size">server-name-hash-bucket-size</a></td> <td align="left"><a href="#server-name-hash-bucket-size">server-name-hash-bucket-size</a></td>
<td align="left">int</td> <td align="left">int</td>
<td align="left"><code class="codehilite">&lt;size of the processors cache line&gt;</code></td> <td align="left"><code class="codehilite"><span class="err">&lt;size of the processors cache line&gt;</span></code></td>
</tr> </tr>
<tr> <tr>
<td align="left"><a href="#proxy-headers-hash-max-size">proxy-headers-hash-max-size</a></td> <td align="left"><a href="#proxy-headers-hash-max-size">proxy-headers-hash-max-size</a></td>
@ -3607,7 +3607,7 @@ Same for numbers, like "100".</p>
<tr> <tr>
<td align="left"><a href="#ssl-session-ticket-key">ssl-session-ticket-key</a></td> <td align="left"><a href="#ssl-session-ticket-key">ssl-session-ticket-key</a></td>
<td align="left">string</td> <td align="left">string</td>
<td align="left"><code class="codehilite">&lt;Randomly Generated&gt;</code></td> <td align="left"><code class="codehilite"><span class="err">&lt;Randomly Generated&gt;</span></code></td>
</tr> </tr>
<tr> <tr>
<td align="left"><a href="#ssl-session-timeout">ssl-session-timeout</a></td> <td align="left"><a href="#ssl-session-timeout">ssl-session-timeout</a></td>
@ -3677,7 +3677,7 @@ Same for numbers, like "100".</p>
<tr> <tr>
<td align="left"><a href="#worker-processes">worker-processes</a></td> <td align="left"><a href="#worker-processes">worker-processes</a></td>
<td align="left">string</td> <td align="left">string</td>
<td align="left"><code class="codehilite">&lt;Number of CPUs&gt;</code></td> <td align="left"><code class="codehilite"><span class="err">&lt;Number of CPUs&gt;</span></code></td>
</tr> </tr>
<tr> <tr>
<td align="left"><a href="#worker-cpu-affinity">worker-cpu-affinity</a></td> <td align="left"><a href="#worker-cpu-affinity">worker-cpu-affinity</a></td>
@ -4095,13 +4095,13 @@ Same for numbers, like "100".</p>
<p><em>References:</em> <p><em>References:</em>
<a href="http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log">http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log</a></p> <a href="http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log">http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log</a></p>
<h2 id="access-log-path">access-log-path<a class="headerlink" href="#access-log-path" title="Permanent link"></a></h2> <h2 id="access-log-path">access-log-path<a class="headerlink" href="#access-log-path" title="Permanent link"></a></h2>
<p>Access log path. Goes to <code class="codehilite">/var/log/nginx/access.log</code> by default.</p> <p>Access log path. Goes to <code class="codehilite"><span class="err">/var/log/nginx/access.log</span></code> by default.</p>
<p><strong>Note:</strong> the file <code class="codehilite">/var/log/nginx/access.log</code> is a symlink to <code class="codehilite">/dev/stdout</code></p> <p><strong>Note:</strong> the file <code class="codehilite"><span class="err">/var/log/nginx/access.log</span></code> is a symlink to <code class="codehilite"><span class="err">/dev/stdout</span></code></p>
<h2 id="enable-access-log-for-default-backend">enable-access-log-for-default-backend<a class="headerlink" href="#enable-access-log-for-default-backend" title="Permanent link"></a></h2> <h2 id="enable-access-log-for-default-backend">enable-access-log-for-default-backend<a class="headerlink" href="#enable-access-log-for-default-backend" title="Permanent link"></a></h2>
<p>Enables logging access to default backend. <em><strong>default:</strong></em> is disabled.</p> <p>Enables logging access to default backend. <em><strong>default:</strong></em> is disabled.</p>
<h2 id="error-log-path">error-log-path<a class="headerlink" href="#error-log-path" title="Permanent link"></a></h2> <h2 id="error-log-path">error-log-path<a class="headerlink" href="#error-log-path" title="Permanent link"></a></h2>
<p>Error log path. Goes to <code class="codehilite">/var/log/nginx/error.log</code> by default.</p> <p>Error log path. Goes to <code class="codehilite"><span class="err">/var/log/nginx/error.log</span></code> by default.</p>
<p><strong>Note:</strong> the file <code class="codehilite">/var/log/nginx/error.log</code> is a symlink to <code class="codehilite">/dev/stderr</code></p> <p><strong>Note:</strong> the file <code class="codehilite"><span class="err">/var/log/nginx/error.log</span></code> is a symlink to <code class="codehilite"><span class="err">/dev/stderr</span></code></p>
<p><em>References:</em> <p><em>References:</em>
<a href="http://nginx.org/en/docs/ngx_core_module.html#error_log">http://nginx.org/en/docs/ngx_core_module.html#error_log</a></p> <a href="http://nginx.org/en/docs/ngx_core_module.html#error_log">http://nginx.org/en/docs/ngx_core_module.html#error_log</a></p>
<h2 id="enable-modsecurity">enable-modsecurity<a class="headerlink" href="#enable-modsecurity" title="Permanent link"></a></h2> <h2 id="enable-modsecurity">enable-modsecurity<a class="headerlink" href="#enable-modsecurity" title="Permanent link"></a></h2>
@ -4131,9 +4131,9 @@ Same for numbers, like "100".</p>
<p><em>References:</em> <p><em>References:</em>
<a href="http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log">http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log</a></p> <a href="http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log">http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log</a></p>
<h2 id="disable-ipv6">disable-ipv6<a class="headerlink" href="#disable-ipv6" title="Permanent link"></a></h2> <h2 id="disable-ipv6">disable-ipv6<a class="headerlink" href="#disable-ipv6" title="Permanent link"></a></h2>
<p>Disable listening on IPV6. <em><strong>default:</strong></em> <code class="codehilite">false</code>; IPv6 listening is enabled</p> <p>Disable listening on IPV6. <em><strong>default:</strong></em> <code class="codehilite"><span class="err">false</span></code>; IPv6 listening is enabled</p>
<h2 id="disable-ipv6-dns">disable-ipv6-dns<a class="headerlink" href="#disable-ipv6-dns" title="Permanent link"></a></h2> <h2 id="disable-ipv6-dns">disable-ipv6-dns<a class="headerlink" href="#disable-ipv6-dns" title="Permanent link"></a></h2>
<p>Disable IPV6 for nginx DNS resolver. <em><strong>default:</strong></em> <code class="codehilite">false</code>; IPv6 resolving enabled.</p> <p>Disable IPV6 for nginx DNS resolver. <em><strong>default:</strong></em> <code class="codehilite"><span class="err">false</span></code>; IPv6 resolving enabled.</p>
<h2 id="enable-underscores-in-headers">enable-underscores-in-headers<a class="headerlink" href="#enable-underscores-in-headers" title="Permanent link"></a></h2> <h2 id="enable-underscores-in-headers">enable-underscores-in-headers<a class="headerlink" href="#enable-underscores-in-headers" title="Permanent link"></a></h2>
<p>Enables underscores in header names. <em><strong>default:</strong></em> is disabled</p> <p>Enables underscores in header names. <em><strong>default:</strong></em> is disabled</p>
<h2 id="ignore-invalid-headers">ignore-invalid-headers<a class="headerlink" href="#ignore-invalid-headers" title="Permanent link"></a></h2> <h2 id="ignore-invalid-headers">ignore-invalid-headers<a class="headerlink" href="#ignore-invalid-headers" title="Permanent link"></a></h2>
@ -4192,11 +4192,11 @@ HTTP Strict Transport Security (often abbreviated as HSTS) is a security feature
<h2 id="log-format-upstream">log-format-upstream<a class="headerlink" href="#log-format-upstream" title="Permanent link"></a></h2> <h2 id="log-format-upstream">log-format-upstream<a class="headerlink" href="#log-format-upstream" title="Permanent link"></a></h2>
<p>Sets the nginx <a href="http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format">log format</a>. <p>Sets the nginx <a href="http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format">log format</a>.
Example for json output:</p> Example for json output:</p>
<div class="codehilite"><pre><span></span><span class="err">log-format-upstream:</span> <span class="err">&#39;</span><span class="p">{</span><span class="nt">&quot;time&quot;</span><span class="p">:</span> <span class="s2">&quot;$time_iso8601&quot;</span><span class="p">,</span> <span class="nt">&quot;remote_addr&quot;</span><span class="p">:</span> <span class="s2">&quot;$proxy_protocol_addr&quot;</span><span class="p">,</span> <span class="nt">&quot;x-forward-for&quot;</span><span class="p">:</span> <span class="s2">&quot;$proxy_add_x_forwarded_for&quot;</span><span class="p">,</span> <span class="nt">&quot;request_id&quot;</span><span class="p">:</span> <span class="s2">&quot;$req_id&quot;</span><span class="p">,</span> <div class="codehilite"><pre><span></span><code><span class="err">log-format-upstream:</span> <span class="err">&#39;</span><span class="p">{</span><span class="nt">&quot;time&quot;</span><span class="p">:</span> <span class="s2">&quot;$time_iso8601&quot;</span><span class="p">,</span> <span class="nt">&quot;remote_addr&quot;</span><span class="p">:</span> <span class="s2">&quot;$proxy_protocol_addr&quot;</span><span class="p">,</span> <span class="nt">&quot;x-forward-for&quot;</span><span class="p">:</span> <span class="s2">&quot;$proxy_add_x_forwarded_for&quot;</span><span class="p">,</span> <span class="nt">&quot;request_id&quot;</span><span class="p">:</span> <span class="s2">&quot;$req_id&quot;</span><span class="p">,</span>
<span class="nt">&quot;remote_user&quot;</span><span class="p">:</span> <span class="s2">&quot;$remote_user&quot;</span><span class="p">,</span> <span class="nt">&quot;bytes_sent&quot;</span><span class="p">:</span> <span class="err">$bytes_sent</span><span class="p">,</span> <span class="nt">&quot;request_time&quot;</span><span class="p">:</span> <span class="err">$request_time</span><span class="p">,</span> <span class="nt">&quot;status&quot;</span><span class="p">:</span><span class="err">$status</span><span class="p">,</span> <span class="nt">&quot;vhost&quot;</span><span class="p">:</span> <span class="s2">&quot;$host&quot;</span><span class="p">,</span> <span class="nt">&quot;request_proto&quot;</span><span class="p">:</span> <span class="s2">&quot;$server_protocol&quot;</span><span class="p">,</span> <span class="nt">&quot;remote_user&quot;</span><span class="p">:</span> <span class="s2">&quot;$remote_user&quot;</span><span class="p">,</span> <span class="nt">&quot;bytes_sent&quot;</span><span class="p">:</span> <span class="err">$bytes_sent</span><span class="p">,</span> <span class="nt">&quot;request_time&quot;</span><span class="p">:</span> <span class="err">$request_time</span><span class="p">,</span> <span class="nt">&quot;status&quot;</span><span class="p">:</span><span class="err">$status</span><span class="p">,</span> <span class="nt">&quot;vhost&quot;</span><span class="p">:</span> <span class="s2">&quot;$host&quot;</span><span class="p">,</span> <span class="nt">&quot;request_proto&quot;</span><span class="p">:</span> <span class="s2">&quot;$server_protocol&quot;</span><span class="p">,</span>
<span class="nt">&quot;path&quot;</span><span class="p">:</span> <span class="s2">&quot;$uri&quot;</span><span class="p">,</span> <span class="nt">&quot;request_query&quot;</span><span class="p">:</span> <span class="s2">&quot;$args&quot;</span><span class="p">,</span> <span class="nt">&quot;request_length&quot;</span><span class="p">:</span> <span class="err">$request_length</span><span class="p">,</span> <span class="nt">&quot;duration&quot;</span><span class="p">:</span> <span class="err">$request_time</span><span class="p">,</span><span class="nt">&quot;method&quot;</span><span class="p">:</span> <span class="s2">&quot;$request_method&quot;</span><span class="p">,</span> <span class="nt">&quot;http_referrer&quot;</span><span class="p">:</span> <span class="s2">&quot;$http_referer&quot;</span><span class="p">,</span> <span class="nt">&quot;path&quot;</span><span class="p">:</span> <span class="s2">&quot;$uri&quot;</span><span class="p">,</span> <span class="nt">&quot;request_query&quot;</span><span class="p">:</span> <span class="s2">&quot;$args&quot;</span><span class="p">,</span> <span class="nt">&quot;request_length&quot;</span><span class="p">:</span> <span class="err">$request_length</span><span class="p">,</span> <span class="nt">&quot;duration&quot;</span><span class="p">:</span> <span class="err">$request_time</span><span class="p">,</span><span class="nt">&quot;method&quot;</span><span class="p">:</span> <span class="s2">&quot;$request_method&quot;</span><span class="p">,</span> <span class="nt">&quot;http_referrer&quot;</span><span class="p">:</span> <span class="s2">&quot;$http_referer&quot;</span><span class="p">,</span>
<span class="nt">&quot;http_user_agent&quot;</span><span class="p">:</span> <span class="s2">&quot;$http_user_agent&quot;</span> <span class="p">}</span><span class="err">&#39;</span> <span class="nt">&quot;http_user_agent&quot;</span><span class="p">:</span> <span class="s2">&quot;$http_user_agent&quot;</span> <span class="p">}</span><span class="err">&#39;</span>
</pre></div> </code></pre></div>
<p>Please check the <a href="../log-format/">log-format</a> for definition of each field.</p> <p>Please check the <a href="../log-format/">log-format</a> for definition of each field.</p>
<h2 id="log-format-stream">log-format-stream<a class="headerlink" href="#log-format-stream" title="Permanent link"></a></h2> <h2 id="log-format-stream">log-format-stream<a class="headerlink" href="#log-format-stream" title="Permanent link"></a></h2>
@ -4257,7 +4257,7 @@ The default of 0 means "max open files (system's limit) / <a href="#worker-proce
<h2 id="ssl-ciphers">ssl-ciphers<a class="headerlink" href="#ssl-ciphers" title="Permanent link"></a></h2> <h2 id="ssl-ciphers">ssl-ciphers<a class="headerlink" href="#ssl-ciphers" title="Permanent link"></a></h2>
<p>Sets the <a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_ciphers">ciphers</a> list to enable. The ciphers are specified in the format understood by the OpenSSL library.</p> <p>Sets the <a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_ciphers">ciphers</a> list to enable. The ciphers are specified in the format understood by the OpenSSL library.</p>
<p>The default cipher list is: <p>The default cipher list is:
<code class="codehilite">ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256</code>.</p> <code class="codehilite"><span class="c">ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256</span></code>.</p>
<p>The ordering of a ciphersuite is very important because it decides which algorithms are going to be selected in priority. The recommendation above prioritizes algorithms that provide perfect <a href="https://wiki.mozilla.org/Security/Server_Side_TLS#Forward_Secrecy">forward secrecy</a>.</p> <p>The ordering of a ciphersuite is very important because it decides which algorithms are going to be selected in priority. The recommendation above prioritizes algorithms that provide perfect <a href="https://wiki.mozilla.org/Security/Server_Side_TLS#Forward_Secrecy">forward secrecy</a>.</p>
<p>Please check the <a href="https://mozilla.github.io/server-side-tls/ssl-config-generator/">Mozilla SSL Configuration Generator</a>.</p> <p>Please check the <a href="https://mozilla.github.io/server-side-tls/ssl-config-generator/">Mozilla SSL Configuration Generator</a>.</p>
<h2 id="ssl-ecdh-curve">ssl-ecdh-curve<a class="headerlink" href="#ssl-ecdh-curve" title="Permanent link"></a></h2> <h2 id="ssl-ecdh-curve">ssl-ecdh-curve<a class="headerlink" href="#ssl-ecdh-curve" title="Permanent link"></a></h2>
@ -4273,12 +4273,12 @@ The default of 0 means "max open files (system's limit) / <a href="#worker-proce
<li><a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_dhparam">http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_dhparam</a></li> <li><a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_dhparam">http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_dhparam</a></li>
</ul> </ul>
<h2 id="ssl-protocols">ssl-protocols<a class="headerlink" href="#ssl-protocols" title="Permanent link"></a></h2> <h2 id="ssl-protocols">ssl-protocols<a class="headerlink" href="#ssl-protocols" title="Permanent link"></a></h2>
<p>Sets the <a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_protocols">SSL protocols</a> to use. The default is: <code class="codehilite">TLSv1.2</code>.</p> <p>Sets the <a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_protocols">SSL protocols</a> to use. The default is: <code class="codehilite"><span class="err">TLSv1.2</span></code>.</p>
<p>Please check the result of the configuration using <code class="codehilite">https://ssllabs.com/ssltest/analyze.html</code> or <code class="codehilite">https://testssl.sh</code>.</p> <p>Please check the result of the configuration using <code class="codehilite"><span class="c">https://ssllabs.com/ssltest/analyze.html</span></code> or <code class="codehilite"><span class="c">https://testssl.sh</span></code>.</p>
<h2 id="ssl-early-data">ssl-early-data<a class="headerlink" href="#ssl-early-data" title="Permanent link"></a></h2> <h2 id="ssl-early-data">ssl-early-data<a class="headerlink" href="#ssl-early-data" title="Permanent link"></a></h2>
<p>Enables or disables TLS 1.3 <a href="https://tools.ietf.org/html/rfc8446#section-2.3">early data</a></p> <p>Enables or disables TLS 1.3 <a href="https://tools.ietf.org/html/rfc8446#section-2.3">early data</a></p>
<p>This requires <code class="codehilite">ssl-protocols</code> to have <code class="codehilite">TLSv1.3</code> enabled.</p> <p>This requires <code class="codehilite"><span class="err">ssl-protocols</span></code> to have <code class="codehilite"><span class="err">TLSv1.3</span></code> enabled.</p>
<p><a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_early_data">ssl_early_data</a>. The default is: <code class="codehilite">false</code>.</p> <p><a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_early_data">ssl_early_data</a>. The default is: <code class="codehilite"><span class="err">false</span></code>.</p>
<h2 id="ssl-session-cache">ssl-session-cache<a class="headerlink" href="#ssl-session-cache" title="Permanent link"></a></h2> <h2 id="ssl-session-cache">ssl-session-cache<a class="headerlink" href="#ssl-session-cache" title="Permanent link"></a></h2>
<p>Enables or disables the use of shared <a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_session_cache">SSL cache</a> among worker processes.</p> <p>Enables or disables the use of shared <a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_session_cache">SSL cache</a> among worker processes.</p>
<h2 id="ssl-session-cache-size">ssl-session-cache-size<a class="headerlink" href="#ssl-session-cache-size" title="Permanent link"></a></h2> <h2 id="ssl-session-cache-size">ssl-session-cache-size<a class="headerlink" href="#ssl-session-cache-size" title="Permanent link"></a></h2>
@ -4287,7 +4287,7 @@ The default of 0 means "max open files (system's limit) / <a href="#worker-proce
<p>Enables or disables session resumption through <a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_session_tickets">TLS session tickets</a>.</p> <p>Enables or disables session resumption through <a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_session_tickets">TLS session tickets</a>.</p>
<h2 id="ssl-session-ticket-key">ssl-session-ticket-key<a class="headerlink" href="#ssl-session-ticket-key" title="Permanent link"></a></h2> <h2 id="ssl-session-ticket-key">ssl-session-ticket-key<a class="headerlink" href="#ssl-session-ticket-key" title="Permanent link"></a></h2>
<p>Sets the secret key used to encrypt and decrypt TLS session tickets. The value must be a valid base64 string. <p>Sets the secret key used to encrypt and decrypt TLS session tickets. The value must be a valid base64 string.
To create a ticket: <code class="codehilite">openssl rand 80 | openssl enc -A -base64</code></p> To create a ticket: <code class="codehilite"><span class="err">openssl rand 80 | openssl enc -A -base64</span></code></p>
<p><a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_session_tickets">TLS session ticket-key</a>, by default, a randomly generated key is used.</p> <p><a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_session_tickets">TLS session ticket-key</a>, by default, a randomly generated key is used.</p>
<h2 id="ssl-session-timeout">ssl-session-timeout<a class="headerlink" href="#ssl-session-timeout" title="Permanent link"></a></h2> <h2 id="ssl-session-timeout">ssl-session-timeout<a class="headerlink" href="#ssl-session-timeout" title="Permanent link"></a></h2>
<p>Sets the time during which a client may <a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_session_timeout">reuse the session</a> parameters stored in a cache.</p> <p>Sets the time during which a client may <a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_session_timeout">reuse the session</a> parameters stored in a cache.</p>
@ -4310,9 +4310,9 @@ To create a ticket: <code class="codehilite">openssl rand 80 | openssl enc -A -b
</blockquote> </blockquote>
<h2 id="use-geoip2">use-geoip2<a class="headerlink" href="#use-geoip2" title="Permanent link"></a></h2> <h2 id="use-geoip2">use-geoip2<a class="headerlink" href="#use-geoip2" title="Permanent link"></a></h2>
<p>Enables the <a href="https://github.com/leev/ngx_http_geoip2_module">geoip2 module</a> for NGINX. <p>Enables the <a href="https://github.com/leev/ngx_http_geoip2_module">geoip2 module</a> for NGINX.
Since <code class="codehilite">0.27.0</code> and due to a <a href="https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases">change in the MaxMind databases</a> a license is required to have access to the databases. Since <code class="codehilite"><span class="err">0.27.0</span></code> and due to a <a href="https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases">change in the MaxMind databases</a> a license is required to have access to the databases.
For this reason, it is required to define a new flag <code class="codehilite">--maxmind-license-key</code> in the ingress controller deployment to download the databases needed during the initialization of the ingress controller. For this reason, it is required to define a new flag <code class="codehilite"><span class="err">--maxmind-license-key</span></code> in the ingress controller deployment to download the databases needed during the initialization of the ingress controller.
Alternatively, it is possible to use a volume to mount the files <code class="codehilite">/etc/nginx/geoip/GeoLite2-City.mmdb</code> and <code class="codehilite">/etc/nginx/geoip/GeoLite2-ASN.mmdb</code>, avoiding the overhead of the download.</p> Alternatively, it is possible to use a volume to mount the files <code class="codehilite"><span class="err">/etc/nginx/geoip/GeoLite2-City.mmdb</span></code> and <code class="codehilite"><span class="err">/etc/nginx/geoip/GeoLite2-ASN.mmdb</span></code>, avoiding the overhead of the download.</p>
<div class="admonition important"> <div class="admonition important">
<p class="admonition-title">Important</p> <p class="admonition-title">Important</p>
<p>If the feature is enabled but the files are missing, GeoIP2 will not be enabled.</p> <p>If the feature is enabled but the files are missing, GeoIP2 will not be enabled.</p>
@ -4320,7 +4320,7 @@ Alternatively, it is possible to use a volume to mount the files <code class="co
<p><em><strong>default:</strong></em> false</p> <p><em><strong>default:</strong></em> false</p>
<h2 id="enable-brotli">enable-brotli<a class="headerlink" href="#enable-brotli" title="Permanent link"></a></h2> <h2 id="enable-brotli">enable-brotli<a class="headerlink" href="#enable-brotli" title="Permanent link"></a></h2>
<p>Enables or disables compression of HTTP responses using the <a href="https://github.com/google/ngx_brotli">"brotli" module</a>. <p>Enables or disables compression of HTTP responses using the <a href="https://github.com/google/ngx_brotli">"brotli" module</a>.
The default mime type list to compress is: <code class="codehilite">application/xml+rss application/atom+xml application/javascript application/x-javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css text/plain text/x-component</code>. <em><strong>default:</strong></em> is disabled</p> The default mime type list to compress is: <code class="codehilite"><span class="err">application/xml+rss application/atom+xml application/javascript application/x-javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css text/plain text/x-component</span></code>. <em><strong>default:</strong></em> is disabled</p>
<blockquote> <blockquote>
<p><strong>Note:</strong> Brotli does not works in Safari &lt; 11. For more information see <a href="https://caniuse.com/#feat=brotli">https://caniuse.com/#feat=brotli</a></p> <p><strong>Note:</strong> Brotli does not works in Safari &lt; 11. For more information see <a href="https://caniuse.com/#feat=brotli">https://caniuse.com/#feat=brotli</a></p>
</blockquote> </blockquote>
@ -4328,14 +4328,14 @@ The default mime type list to compress is: <code class="codehilite">application/
<p>Sets the Brotli Compression Level that will be used. <em><strong>default:</strong></em> 4</p> <p>Sets the Brotli Compression Level that will be used. <em><strong>default:</strong></em> 4</p>
<h2 id="brotli-types">brotli-types<a class="headerlink" href="#brotli-types" title="Permanent link"></a></h2> <h2 id="brotli-types">brotli-types<a class="headerlink" href="#brotli-types" title="Permanent link"></a></h2>
<p>Sets the MIME Types that will be compressed on-the-fly by brotli. <p>Sets the MIME Types that will be compressed on-the-fly by brotli.
<em><strong>default:</strong></em> <code class="codehilite">application/xml+rss application/atom+xml application/javascript application/x-javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css text/plain text/x-component</code></p> <em><strong>default:</strong></em> <code class="codehilite"><span class="err">application/xml+rss application/atom+xml application/javascript application/x-javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css text/plain text/x-component</span></code></p>
<h2 id="use-http2">use-http2<a class="headerlink" href="#use-http2" title="Permanent link"></a></h2> <h2 id="use-http2">use-http2<a class="headerlink" href="#use-http2" title="Permanent link"></a></h2>
<p>Enables or disables <a href="http://nginx.org/en/docs/http/ngx_http_v2_module.html">HTTP/2</a> support in secure connections.</p> <p>Enables or disables <a href="http://nginx.org/en/docs/http/ngx_http_v2_module.html">HTTP/2</a> support in secure connections.</p>
<h2 id="gzip-level">gzip-level<a class="headerlink" href="#gzip-level" title="Permanent link"></a></h2> <h2 id="gzip-level">gzip-level<a class="headerlink" href="#gzip-level" title="Permanent link"></a></h2>
<p>Sets the gzip Compression Level that will be used. <em><strong>default:</strong></em> 5</p> <p>Sets the gzip Compression Level that will be used. <em><strong>default:</strong></em> 5</p>
<h2 id="gzip-types">gzip-types<a class="headerlink" href="#gzip-types" title="Permanent link"></a></h2> <h2 id="gzip-types">gzip-types<a class="headerlink" href="#gzip-types" title="Permanent link"></a></h2>
<p>Sets the MIME types in addition to "text/html" to compress. The special value "*" matches any MIME type. Responses with the "text/html" type are always compressed if <code class="codehilite">[use-gzip](#use-gzip)</code> is enabled. <p>Sets the MIME types in addition to "text/html" to compress. The special value "*" matches any MIME type. Responses with the "text/html" type are always compressed if <code class="codehilite"><span class="err">[use-gzip](#use-gzip)</span></code> is enabled.
<em><strong>default:</strong></em> <code class="codehilite">application/atom+xml application/javascript application/x-javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css text/plain text/x-component</code>.</p> <em><strong>default:</strong></em> <code class="codehilite"><span class="err">application/atom+xml application/javascript application/x-javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css text/plain text/x-component</span></code>.</p>
<h2 id="worker-processes">worker-processes<a class="headerlink" href="#worker-processes" title="Permanent link"></a></h2> <h2 id="worker-processes">worker-processes<a class="headerlink" href="#worker-processes" title="Permanent link"></a></h2>
<p>Sets the number of <a href="http://nginx.org/en/docs/ngx_core_module.html#worker_processes">worker processes</a>. <p>Sets the number of <a href="http://nginx.org/en/docs/ngx_core_module.html#worker_processes">worker processes</a>.
The default of "auto" means number of available CPU cores.</p> The default of "auto" means number of available CPU cores.</p>
@ -4344,7 +4344,7 @@ The default of "auto" means number of available CPU cores.</p>
By default worker processes are not bound to any specific CPUs. The value can be:</p> By default worker processes are not bound to any specific CPUs. The value can be:</p>
<ul> <ul>
<li>"": empty string indicate no affinity is applied.</li> <li>"": empty string indicate no affinity is applied.</li>
<li>cpumask: e.g. <code class="codehilite">0001 0010 0100 1000</code> to bind processes to specific cpus.</li> <li>cpumask: e.g. <code class="codehilite"><span class="err">0001 0010 0100 1000</span></code> to bind processes to specific cpus.</li>
<li>auto: binding worker processes automatically to available CPUs.</li> <li>auto: binding worker processes automatically to available CPUs.</li>
</ul> </ul>
<h2 id="worker-shutdown-timeout">worker-shutdown-timeout<a class="headerlink" href="#worker-shutdown-timeout" title="Permanent link"></a></h2> <h2 id="worker-shutdown-timeout">worker-shutdown-timeout<a class="headerlink" href="#worker-shutdown-timeout" title="Permanent link"></a></h2>
@ -4356,10 +4356,10 @@ The value can either be:</p>
<li>round_robin: to use the default round robin loadbalancer</li> <li>round_robin: to use the default round robin loadbalancer</li>
<li>ewma: to use the Peak EWMA method for routing (<a href="https://github.com/kubernetes/ingress-nginx/blob/master/rootfs/etc/nginx/lua/balancer/ewma.lua">implementation</a>)</li> <li>ewma: to use the Peak EWMA method for routing (<a href="https://github.com/kubernetes/ingress-nginx/blob/master/rootfs/etc/nginx/lua/balancer/ewma.lua">implementation</a>)</li>
</ul> </ul>
<p>The default is <code class="codehilite">round_robin</code>.</p> <p>The default is <code class="codehilite"><span class="err">round_robin</span></code>.</p>
<ul> <ul>
<li>To load balance using consistent hashing of IP or other variables, consider the <code class="codehilite">nginx.ingress.kubernetes.io/upstream-hash-by</code> annotation.</li> <li>To load balance using consistent hashing of IP or other variables, consider the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/upstream-hash-by</span></code> annotation.</li>
<li>To load balance using session cookies, consider the <code class="codehilite">nginx.ingress.kubernetes.io/affinity</code> annotation.</li> <li>To load balance using session cookies, consider the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/affinity</span></code> annotation.</li>
</ul> </ul>
<p><em>References:</em> <p><em>References:</em>
<a href="http://nginx.org/en/docs/http/load_balancing.html">http://nginx.org/en/docs/http/load_balancing.html</a></p> <a href="http://nginx.org/en/docs/http/load_balancing.html">http://nginx.org/en/docs/http/load_balancing.html</a></p>
@ -4402,8 +4402,8 @@ requests is made, the connection is closed.
<h2 id="bind-address">bind-address<a class="headerlink" href="#bind-address" title="Permanent link"></a></h2> <h2 id="bind-address">bind-address<a class="headerlink" href="#bind-address" title="Permanent link"></a></h2>
<p>Sets the addresses on which the server will accept requests instead of *. It should be noted that these addresses must exist in the runtime environment or the controller will crash loop.</p> <p>Sets the addresses on which the server will accept requests instead of *. It should be noted that these addresses must exist in the runtime environment or the controller will crash loop.</p>
<h2 id="use-forwarded-headers">use-forwarded-headers<a class="headerlink" href="#use-forwarded-headers" title="Permanent link"></a></h2> <h2 id="use-forwarded-headers">use-forwarded-headers<a class="headerlink" href="#use-forwarded-headers" title="Permanent link"></a></h2>
<p>If true, NGINX passes the incoming <code class="codehilite">X-Forwarded-*</code> headers to upstreams. Use this option when NGINX is behind another L7 proxy / load balancer that is setting these headers.</p> <p>If true, NGINX passes the incoming <code class="codehilite"><span class="err">X-Forwarded-*</span></code> headers to upstreams. Use this option when NGINX is behind another L7 proxy / load balancer that is setting these headers.</p>
<p>If false, NGINX ignores incoming <code class="codehilite">X-Forwarded-*</code> headers, filling them with the request information it sees. Use this option if NGINX is exposed directly to the internet, or it's behind a L3/packet-based load balancer that doesn't alter the source IP in the packets.</p> <p>If false, NGINX ignores incoming <code class="codehilite"><span class="err">X-Forwarded-*</span></code> headers, filling them with the request information it sees. Use this option if NGINX is exposed directly to the internet, or it's behind a L3/packet-based load balancer that doesn't alter the source IP in the packets.</p>
<h2 id="forwarded-for-header">forwarded-for-header<a class="headerlink" href="#forwarded-for-header" title="Permanent link"></a></h2> <h2 id="forwarded-for-header">forwarded-for-header<a class="headerlink" href="#forwarded-for-header" title="Permanent link"></a></h2>
<p>Sets the header field for identifying the originating IP address of a client. <em><strong>default:</strong></em> X-Forwarded-For</p> <p>Sets the header field for identifying the originating IP address of a client. <em><strong>default:</strong></em> X-Forwarded-For</p>
<h2 id="compute-full-forwarded-for">compute-full-forwarded-for<a class="headerlink" href="#compute-full-forwarded-for" title="Permanent link"></a></h2> <h2 id="compute-full-forwarded-for">compute-full-forwarded-for<a class="headerlink" href="#compute-full-forwarded-for" title="Permanent link"></a></h2>
@ -4458,10 +4458,10 @@ Leave blank to use default value (localhost). <em><strong>default:</strong></em>
<p>Overrides the operation naem to use for any traces crated. <em><strong>default:</strong></em> nginx.handle</p> <p>Overrides the operation naem to use for any traces crated. <em><strong>default:</strong></em> nginx.handle</p>
<h2 id="datadog-priority-sampling">datadog-priority-sampling<a class="headerlink" href="#datadog-priority-sampling" title="Permanent link"></a></h2> <h2 id="datadog-priority-sampling">datadog-priority-sampling<a class="headerlink" href="#datadog-priority-sampling" title="Permanent link"></a></h2>
<p>Specifies to use client-side sampling. <p>Specifies to use client-side sampling.
If true disables client-side sampling (thus ignoring <code class="codehilite">sample_rate</code>) and enables distributed priority sampling, where traces are sampled based on a combination of user-assigned priorities and configuration from the agent. <em><strong>default:</strong></em> true</p> If true disables client-side sampling (thus ignoring <code class="codehilite"><span class="err">sample_rate</span></code>) and enables distributed priority sampling, where traces are sampled based on a combination of user-assigned priorities and configuration from the agent. <em><strong>default:</strong></em> true</p>
<h2 id="datadog-sample-rate">datadog-sample-rate<a class="headerlink" href="#datadog-sample-rate" title="Permanent link"></a></h2> <h2 id="datadog-sample-rate">datadog-sample-rate<a class="headerlink" href="#datadog-sample-rate" title="Permanent link"></a></h2>
<p>Specifies sample rate for any traces created. <p>Specifies sample rate for any traces created.
This is effective only when <code class="codehilite">datadog-priority-sampling</code> is <code class="codehilite">false</code> <em><strong>default:</strong></em> 1.0</p> This is effective only when <code class="codehilite"><span class="err">datadog-priority-sampling</span></code> is <code class="codehilite"><span class="err">false</span></code> <em><strong>default:</strong></em> 1.0</p>
<h2 id="main-snippet">main-snippet<a class="headerlink" href="#main-snippet" title="Permanent link"></a></h2> <h2 id="main-snippet">main-snippet<a class="headerlink" href="#main-snippet" title="Permanent link"></a></h2>
<p>Adds custom configuration to the main section of the nginx configuration.</p> <p>Adds custom configuration to the main section of the nginx configuration.</p>
<h2 id="http-snippet">http-snippet<a class="headerlink" href="#http-snippet" title="Permanent link"></a></h2> <h2 id="http-snippet">http-snippet<a class="headerlink" href="#http-snippet" title="Permanent link"></a></h2>
@ -4474,7 +4474,7 @@ This is effective only when <code class="codehilite">datadog-priority-sampling</
<h2 id="custom-http-errors">custom-http-errors<a class="headerlink" href="#custom-http-errors" title="Permanent link"></a></h2> <h2 id="custom-http-errors">custom-http-errors<a class="headerlink" href="#custom-http-errors" title="Permanent link"></a></h2>
<p>Enables which HTTP codes should be passed for processing with the <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#error_page">error_page directive</a></p> <p>Enables which HTTP codes should be passed for processing with the <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#error_page">error_page directive</a></p>
<p>Setting at least one code also enables <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_intercept_errors">proxy_intercept_errors</a> which are required to process error_page.</p> <p>Setting at least one code also enables <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_intercept_errors">proxy_intercept_errors</a> which are required to process error_page.</p>
<p>Example usage: <code class="codehilite">custom-http-errors: 404,415</code></p> <p>Example usage: <code class="codehilite"><span class="c">custom-http-errors: 404,415</span></code></p>
<h2 id="proxy-body-size">proxy-body-size<a class="headerlink" href="#proxy-body-size" title="Permanent link"></a></h2> <h2 id="proxy-body-size">proxy-body-size<a class="headerlink" href="#proxy-body-size" title="Permanent link"></a></h2>
<p>Sets the maximum allowed size of the client request body. <p>Sets the maximum allowed size of the client request body.
See NGINX <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size">client_max_body_size</a>.</p> See NGINX <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size">client_max_body_size</a>.</p>
@ -4508,10 +4508,10 @@ See NGINX <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#clien
<p>Sets the global value of redirects (301) to HTTPS if the server has a TLS certificate (defined in an Ingress rule). <p>Sets the global value of redirects (301) to HTTPS if the server has a TLS certificate (defined in an Ingress rule).
<em><strong>default:</strong></em> "true"</p> <em><strong>default:</strong></em> "true"</p>
<h2 id="whitelist-source-range">whitelist-source-range<a class="headerlink" href="#whitelist-source-range" title="Permanent link"></a></h2> <h2 id="whitelist-source-range">whitelist-source-range<a class="headerlink" href="#whitelist-source-range" title="Permanent link"></a></h2>
<p>Sets the default whitelisted IPs for each <code class="codehilite">server</code> block. This can be overwritten by an annotation on an Ingress rule. <p>Sets the default whitelisted IPs for each <code class="codehilite"><span class="err">server</span></code> block. This can be overwritten by an annotation on an Ingress rule.
See <a href="http://nginx.org/en/docs/http/ngx_http_access_module.html">ngx_http_access_module</a>.</p> See <a href="http://nginx.org/en/docs/http/ngx_http_access_module.html">ngx_http_access_module</a>.</p>
<h2 id="skip-access-log-urls">skip-access-log-urls<a class="headerlink" href="#skip-access-log-urls" title="Permanent link"></a></h2> <h2 id="skip-access-log-urls">skip-access-log-urls<a class="headerlink" href="#skip-access-log-urls" title="Permanent link"></a></h2>
<p>Sets a list of URLs that should not appear in the NGINX access log. This is useful with urls like <code class="codehilite">/health</code> or <code class="codehilite">health-check</code> that make "complex" reading the logs. <em><strong>default:</strong></em> is empty</p> <p>Sets a list of URLs that should not appear in the NGINX access log. This is useful with urls like <code class="codehilite"><span class="err">/health</span></code> or <code class="codehilite"><span class="err">health-check</span></code> that make "complex" reading the logs. <em><strong>default:</strong></em> is empty</p>
<h2 id="limit-rate">limit-rate<a class="headerlink" href="#limit-rate" title="Permanent link"></a></h2> <h2 id="limit-rate">limit-rate<a class="headerlink" href="#limit-rate" title="Permanent link"></a></h2>
<p>Limits the rate of response transmission to a client. The rate is specified in bytes per second. The zero value disables rate limiting. The limit is set per a request, and so if a client simultaneously opens two connections, the overall rate will be twice as much as the specified limit.</p> <p>Limits the rate of response transmission to a client. The rate is specified in bytes per second. The zero value disables rate limiting. The limit is set per a request, and so if a client simultaneously opens two connections, the overall rate will be twice as much as the specified limit.</p>
<p><em>References:</em> <p><em>References:</em>
@ -4520,13 +4520,13 @@ See <a href="http://nginx.org/en/docs/http/ngx_http_access_module.html">ngx_http
<p>Sets the initial amount after which the further transmission of a response to a client will be rate limited.</p> <p>Sets the initial amount after which the further transmission of a response to a client will be rate limited.</p>
<h2 id="lua-shared-dicts">lua-shared-dicts<a class="headerlink" href="#lua-shared-dicts" title="Permanent link"></a></h2> <h2 id="lua-shared-dicts">lua-shared-dicts<a class="headerlink" href="#lua-shared-dicts" title="Permanent link"></a></h2>
<p>Customize default Lua shared dictionaries or define more. You can use the following syntax to do so:</p> <p>Customize default Lua shared dictionaries or define more. You can use the following syntax to do so:</p>
<div class="codehilite"><pre><span></span>lua-shared-dicts: &quot;&lt;my dict name&gt;: &lt;my dict size&gt;, [&lt;my dict name&gt;: &lt;my dict size&gt;], ...&quot; <div class="codehilite"><pre><span></span><code><span class="c">lua-shared-dicts: &quot;&lt;my dict name&gt;: &lt;my dict size&gt;, [&lt;my dict name&gt;: &lt;my dict size&gt;], ...&quot;</span>
</pre></div> </code></pre></div>
<p>For example following will set default <code class="codehilite">certificate_data</code> dictionary to <code class="codehilite">100M</code> and will introduce a new dictionary called <p>For example following will set default <code class="codehilite"><span class="err">certificate_data</span></code> dictionary to <code class="codehilite"><span class="err">100M</span></code> and will introduce a new dictionary called
<code class="codehilite">my_custom_plugin</code>:</p> <code class="codehilite"><span class="err">my_custom_plugin</span></code>:</p>
<div class="codehilite"><pre><span></span>lua-shared-dicts: &quot;certificate_data: 100, my_custom_plugin: 5&quot; <div class="codehilite"><pre><span></span><code><span class="c">lua-shared-dicts: &quot;certificate_data: 100, my_custom_plugin: 5&quot;</span>
</pre></div> </code></pre></div>
<p><em>References:</em> <p><em>References:</em>
<a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#limit_rate_after">http://nginx.org/en/docs/http/ngx_http_core_module.html#limit_rate_after</a></p> <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#limit_rate_after">http://nginx.org/en/docs/http/ngx_http_core_module.html#limit_rate_after</a></p>
@ -4549,34 +4549,34 @@ Supported codes are <a href="https://developer.mozilla.org/docs/Web/HTTP/Status/
<em><strong>default:</strong></em> "/.well-known/acme-challenge"</p> <em><strong>default:</strong></em> "/.well-known/acme-challenge"</p>
<h2 id="global-auth-url">global-auth-url<a class="headerlink" href="#global-auth-url" title="Permanent link"></a></h2> <h2 id="global-auth-url">global-auth-url<a class="headerlink" href="#global-auth-url" title="Permanent link"></a></h2>
<p>A url to an existing service that provides authentication for all the locations. <p>A url to an existing service that provides authentication for all the locations.
Similar to the Ingress rule annotation <code class="codehilite">nginx.ingress.kubernetes.io/auth-url</code>. Similar to the Ingress rule annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-url</span></code>.
Locations that should not get authenticated can be listed using <code class="codehilite">no-auth-locations</code> See <a href="#no-auth-locations">no-auth-locations</a>. In addition, each service can be excluded from authentication via annotation <code class="codehilite">enable-global-auth</code> set to "false". Locations that should not get authenticated can be listed using <code class="codehilite"><span class="err">no-auth-locations</span></code> See <a href="#no-auth-locations">no-auth-locations</a>. In addition, each service can be excluded from authentication via annotation <code class="codehilite"><span class="err">enable-global-auth</span></code> set to "false".
<em><strong>default:</strong></em> ""</p> <em><strong>default:</strong></em> ""</p>
<p><em>References:</em> <a href="https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md#external-authentication">https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md#external-authentication</a></p> <p><em>References:</em> <a href="https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md#external-authentication">https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md#external-authentication</a></p>
<h2 id="global-auth-method">global-auth-method<a class="headerlink" href="#global-auth-method" title="Permanent link"></a></h2> <h2 id="global-auth-method">global-auth-method<a class="headerlink" href="#global-auth-method" title="Permanent link"></a></h2>
<p>A HTTP method to use for an existing service that provides authentication for all the locations. <p>A HTTP method to use for an existing service that provides authentication for all the locations.
Similar to the Ingress rule annotation <code class="codehilite">nginx.ingress.kubernetes.io/auth-method</code>. Similar to the Ingress rule annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-method</span></code>.
<em><strong>default:</strong></em> ""</p> <em><strong>default:</strong></em> ""</p>
<h2 id="global-auth-signin">global-auth-signin<a class="headerlink" href="#global-auth-signin" title="Permanent link"></a></h2> <h2 id="global-auth-signin">global-auth-signin<a class="headerlink" href="#global-auth-signin" title="Permanent link"></a></h2>
<p>Sets the location of the error page for an existing service that provides authentication for all the locations. <p>Sets the location of the error page for an existing service that provides authentication for all the locations.
Similar to the Ingress rule annotation <code class="codehilite">nginx.ingress.kubernetes.io/auth-signin</code>. Similar to the Ingress rule annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-signin</span></code>.
<em><strong>default:</strong></em> ""</p> <em><strong>default:</strong></em> ""</p>
<h2 id="global-auth-response-headers">global-auth-response-headers<a class="headerlink" href="#global-auth-response-headers" title="Permanent link"></a></h2> <h2 id="global-auth-response-headers">global-auth-response-headers<a class="headerlink" href="#global-auth-response-headers" title="Permanent link"></a></h2>
<p>Sets the headers to pass to backend once authentication request completes. Applied to all the locations. <p>Sets the headers to pass to backend once authentication request completes. Applied to all the locations.
Similar to the Ingress rule annotation <code class="codehilite">nginx.ingress.kubernetes.io/auth-response-headers</code>. Similar to the Ingress rule annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-response-headers</span></code>.
<em><strong>default:</strong></em> ""</p> <em><strong>default:</strong></em> ""</p>
<h2 id="global-auth-request-redirect">global-auth-request-redirect<a class="headerlink" href="#global-auth-request-redirect" title="Permanent link"></a></h2> <h2 id="global-auth-request-redirect">global-auth-request-redirect<a class="headerlink" href="#global-auth-request-redirect" title="Permanent link"></a></h2>
<p>Sets the X-Auth-Request-Redirect header value. Applied to all the locations. <p>Sets the X-Auth-Request-Redirect header value. Applied to all the locations.
Similar to the Ingress rule annotation <code class="codehilite">nginx.ingress.kubernetes.io/auth-request-redirect</code>. Similar to the Ingress rule annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-request-redirect</span></code>.
<em><strong>default:</strong></em> ""</p> <em><strong>default:</strong></em> ""</p>
<h2 id="global-auth-snippet">global-auth-snippet<a class="headerlink" href="#global-auth-snippet" title="Permanent link"></a></h2> <h2 id="global-auth-snippet">global-auth-snippet<a class="headerlink" href="#global-auth-snippet" title="Permanent link"></a></h2>
<p>Sets a custom snippet to use with external authentication. Applied to all the locations. <p>Sets a custom snippet to use with external authentication. Applied to all the locations.
Similar to the Ingress rule annotation <code class="codehilite">nginx.ingress.kubernetes.io/auth-request-redirect</code>. Similar to the Ingress rule annotation <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-request-redirect</span></code>.
<em><strong>default:</strong></em> ""</p> <em><strong>default:</strong></em> ""</p>
<h2 id="global-auth-cache-key">global-auth-cache-key<a class="headerlink" href="#global-auth-cache-key" title="Permanent link"></a></h2> <h2 id="global-auth-cache-key">global-auth-cache-key<a class="headerlink" href="#global-auth-cache-key" title="Permanent link"></a></h2>
<p>Enables caching for global auth requests. Specify a lookup key for auth responses, e.g. <code class="codehilite">$remote_user$http_authorization</code>.</p> <p>Enables caching for global auth requests. Specify a lookup key for auth responses, e.g. <code class="codehilite"><span class="err">$remote_user$http_authorization</span></code>.</p>
<h2 id="global-auth-cache-duration">global-auth-cache-duration<a class="headerlink" href="#global-auth-cache-duration" title="Permanent link"></a></h2> <h2 id="global-auth-cache-duration">global-auth-cache-duration<a class="headerlink" href="#global-auth-cache-duration" title="Permanent link"></a></h2>
<p>Set a caching time for auth responses based on their response codes, e.g. <code class="codehilite">200 202 30m</code>. See <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_valid">proxy_cache_valid</a> for details. You may specify multiple, comma-separated values: <code class="codehilite">200 202 10m, 401 5m</code>. defaults to <code class="codehilite">200 202 401 5m</code>.</p> <p>Set a caching time for auth responses based on their response codes, e.g. <code class="codehilite"><span class="err">200 202 30m</span></code>. See <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_valid">proxy_cache_valid</a> for details. You may specify multiple, comma-separated values: <code class="codehilite"><span class="err">200 202 10m, 401 5m</span></code>. defaults to <code class="codehilite"><span class="err">200 202 401 5m</span></code>.</p>
<h2 id="no-auth-locations">no-auth-locations<a class="headerlink" href="#no-auth-locations" title="Permanent link"></a></h2> <h2 id="no-auth-locations">no-auth-locations<a class="headerlink" href="#no-auth-locations" title="Permanent link"></a></h2>
<p>A comma-separated list of locations that should not get authenticated. <p>A comma-separated list of locations that should not get authenticated.
<em><strong>default:</strong></em> "/.well-known/acme-challenge"</p> <em><strong>default:</strong></em> "/.well-known/acme-challenge"</p>
@ -4586,12 +4586,12 @@ Similar to the Ingress rule annotation <code class="codehilite">nginx.ingress.ku
<a href="http://nginx.org/en/docs/http/ngx_http_access_module.html#deny">http://nginx.org/en/docs/http/ngx_http_access_module.html#deny</a></p> <a href="http://nginx.org/en/docs/http/ngx_http_access_module.html#deny">http://nginx.org/en/docs/http/ngx_http_access_module.html#deny</a></p>
<h2 id="block-user-agents">block-user-agents<a class="headerlink" href="#block-user-agents" title="Permanent link"></a></h2> <h2 id="block-user-agents">block-user-agents<a class="headerlink" href="#block-user-agents" title="Permanent link"></a></h2>
<p>A comma-separated list of User-Agent, request from which have to be blocked globally. <p>A comma-separated list of User-Agent, request from which have to be blocked globally.
It's possible to use here full strings and regular expressions. More details about valid patterns can be found at <code class="codehilite">map</code> Nginx directive documentation.</p> It's possible to use here full strings and regular expressions. More details about valid patterns can be found at <code class="codehilite"><span class="err">map</span></code> Nginx directive documentation.</p>
<p><em>References:</em> <p><em>References:</em>
<a href="http://nginx.org/en/docs/http/ngx_http_map_module.html#map">http://nginx.org/en/docs/http/ngx_http_map_module.html#map</a></p> <a href="http://nginx.org/en/docs/http/ngx_http_map_module.html#map">http://nginx.org/en/docs/http/ngx_http_map_module.html#map</a></p>
<h2 id="block-referers">block-referers<a class="headerlink" href="#block-referers" title="Permanent link"></a></h2> <h2 id="block-referers">block-referers<a class="headerlink" href="#block-referers" title="Permanent link"></a></h2>
<p>A comma-separated list of Referers, request from which have to be blocked globally. <p>A comma-separated list of Referers, request from which have to be blocked globally.
It's possible to use here full strings and regular expressions. More details about valid patterns can be found at <code class="codehilite">map</code> Nginx directive documentation.</p> It's possible to use here full strings and regular expressions. More details about valid patterns can be found at <code class="codehilite"><span class="err">map</span></code> Nginx directive documentation.</p>
<p><em>References:</em> <p><em>References:</em>
<a href="http://nginx.org/en/docs/http/ngx_http_map_module.html#map">http://nginx.org/en/docs/http/ngx_http_map_module.html#map</a></p> <a href="http://nginx.org/en/docs/http/ngx_http_map_module.html#map">http://nginx.org/en/docs/http/ngx_http_map_module.html#map</a></p>
@ -4603,6 +4603,7 @@ It's possible to use here full strings and regular expressions. More details abo
</article> </article>
</div> </div>
</div> </div>
@ -4651,9 +4652,9 @@ It's possible to use here full strings and regular expressions. More details abo
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -4663,7 +4664,7 @@ It's possible to use here full strings and regular expressions. More details abo
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#custom-nginx-template" tabindex="1" class="md-skip"> <a href="#custom-nginx-template" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1151,10 +1151,10 @@
<h1 id="custom-nginx-template">Custom NGINX template<a class="headerlink" href="#custom-nginx-template" title="Permanent link"></a></h1> <h1 id="custom-nginx-template">Custom NGINX template<a class="headerlink" href="#custom-nginx-template" title="Permanent link"></a></h1>
<p>The NGINX template is located in the file <code class="codehilite">/etc/nginx/template/nginx.tmpl</code>.</p> <p>The NGINX template is located in the file <code class="codehilite"><span class="err">/etc/nginx/template/nginx.tmpl</span></code>.</p>
<p>Using a <a href="https://kubernetes.io/docs/concepts/storage/volumes/">Volume</a> it is possible to use a custom template. <p>Using a <a href="https://kubernetes.io/docs/concepts/storage/volumes/">Volume</a> it is possible to use a custom template.
This includes using a <a href="https://kubernetes.io/docs/concepts/storage/volumes/#example-pod-with-a-secret-a-downward-api-and-a-configmap">Configmap</a> as source of the template</p> This includes using a <a href="https://kubernetes.io/docs/concepts/storage/volumes/#example-pod-with-a-secret-a-downward-api-and-a-configmap">Configmap</a> as source of the template</p>
<div class="codehilite"><pre><span></span> <span class="nt">volumeMounts</span><span class="p">:</span> <div class="codehilite"><pre><span></span><code> <span class="nt">volumeMounts</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="nt">mountPath</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">/etc/nginx/template</span> <span class="p p-Indicator">-</span> <span class="nt">mountPath</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">/etc/nginx/template</span>
<span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">nginx-template-volume</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">nginx-template-volume</span>
<span class="nt">readOnly</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">true</span> <span class="nt">readOnly</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">true</span>
@ -1165,9 +1165,9 @@ This includes using a <a href="https://kubernetes.io/docs/concepts/storage/volum
<span class="nt">items</span><span class="p">:</span> <span class="nt">items</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="nt">key</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">nginx.tmpl</span> <span class="p p-Indicator">-</span> <span class="nt">key</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">nginx.tmpl</span>
<span class="nt">path</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">nginx.tmpl</span> <span class="nt">path</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">nginx.tmpl</span>
</pre></div> </code></pre></div>
<p><strong>Please note the template is tied to the Go code. Do not change names in the variable <code class="codehilite">$cfg</code>.</strong></p> <p><strong>Please note the template is tied to the Go code. Do not change names in the variable <code class="codehilite"><span class="err">$cfg</span></code>.</strong></p>
<p>For more information about the template syntax please check the <a href="https://golang.org/pkg/text/template/">Go template package</a>. <p>For more information about the template syntax please check the <a href="https://golang.org/pkg/text/template/">Go template package</a>.
In addition to the built-in functions provided by the Go package the following functions are also available:</p> In addition to the built-in functions provided by the Go package the following functions are also available:</p>
<ul> <ul>
@ -1209,6 +1209,7 @@ In addition to the built-in functions provided by the Go package the following f
</article> </article>
</div> </div>
</div> </div>
@ -1257,9 +1258,9 @@ In addition to the built-in functions provided by the Go package the following f
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1269,7 +1270,7 @@ In addition to the built-in functions provided by the Go package the following f
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#nginx-configuration" tabindex="1" class="md-skip"> <a href="#nginx-configuration" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1155,7 +1155,7 @@
<ol> <ol>
<li><a href="configmap/">ConfigMap</a>: using a Configmap to set global configurations in NGINX.</li> <li><a href="configmap/">ConfigMap</a>: using a Configmap to set global configurations in NGINX.</li>
<li><a href="annotations/">Annotations</a>: use this if you want a specific configuration for a particular Ingress rule.</li> <li><a href="annotations/">Annotations</a>: use this if you want a specific configuration for a particular Ingress rule.</li>
<li><a href="custom-template/">Custom template</a>: when more specific settings are required, like <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#open_file_cache">open_file_cache</a>, adjust <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#listen">listen</a> options as <code class="codehilite">rcvbuf</code> or when is not possible to change the configuration through the ConfigMap.</li> <li><a href="custom-template/">Custom template</a>: when more specific settings are required, like <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#open_file_cache">open_file_cache</a>, adjust <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#listen">listen</a> options as <code class="codehilite"><span class="err">rcvbuf</span></code> or when is not possible to change the configuration through the ConfigMap.</li>
</ol> </ol>
@ -1166,6 +1166,7 @@
</article> </article>
</div> </div>
</div> </div>
@ -1214,9 +1215,9 @@
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1226,7 +1227,7 @@
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#log-format" tabindex="1" class="md-skip"> <a href="#log-format" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1152,12 +1152,12 @@
<h1 id="log-format">Log format<a class="headerlink" href="#log-format" title="Permanent link"></a></h1> <h1 id="log-format">Log format<a class="headerlink" href="#log-format" title="Permanent link"></a></h1>
<p>The default configuration uses a custom logging format to add additional information about upstreams, response time and status.</p> <p>The default configuration uses a custom logging format to add additional information about upstreams, response time and status.</p>
<div class="codehilite"><pre><span></span>log_format upstreaminfo <div class="codehilite"><pre><span></span><code><span class="err">log_format upstreaminfo</span>
&#39;$remote_addr - $remote_user [$time_local] &quot;$request&quot; &#39; <span class="err"> &#39;$remote_addr - $remote_user [$time_local] &quot;$request&quot; &#39;</span>
&#39;$status $body_bytes_sent &quot;$http_referer&quot; &quot;$http_user_agent&quot; &#39; <span class="err"> &#39;$status $body_bytes_sent &quot;$http_referer&quot; &quot;$http_user_agent&quot; &#39;</span>
&#39;$request_length $request_time [$proxy_upstream_name] [$proxy_alternative_upstream_name] $upstream_addr &#39; <span class="err"> &#39;$request_length $request_time [$proxy_upstream_name] [$proxy_alternative_upstream_name] $upstream_addr &#39;</span>
&#39;$upstream_response_length $upstream_response_time $upstream_status $req_id&#39;; <span class="err"> &#39;$upstream_response_length $upstream_response_time $upstream_status $req_id&#39;;</span>
</pre></div> </code></pre></div>
<table> <table>
<thead> <thead>
@ -1168,75 +1168,75 @@
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td><code class="codehilite">$proxy_protocol_addr</code></td> <td><code class="codehilite"><span class="err">$proxy_protocol_addr</span></code></td>
<td>remote address if proxy protocol is enabled</td> <td>remote address if proxy protocol is enabled</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$remote_addr</code></td> <td><code class="codehilite"><span class="err">$remote_addr</span></code></td>
<td>the source IP address of the client</td> <td>the source IP address of the client</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$remote_user</code></td> <td><code class="codehilite"><span class="err">$remote_user</span></code></td>
<td>user name supplied with the Basic authentication</td> <td>user name supplied with the Basic authentication</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$time_local</code></td> <td><code class="codehilite"><span class="err">$time_local</span></code></td>
<td>local time in the Common Log Format</td> <td>local time in the Common Log Format</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$request</code></td> <td><code class="codehilite"><span class="err">$request</span></code></td>
<td>full original request line</td> <td>full original request line</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$status</code></td> <td><code class="codehilite"><span class="err">$status</span></code></td>
<td>response status</td> <td>response status</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$body_bytes_sent</code></td> <td><code class="codehilite"><span class="err">$body_bytes_sent</span></code></td>
<td>number of bytes sent to a client, not counting the response header</td> <td>number of bytes sent to a client, not counting the response header</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$http_referer</code></td> <td><code class="codehilite"><span class="err">$http_referer</span></code></td>
<td>value of the Referer header</td> <td>value of the Referer header</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$http_user_agent</code></td> <td><code class="codehilite"><span class="err">$http_user_agent</span></code></td>
<td>value of User-Agent header</td> <td>value of User-Agent header</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$request_length</code></td> <td><code class="codehilite"><span class="err">$request_length</span></code></td>
<td>request length (including request line, header, and request body)</td> <td>request length (including request line, header, and request body)</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$request_time</code></td> <td><code class="codehilite"><span class="err">$request_time</span></code></td>
<td>time elapsed since the first bytes were read from the client</td> <td>time elapsed since the first bytes were read from the client</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$proxy_upstream_name</code></td> <td><code class="codehilite"><span class="err">$proxy_upstream_name</span></code></td>
<td>name of the upstream. The format is <code class="codehilite">upstream-&lt;namespace&gt;-&lt;service name&gt;-&lt;service port&gt;</code></td> <td>name of the upstream. The format is <code class="codehilite"><span class="err">upstream-&lt;namespace&gt;-&lt;service name&gt;-&lt;service port&gt;</span></code></td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$proxy_alternative_upstream_name</code></td> <td><code class="codehilite"><span class="err">$proxy_alternative_upstream_name</span></code></td>
<td>name of the alternative upstream. The format is <code class="codehilite">upstream-&lt;namespace&gt;-&lt;service name&gt;-&lt;service port&gt;</code></td> <td>name of the alternative upstream. The format is <code class="codehilite"><span class="err">upstream-&lt;namespace&gt;-&lt;service name&gt;-&lt;service port&gt;</span></code></td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$upstream_addr</code></td> <td><code class="codehilite"><span class="err">$upstream_addr</span></code></td>
<td>the IP address and port (or the path to the domain socket) of the upstream server. If several servers were contacted during request processing, their addresses are separated by commas.</td> <td>the IP address and port (or the path to the domain socket) of the upstream server. If several servers were contacted during request processing, their addresses are separated by commas.</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$upstream_response_length</code></td> <td><code class="codehilite"><span class="err">$upstream_response_length</span></code></td>
<td>the length of the response obtained from the upstream server</td> <td>the length of the response obtained from the upstream server</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$upstream_response_time</code></td> <td><code class="codehilite"><span class="err">$upstream_response_time</span></code></td>
<td>time spent on receiving the response from the upstream server as seconds with millisecond resolution</td> <td>time spent on receiving the response from the upstream server as seconds with millisecond resolution</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$upstream_status</code></td> <td><code class="codehilite"><span class="err">$upstream_status</span></code></td>
<td>status code of the response obtained from the upstream server</td> <td>status code of the response obtained from the upstream server</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$req_id</code></td> <td><code class="codehilite"><span class="err">$req_id</span></code></td>
<td>the randomly generated ID of the request</td> <td>the randomly generated ID of the request</td>
</tr> </tr>
</tbody> </tbody>
@ -1251,19 +1251,19 @@
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td><code class="codehilite">$namespace</code></td> <td><code class="codehilite"><span class="err">$namespace</span></code></td>
<td>namespace of the ingress</td> <td>namespace of the ingress</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$ingress_name</code></td> <td><code class="codehilite"><span class="err">$ingress_name</span></code></td>
<td>name of the ingress</td> <td>name of the ingress</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$service_name</code></td> <td><code class="codehilite"><span class="err">$service_name</span></code></td>
<td>name of the service</td> <td>name of the service</td>
</tr> </tr>
<tr> <tr>
<td><code class="codehilite">$service_port</code></td> <td><code class="codehilite"><span class="err">$service_port</span></code></td>
<td>port of the service</td> <td>port of the service</td>
</tr> </tr>
</tbody> </tbody>
@ -1282,6 +1282,7 @@
</article> </article>
</div> </div>
</div> </div>
@ -1330,9 +1331,9 @@
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1342,7 +1343,7 @@
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#modsecurity-web-application-firewall" tabindex="1" class="md-skip"> <a href="#modsecurity-web-application-firewall" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1153,16 +1153,17 @@
<h1 id="modsecurity-web-application-firewall">ModSecurity Web Application Firewall<a class="headerlink" href="#modsecurity-web-application-firewall" title="Permanent link"></a></h1> <h1 id="modsecurity-web-application-firewall">ModSecurity Web Application Firewall<a class="headerlink" href="#modsecurity-web-application-firewall" title="Permanent link"></a></h1>
<p>ModSecurity is an open source, cross platform web application firewall (WAF) engine for Apache, IIS and Nginx that is developed by Trustwave's SpiderLabs. It has a robust event-based programming language which provides protection from a range of attacks against web applications and allows for HTTP traffic monitoring, logging and real-time analysis - <a href="https://www.modsecurity.org">https://www.modsecurity.org</a></p> <p>ModSecurity is an open source, cross platform web application firewall (WAF) engine for Apache, IIS and Nginx that is developed by Trustwave's SpiderLabs. It has a robust event-based programming language which provides protection from a range of attacks against web applications and allows for HTTP traffic monitoring, logging and real-time analysis - <a href="https://www.modsecurity.org">https://www.modsecurity.org</a></p>
<p>The <a href="https://github.com/SpiderLabs/ModSecurity-nginx">ModSecurity-nginx</a> connector is the connection point between NGINX and libmodsecurity (ModSecurity v3).</p> <p>The <a href="https://github.com/SpiderLabs/ModSecurity-nginx">ModSecurity-nginx</a> connector is the connection point between NGINX and libmodsecurity (ModSecurity v3).</p>
<p>The default ModSecurity configuration file is located in <code class="codehilite">/etc/nginx/modsecurity/modsecurity.conf</code>. This is the only file located in this directory and contains the default recommended configuration. Using a volume we can replace this file with the desired configuration. <p>The default ModSecurity configuration file is located in <code class="codehilite"><span class="err">/etc/nginx/modsecurity/modsecurity.conf</span></code>. This is the only file located in this directory and contains the default recommended configuration. Using a volume we can replace this file with the desired configuration.
To enable the ModSecurity feature we need to specify <code class="codehilite">enable-modsecurity: &quot;true&quot;</code> in the configuration configmap.</p> To enable the ModSecurity feature we need to specify <code class="codehilite"><span class="c">enable-modsecurity: &quot;true&quot;</span></code> in the configuration configmap.</p>
<blockquote> <blockquote>
<p><strong>Note:</strong> the default configuration use detection only, because that minimizes the chances of post-installation disruption. <p><strong>Note:</strong> the default configuration use detection only, because that minimizes the chances of post-installation disruption.
Due to the value of the setting <a href="https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-(v2.x)#secauditlogtype">SecAuditLogType=Concurrent</a> the ModSecurity log is stored in multiple files inside the directory <code class="codehilite">/var/log/audit</code>. Due to the value of the setting <a href="https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-(v2.x)#secauditlogtype">SecAuditLogType=Concurrent</a> the ModSecurity log is stored in multiple files inside the directory <code class="codehilite"><span class="err">/var/log/audit</span></code>.
The default <code class="codehilite">Serial</code> value in SecAuditLogType can impact performance.</p> The default <code class="codehilite"><span class="err">Serial</span></code> value in SecAuditLogType can impact performance.</p>
</blockquote> </blockquote>
<p>The OWASP ModSecurity Core Rule Set (CRS) is a set of generic attack detection rules for use with ModSecurity or compatible web application firewalls. The CRS aims to protect web applications from a wide range of attacks, including the OWASP Top Ten, with a minimum of false alerts. <p>The OWASP ModSecurity Core Rule Set (CRS) is a set of generic attack detection rules for use with ModSecurity or compatible web application firewalls. The CRS aims to protect web applications from a wide range of attacks, including the OWASP Top Ten, with a minimum of false alerts.
The directory <code class="codehilite">/etc/nginx/owasp-modsecurity-crs</code> contains the <a href="https://github.com/SpiderLabs/owasp-modsecurity-crs">owasp-modsecurity-crs repository</a>. The directory <code class="codehilite"><span class="err">/etc/nginx/owasp-modsecurity-crs</span></code> contains the <a href="https://github.com/SpiderLabs/owasp-modsecurity-crs">owasp-modsecurity-crs repository</a>.
Using <code class="codehilite">enable-owasp-modsecurity-crs: &quot;true&quot;</code> we enable the use of the rules.</p> Using <code class="codehilite"><span class="c">enable-owasp-modsecurity-crs: &quot;true&quot;</span></code> we enable the use of the rules.</p>
@ -1220,9 +1221,9 @@ Using <code class="codehilite">enable-owasp-modsecurity-crs: &quot;true&quot;</c
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1232,7 +1233,7 @@ Using <code class="codehilite">enable-owasp-modsecurity-crs: &quot;true&quot;</c
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#opentracing" tabindex="1" class="md-skip"> <a href="#opentracing" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1255,97 +1255,97 @@
By default this feature is disabled.</p> By default this feature is disabled.</p>
<h2 id="usage">Usage<a class="headerlink" href="#usage" title="Permanent link"></a></h2> <h2 id="usage">Usage<a class="headerlink" href="#usage" title="Permanent link"></a></h2>
<p>To enable the instrumentation we must enable OpenTracing in the configuration ConfigMap: <p>To enable the instrumentation we must enable OpenTracing in the configuration ConfigMap:
<div class="codehilite"><pre><span></span><span class="n">data</span><span class="o">:</span> <div class="codehilite"><pre><span></span><code><span class="n">data</span><span class="o">:</span>
<span class="n">enable</span><span class="o">-</span><span class="n">opentracing</span><span class="o">:</span> <span class="s2">&quot;true&quot;</span> <span class="n">enable</span><span class="o">-</span><span class="n">opentracing</span><span class="o">:</span> <span class="s2">&quot;true&quot;</span>
</pre></div></p> </code></pre></div></p>
<p>To enable or disable instrumentation for a single Ingress, use <p>To enable or disable instrumentation for a single Ingress, use
the <code class="codehilite">enable-opentracing</code> annotation: the <code class="codehilite"><span class="err">enable-opentracing</span></code> annotation:
<div class="codehilite"><pre><span></span><span class="n">kind</span><span class="o">:</span> <span class="n">Ingress</span> <div class="codehilite"><pre><span></span><code><span class="n">kind</span><span class="o">:</span> <span class="n">Ingress</span>
<span class="n">metadata</span><span class="o">:</span> <span class="n">metadata</span><span class="o">:</span>
<span class="n">annotations</span><span class="o">:</span> <span class="n">annotations</span><span class="o">:</span>
<span class="n">nginx</span><span class="o">.</span><span class="na">ingress</span><span class="o">.</span><span class="na">kubernetes</span><span class="o">.</span><span class="na">io</span><span class="o">/</span><span class="n">enable</span><span class="o">-</span><span class="n">opentracing</span><span class="o">:</span> <span class="s2">&quot;true&quot;</span> <span class="n">nginx</span><span class="o">.</span><span class="na">ingress</span><span class="o">.</span><span class="na">kubernetes</span><span class="o">.</span><span class="na">io</span><span class="o">/</span><span class="n">enable</span><span class="o">-</span><span class="n">opentracing</span><span class="o">:</span> <span class="s2">&quot;true&quot;</span>
</pre></div></p> </code></pre></div></p>
<p>We must also set the host to use when uploading traces:</p> <p>We must also set the host to use when uploading traces:</p>
<p><div class="codehilite"><pre><span></span>zipkin-collector-host: zipkin.default.svc.cluster.local <p><div class="codehilite"><pre><span></span><code><span class="c">zipkin-collector-host: zipkin.default.svc.cluster.local</span>
jaeger-collector-host: jaeger-agent.default.svc.cluster.local <span class="c">jaeger-collector-host: jaeger-agent.default.svc.cluster.local</span>
datadog-collector-host: datadog-agent.default.svc.cluster.local <span class="c">datadog-collector-host: datadog-agent.default.svc.cluster.local</span>
</pre></div> </code></pre></div>
NOTE: While the option is called <code class="codehilite">jaeger-collector-host</code>, you will need to point this to a <code class="codehilite">jaeger-agent</code>, and not the <code class="codehilite">jaeger-collector</code> component.</p> NOTE: While the option is called <code class="codehilite"><span class="err">jaeger-collector-host</span></code>, you will need to point this to a <code class="codehilite"><span class="err">jaeger-agent</span></code>, and not the <code class="codehilite"><span class="err">jaeger-collector</span></code> component.</p>
<p>Next you will need to deploy a distributed tracing system which uses OpenTracing. <p>Next you will need to deploy a distributed tracing system which uses OpenTracing.
<a href="https://github.com/openzipkin/zipkin">Zipkin</a> and <a href="https://github.com/openzipkin/zipkin">Zipkin</a> and
<a href="https://github.com/jaegertracing/jaeger">Jaeger</a> and <a href="https://github.com/jaegertracing/jaeger">Jaeger</a> and
<a href="https://github.com/DataDog/dd-opentracing-cpp">Datadog</a> <a href="https://github.com/DataDog/dd-opentracing-cpp">Datadog</a>
have been tested.</p> have been tested.</p>
<p>Other optional configuration options: <p>Other optional configuration options:
<div class="codehilite"><pre><span></span># specifies the port to use when uploading traces, Default: 9411 <div class="codehilite"><pre><span></span><code><span class="o">#</span> <span class="n">specifies</span> <span class="n">the</span> <span class="n">port</span> <span class="k">to</span> <span class="n">use</span> <span class="k">when</span> <span class="n">uploading</span> <span class="n">traces</span><span class="p">,</span> <span class="k">Default</span><span class="p">:</span> <span class="mi">9411</span>
zipkin-collector-port <span class="n">zipkin</span><span class="o">-</span><span class="n">collector</span><span class="o">-</span><span class="n">port</span>
# specifies the service name to use for any traces created, Default: nginx <span class="o">#</span> <span class="n">specifies</span> <span class="n">the</span> <span class="n">service</span> <span class="n">name</span> <span class="k">to</span> <span class="n">use</span> <span class="k">for</span> <span class="k">any</span> <span class="n">traces</span> <span class="n">created</span><span class="p">,</span> <span class="k">Default</span><span class="p">:</span> <span class="n">nginx</span>
zipkin-service-name <span class="n">zipkin</span><span class="o">-</span><span class="n">service</span><span class="o">-</span><span class="n">name</span>
# specifies sample rate for any traces created, Default: 1.0 <span class="o">#</span> <span class="n">specifies</span> <span class="n">sample</span> <span class="n">rate</span> <span class="k">for</span> <span class="k">any</span> <span class="n">traces</span> <span class="n">created</span><span class="p">,</span> <span class="k">Default</span><span class="p">:</span> <span class="mi">1</span><span class="p">.</span><span class="mi">0</span>
zipkin-sample-rate <span class="n">zipkin</span><span class="o">-</span><span class="n">sample</span><span class="o">-</span><span class="n">rate</span>
# specifies the port to use when uploading traces, Default: 6831 <span class="o">#</span> <span class="n">specifies</span> <span class="n">the</span> <span class="n">port</span> <span class="k">to</span> <span class="n">use</span> <span class="k">when</span> <span class="n">uploading</span> <span class="n">traces</span><span class="p">,</span> <span class="k">Default</span><span class="p">:</span> <span class="mi">6831</span>
jaeger-collector-port <span class="n">jaeger</span><span class="o">-</span><span class="n">collector</span><span class="o">-</span><span class="n">port</span>
# specifies the service name to use for any traces created, Default: nginx <span class="o">#</span> <span class="n">specifies</span> <span class="n">the</span> <span class="n">service</span> <span class="n">name</span> <span class="k">to</span> <span class="n">use</span> <span class="k">for</span> <span class="k">any</span> <span class="n">traces</span> <span class="n">created</span><span class="p">,</span> <span class="k">Default</span><span class="p">:</span> <span class="n">nginx</span>
jaeger-service-name <span class="n">jaeger</span><span class="o">-</span><span class="n">service</span><span class="o">-</span><span class="n">name</span>
# specifies the sampler to be used when sampling traces. <span class="o">#</span> <span class="n">specifies</span> <span class="n">the</span> <span class="n">sampler</span> <span class="k">to</span> <span class="n">be</span> <span class="n">used</span> <span class="k">when</span> <span class="n">sampling</span> <span class="n">traces</span><span class="p">.</span>
# The available samplers are: const, probabilistic, ratelimiting, remote, Default: const <span class="o">#</span> <span class="n">The</span> <span class="n">available</span> <span class="n">samplers</span> <span class="k">are</span><span class="p">:</span> <span class="n">const</span><span class="p">,</span> <span class="n">probabilistic</span><span class="p">,</span> <span class="n">ratelimiting</span><span class="p">,</span> <span class="n">remote</span><span class="p">,</span> <span class="k">Default</span><span class="p">:</span> <span class="n">const</span>
jaeger-sampler-type <span class="n">jaeger</span><span class="o">-</span><span class="n">sampler</span><span class="o">-</span><span class="k">type</span>
# specifies the argument to be passed to the sampler constructor, Default: 1 <span class="o">#</span> <span class="n">specifies</span> <span class="n">the</span> <span class="n">argument</span> <span class="k">to</span> <span class="n">be</span> <span class="n">passed</span> <span class="k">to</span> <span class="n">the</span> <span class="n">sampler</span> <span class="k">constructor</span><span class="p">,</span> <span class="k">Default</span><span class="p">:</span> <span class="mi">1</span>
jaeger-sampler-param <span class="n">jaeger</span><span class="o">-</span><span class="n">sampler</span><span class="o">-</span><span class="n">param</span>
# Specifies the custom remote sampler host to be passed to the sampler constructor. Must be a valid URL. <span class="o">#</span> <span class="n">Specifies</span> <span class="n">the</span> <span class="n">custom</span> <span class="n">remote</span> <span class="n">sampler</span> <span class="k">host</span> <span class="k">to</span> <span class="n">be</span> <span class="n">passed</span> <span class="k">to</span> <span class="n">the</span> <span class="n">sampler</span> <span class="k">constructor</span><span class="p">.</span> <span class="n">Must</span> <span class="n">be</span> <span class="n">a</span> <span class="k">valid</span> <span class="n">URL</span><span class="p">.</span>
# Default: http://127.0.0.1 <span class="o">#</span> <span class="k">Default</span><span class="p">:</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span>
jaeger-sampler-host <span class="n">jaeger</span><span class="o">-</span><span class="n">sampler</span><span class="o">-</span><span class="k">host</span>
# Specifies the custom remote sampler port to be passed to the sampler constructor. Must be a number. Default: 5778 <span class="o">#</span> <span class="n">Specifies</span> <span class="n">the</span> <span class="n">custom</span> <span class="n">remote</span> <span class="n">sampler</span> <span class="n">port</span> <span class="k">to</span> <span class="n">be</span> <span class="n">passed</span> <span class="k">to</span> <span class="n">the</span> <span class="n">sampler</span> <span class="k">constructor</span><span class="p">.</span> <span class="n">Must</span> <span class="n">be</span> <span class="n">a</span> <span class="nb">number</span><span class="p">.</span> <span class="k">Default</span><span class="p">:</span> <span class="mi">5778</span>
jaeger-sampler-port <span class="n">jaeger</span><span class="o">-</span><span class="n">sampler</span><span class="o">-</span><span class="n">port</span>
# Specifies the header name used for passing trace context. Must be a string. Default: uber-trace-id <span class="o">#</span> <span class="n">Specifies</span> <span class="n">the</span> <span class="n">header</span> <span class="n">name</span> <span class="n">used</span> <span class="k">for</span> <span class="n">passing</span> <span class="n">trace</span> <span class="n">context</span><span class="p">.</span> <span class="n">Must</span> <span class="n">be</span> <span class="n">a</span> <span class="n">string</span><span class="p">.</span> <span class="k">Default</span><span class="p">:</span> <span class="n">uber</span><span class="o">-</span><span class="n">trace</span><span class="o">-</span><span class="n">id</span>
jaeger-trace-context-header-name <span class="n">jaeger</span><span class="o">-</span><span class="n">trace</span><span class="o">-</span><span class="n">context</span><span class="o">-</span><span class="n">header</span><span class="o">-</span><span class="n">name</span>
# Specifies the header name used for force sampling. Must be a string. Default: jaeger-debug-id <span class="o">#</span> <span class="n">Specifies</span> <span class="n">the</span> <span class="n">header</span> <span class="n">name</span> <span class="n">used</span> <span class="k">for</span> <span class="k">force</span> <span class="n">sampling</span><span class="p">.</span> <span class="n">Must</span> <span class="n">be</span> <span class="n">a</span> <span class="n">string</span><span class="p">.</span> <span class="k">Default</span><span class="p">:</span> <span class="n">jaeger</span><span class="o">-</span><span class="n">debug</span><span class="o">-</span><span class="n">id</span>
jaeger-debug-header <span class="n">jaeger</span><span class="o">-</span><span class="n">debug</span><span class="o">-</span><span class="n">header</span>
# Specifies the header name used to submit baggage if there is no root span. Must be a string. Default: jaeger-baggage <span class="o">#</span> <span class="n">Specifies</span> <span class="n">the</span> <span class="n">header</span> <span class="n">name</span> <span class="n">used</span> <span class="k">to</span> <span class="n">submit</span> <span class="n">baggage</span> <span class="k">if</span> <span class="n">there</span> <span class="k">is</span> <span class="k">no</span> <span class="n">root</span> <span class="n">span</span><span class="p">.</span> <span class="n">Must</span> <span class="n">be</span> <span class="n">a</span> <span class="n">string</span><span class="p">.</span> <span class="k">Default</span><span class="p">:</span> <span class="n">jaeger</span><span class="o">-</span><span class="n">baggage</span>
jaeger-baggage-header <span class="n">jaeger</span><span class="o">-</span><span class="n">baggage</span><span class="o">-</span><span class="n">header</span>
# Specifies the header prefix used to propagate baggage. Must be a string. Default: uberctx- <span class="o">#</span> <span class="n">Specifies</span> <span class="n">the</span> <span class="n">header</span> <span class="k">prefix</span> <span class="n">used</span> <span class="k">to</span> <span class="n">propagate</span> <span class="n">baggage</span><span class="p">.</span> <span class="n">Must</span> <span class="n">be</span> <span class="n">a</span> <span class="n">string</span><span class="p">.</span> <span class="k">Default</span><span class="p">:</span> <span class="n">uberctx</span><span class="o">-</span>
jaeger-tracer-baggage-header-prefix <span class="n">jaeger</span><span class="o">-</span><span class="n">tracer</span><span class="o">-</span><span class="n">baggage</span><span class="o">-</span><span class="n">header</span><span class="o">-</span><span class="k">prefix</span>
# specifies the port to use when uploading traces, Default 8126 <span class="o">#</span> <span class="n">specifies</span> <span class="n">the</span> <span class="n">port</span> <span class="k">to</span> <span class="n">use</span> <span class="k">when</span> <span class="n">uploading</span> <span class="n">traces</span><span class="p">,</span> <span class="k">Default</span> <span class="mi">8126</span>
datadog-collector-port <span class="n">datadog</span><span class="o">-</span><span class="n">collector</span><span class="o">-</span><span class="n">port</span>
# specifies the service name to use for any traces created, Default: nginx <span class="o">#</span> <span class="n">specifies</span> <span class="n">the</span> <span class="n">service</span> <span class="n">name</span> <span class="k">to</span> <span class="n">use</span> <span class="k">for</span> <span class="k">any</span> <span class="n">traces</span> <span class="n">created</span><span class="p">,</span> <span class="k">Default</span><span class="p">:</span> <span class="n">nginx</span>
datadog-service-name <span class="n">datadog</span><span class="o">-</span><span class="n">service</span><span class="o">-</span><span class="n">name</span>
# specifies the operation name to use for any traces collected, Default: nginx.handle <span class="o">#</span> <span class="n">specifies</span> <span class="n">the</span> <span class="k">operation</span> <span class="n">name</span> <span class="k">to</span> <span class="n">use</span> <span class="k">for</span> <span class="k">any</span> <span class="n">traces</span> <span class="n">collected</span><span class="p">,</span> <span class="k">Default</span><span class="p">:</span> <span class="n">nginx</span><span class="p">.</span><span class="n">handle</span>
datadog-operation-name-override <span class="n">datadog</span><span class="o">-</span><span class="k">operation</span><span class="o">-</span><span class="n">name</span><span class="o">-</span><span class="n">override</span>
# Specifies to use client-side sampling for distributed priority sampling and ignore sample rate, Default: true <span class="o">#</span> <span class="n">Specifies</span> <span class="k">to</span> <span class="n">use</span> <span class="n">client</span><span class="o">-</span><span class="n">side</span> <span class="n">sampling</span> <span class="k">for</span> <span class="n">distributed</span> <span class="n">priority</span> <span class="n">sampling</span> <span class="k">and</span> <span class="k">ignore</span> <span class="n">sample</span> <span class="n">rate</span><span class="p">,</span> <span class="k">Default</span><span class="p">:</span> <span class="k">true</span>
datadog-priority-sampling <span class="n">datadog</span><span class="o">-</span><span class="n">priority</span><span class="o">-</span><span class="n">sampling</span>
# specifies sample rate for any traces created, Default: 1.0 <span class="o">#</span> <span class="n">specifies</span> <span class="n">sample</span> <span class="n">rate</span> <span class="k">for</span> <span class="k">any</span> <span class="n">traces</span> <span class="n">created</span><span class="p">,</span> <span class="k">Default</span><span class="p">:</span> <span class="mi">1</span><span class="p">.</span><span class="mi">0</span>
datadog-sample-rate <span class="n">datadog</span><span class="o">-</span><span class="n">sample</span><span class="o">-</span><span class="n">rate</span>
</pre></div></p> </code></pre></div></p>
<p>All these options (including host) allow environment variables, such as <code class="codehilite">$HOSTNAME</code> or <code class="codehilite">$HOST_IP</code>. In the case of Jaeger, if you have a Jaeger agent running on each machine in your cluster, you can use something like <code class="codehilite">$HOST_IP</code> (which can be 'mounted' with the <code class="codehilite">status.hostIP</code> fieldpath, as described <a href="https://kubernetes.io/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/#capabilities-of-the-downward-api">here</a>) to make sure traces will be sent to the local agent.</p> <p>All these options (including host) allow environment variables, such as <code class="codehilite"><span class="err">$HOSTNAME</span></code> or <code class="codehilite"><span class="err">$HOST_IP</span></code>. In the case of Jaeger, if you have a Jaeger agent running on each machine in your cluster, you can use something like <code class="codehilite"><span class="err">$HOST_IP</span></code> (which can be 'mounted' with the <code class="codehilite"><span class="err">status.hostIP</span></code> fieldpath, as described <a href="https://kubernetes.io/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/#capabilities-of-the-downward-api">here</a>) to make sure traces will be sent to the local agent.</p>
<h2 id="examples">Examples<a class="headerlink" href="#examples" title="Permanent link"></a></h2> <h2 id="examples">Examples<a class="headerlink" href="#examples" title="Permanent link"></a></h2>
<p>The following examples show how to deploy and test different distributed tracing systems. These example can be performed <p>The following examples show how to deploy and test different distributed tracing systems. These example can be performed
using Minikube.</p> using Minikube.</p>
<h3 id="zipkin">Zipkin<a class="headerlink" href="#zipkin" title="Permanent link"></a></h3> <h3 id="zipkin">Zipkin<a class="headerlink" href="#zipkin" title="Permanent link"></a></h3>
<p>In the <a href="https://github.com/rnburn/zipkin-date-server">rnburn/zipkin-date-server</a> <p>In the <a href="https://github.com/rnburn/zipkin-date-server">rnburn/zipkin-date-server</a>
GitHub repository is an example of a dockerized date service. To install the example and Zipkin collector run:</p> GitHub repository is an example of a dockerized date service. To install the example and Zipkin collector run:</p>
<div class="codehilite"><pre><span></span>kubectl create -f https://raw.githubusercontent.com/rnburn/zipkin-date-server/master/kubernetes/zipkin.yaml <div class="codehilite"><pre><span></span><code><span class="err">kubectl create -f https://raw.githubusercontent.com/rnburn/zipkin-date-server/master/kubernetes/zipkin.yaml</span>
kubectl create -f https://raw.githubusercontent.com/rnburn/zipkin-date-server/master/kubernetes/deployment.yaml <span class="err">kubectl create -f https://raw.githubusercontent.com/rnburn/zipkin-date-server/master/kubernetes/deployment.yaml</span>
</pre></div> </code></pre></div>
<p>Also we need to configure the NGINX controller ConfigMap with the required values:</p> <p>Also we need to configure the NGINX controller ConfigMap with the required values:</p>
<div class="codehilite"><pre><span></span>$ <span class="nb">echo</span> <span class="s1">&#39;</span> <div class="codehilite"><pre><span></span><code>$ <span class="nb">echo</span> <span class="s1">&#39;</span>
<span class="s1">apiVersion: v1</span> <span class="s1">apiVersion: v1</span>
<span class="s1">kind: ConfigMap</span> <span class="s1">kind: ConfigMap</span>
<span class="s1">data:</span> <span class="s1">data:</span>
@ -1355,7 +1355,7 @@ kubectl create -f https://raw.githubusercontent.com/rnburn/zipkin-date-server/ma
<span class="s1"> name: nginx-configuration</span> <span class="s1"> name: nginx-configuration</span>
<span class="s1"> namespace: kube-system</span> <span class="s1"> namespace: kube-system</span>
<span class="s1">&#39;</span> <span class="p">|</span> kubectl replace -f - <span class="s1">&#39;</span> <span class="p">|</span> kubectl replace -f -
</pre></div> </code></pre></div>
<p>In the Zipkin interface we can see the details: <p>In the Zipkin interface we can see the details:
<img alt="zipkin screenshot" src="../../../images/zipkin-demo.png" title="zipkin collector screenshot" /></p> <img alt="zipkin screenshot" src="../../../images/zipkin-demo.png" title="zipkin collector screenshot" /></p>
@ -1363,43 +1363,43 @@ kubectl create -f https://raw.githubusercontent.com/rnburn/zipkin-date-server/ma
<ol> <ol>
<li> <li>
<p>Enable Ingress addon in Minikube: <p>Enable Ingress addon in Minikube:
<div class="codehilite"><pre><span></span>$ minikube addons <span class="nb">enable</span> ingress <div class="codehilite"><pre><span></span><code>$ minikube addons <span class="nb">enable</span> ingress
</pre></div></p> </code></pre></div></p>
</li> </li>
<li> <li>
<p>Add Minikube IP to /etc/hosts: <p>Add Minikube IP to /etc/hosts:
<div class="codehilite"><pre><span></span>$ <span class="nb">echo</span> <span class="s2">&quot;</span><span class="k">$(</span>minikube ip<span class="k">)</span><span class="s2"> example.com&quot;</span> <span class="p">|</span> sudo tee -a /etc/hosts <div class="codehilite"><pre><span></span><code>$ <span class="nb">echo</span> <span class="s2">&quot;</span><span class="k">$(</span>minikube ip<span class="k">)</span><span class="s2"> example.com&quot;</span> <span class="p">|</span> sudo tee -a /etc/hosts
</pre></div></p> </code></pre></div></p>
</li> </li>
<li> <li>
<p>Apply a basic Service and Ingress Resource: <p>Apply a basic Service and Ingress Resource:
<div class="codehilite"><pre><span></span># Create Echoheaders Deployment <div class="codehilite"><pre><span></span><code><span class="o">#</span> <span class="k">Create</span> <span class="n">Echoheaders</span> <span class="n">Deployment</span>
$ kubectl run echoheaders --image=k8s.gcr.io/echoserver:1.4 --replicas=1 --port=8080 <span class="err">$</span> <span class="n">kubectl</span> <span class="n">run</span> <span class="n">echoheaders</span> <span class="c1">--image=k8s.gcr.io/echoserver:1.4 --replicas=1 --port=8080</span>
# Expose as a Cluster-IP <span class="o">#</span> <span class="n">Expose</span> <span class="k">as</span> <span class="n">a</span> <span class="k">Cluster</span><span class="o">-</span><span class="n">IP</span>
$ kubectl expose deployment echoheaders --port=80 --target-port=8080 --name=echoheaders-x <span class="err">$</span> <span class="n">kubectl</span> <span class="n">expose</span> <span class="n">deployment</span> <span class="n">echoheaders</span> <span class="c1">--port=80 --target-port=8080 --name=echoheaders-x</span>
# Apply the Ingress Resource <span class="o">#</span> <span class="n">Apply</span> <span class="n">the</span> <span class="n">Ingress</span> <span class="n">Resource</span>
$ echo &#39; <span class="err">$</span> <span class="n">echo</span> <span class="s1">&#39;</span>
apiVersion: networking.k8s.io/v1beta1 <span class="s1"> apiVersion: networking.k8s.io/v1beta1</span>
kind: Ingress <span class="s1"> kind: Ingress</span>
metadata: <span class="s1"> metadata:</span>
name: echo-ingress <span class="s1"> name: echo-ingress</span>
spec: <span class="s1"> spec:</span>
rules: <span class="s1"> rules:</span>
- host: example.com <span class="s1"> - host: example.com</span>
http: <span class="s1"> http:</span>
paths: <span class="s1"> paths:</span>
- backend: <span class="s1"> - backend:</span>
serviceName: echoheaders-x <span class="s1"> serviceName: echoheaders-x</span>
servicePort: 80 <span class="s1"> servicePort: 80</span>
path: /echo <span class="s1"> path: /echo</span>
&#39; | kubectl apply -f - <span class="s1"> &#39;</span> <span class="o">|</span> <span class="n">kubectl</span> <span class="n">apply</span> <span class="o">-</span><span class="n">f</span> <span class="o">-</span>
</pre></div></p> </code></pre></div></p>
</li> </li>
<li> <li>
<p>Enable OpenTracing and set the jaeger-collector-host: <p>Enable OpenTracing and set the jaeger-collector-host:
<div class="codehilite"><pre><span></span>$ <span class="nb">echo</span> <span class="s1">&#39;</span> <div class="codehilite"><pre><span></span><code>$ <span class="nb">echo</span> <span class="s1">&#39;</span>
<span class="s1"> apiVersion: v1</span> <span class="s1"> apiVersion: v1</span>
<span class="s1"> kind: ConfigMap</span> <span class="s1"> kind: ConfigMap</span>
<span class="s1"> data:</span> <span class="s1"> data:</span>
@ -1409,16 +1409,16 @@ $ echo &#39;
<span class="s1"> name: nginx-configuration</span> <span class="s1"> name: nginx-configuration</span>
<span class="s1"> namespace: kube-system</span> <span class="s1"> namespace: kube-system</span>
<span class="s1"> &#39;</span> <span class="p">|</span> kubectl replace -f - <span class="s1"> &#39;</span> <span class="p">|</span> kubectl replace -f -
</pre></div></p> </code></pre></div></p>
</li> </li>
<li> <li>
<p>Apply the Jaeger All-In-One Template: <p>Apply the Jaeger All-In-One Template:
<div class="codehilite"><pre><span></span>$ kubectl apply -f https://raw.githubusercontent.com/jaegertracing/jaeger-kubernetes/master/all-in-one/jaeger-all-in-one-template.yml <div class="codehilite"><pre><span></span><code>$ kubectl apply -f https://raw.githubusercontent.com/jaegertracing/jaeger-kubernetes/master/all-in-one/jaeger-all-in-one-template.yml
</pre></div></p> </code></pre></div></p>
</li> </li>
<li> <li>
<p>Make a few requests to the Service: <p>Make a few requests to the Service:
<div class="codehilite"><pre><span></span>$ curl example.com/echo -d <span class="s2">&quot;meow&quot;</span> <div class="codehilite"><pre><span></span><code>$ curl example.com/echo -d <span class="s2">&quot;meow&quot;</span>
CLIENT VALUES: CLIENT VALUES:
<span class="nv">client_address</span><span class="o">=</span><span class="m">172</span>.17.0.5 <span class="nv">client_address</span><span class="o">=</span><span class="m">172</span>.17.0.5
@ -1447,14 +1447,14 @@ x-real-ip<span class="o">=</span><span class="m">192</span>.168.99.1
x-scheme<span class="o">=</span>http x-scheme<span class="o">=</span>http
BODY: BODY:
meow meow
</pre></div></p> </code></pre></div></p>
</li> </li>
<li> <li>
<p>View the Jaeger UI: <p>View the Jaeger UI:
<div class="codehilite"><pre><span></span>$ minikube service jaeger-query --url <div class="codehilite"><pre><span></span><code>$ minikube service jaeger-query --url
http://192.168.99.100:30183 http://192.168.99.100:30183
</pre></div></p> </code></pre></div></p>
<p>In the Jaeger interface we can see the details: <p>In the Jaeger interface we can see the details:
<img alt="jaeger screenshot" src="../../../images/jaeger-demo.png" title="jaeger collector screenshot" /></p> <img alt="jaeger screenshot" src="../../../images/jaeger-demo.png" title="jaeger collector screenshot" /></p>
</li> </li>
@ -1468,6 +1468,7 @@ http://192.168.99.100:30183
</article> </article>
</div> </div>
</div> </div>
@ -1516,9 +1517,9 @@ http://192.168.99.100:30183
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1528,7 +1529,7 @@ http://192.168.99.100:30183
</div> </div>
<script src="../../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../../.."}})</script>

View file

@ -34,7 +34,7 @@
<meta name="lang:search.tokenizer" content="[\s\-]+"> <meta name="lang:search.tokenizer" content="[\s\-]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png"> <link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3"> <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.6.2">
@ -42,7 +42,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css"> <link rel="stylesheet" href="../../assets/stylesheets/application.adb8469c.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css"> <link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
@ -53,12 +53,12 @@
<script src="../../assets/javascripts/modernizr.74668098.js"></script> <script src="../../assets/javascripts/modernizr.86422ebf.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style> <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
@ -114,7 +114,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#tlshttps" tabindex="1" class="md-skip"> <a href="#tlshttps" tabindex="0" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -123,7 +123,7 @@
<nav class="md-header-nav md-grid"> <nav class="md-header-nav md-grid">
<div class="md-flex"> <div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
<a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" class="md-header-nav__button md-logo"> <a href="https://kubernetes.github.io/ingress-nginx" title="NGINX Ingress Controller" aria-label="NGINX Ingress Controller" class="md-header-nav__button md-logo">
<i class="md-icon">public</i> <i class="md-icon">public</i>
@ -154,7 +154,7 @@
<label class="md-search__overlay" for="__search"></label> <label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search"> <div class="md-search__inner" role="search">
<form class="md-search__form" name="search"> <form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label> <label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD; &#xE5CD;
@ -1307,30 +1307,30 @@
<h2 id="tls-secrets">TLS Secrets<a class="headerlink" href="#tls-secrets" title="Permanent link"></a></h2> <h2 id="tls-secrets">TLS Secrets<a class="headerlink" href="#tls-secrets" title="Permanent link"></a></h2>
<p>Anytime we reference a TLS secret, we mean a PEM-encoded X.509, RSA (2048) secret.</p> <p>Anytime we reference a TLS secret, we mean a PEM-encoded X.509, RSA (2048) secret.</p>
<p>You can generate a self-signed certificate and private key with:</p> <p>You can generate a self-signed certificate and private key with:</p>
<div class="codehilite"><pre><span></span>$ openssl req -x509 -nodes -days <span class="m">365</span> -newkey rsa:2048 -keyout <span class="si">${</span><span class="nv">KEY_FILE</span><span class="si">}</span> -out <span class="si">${</span><span class="nv">CERT_FILE</span><span class="si">}</span> -subj <span class="s2">&quot;/CN=</span><span class="si">${</span><span class="nv">HOST</span><span class="si">}</span><span class="s2">/O=</span><span class="si">${</span><span class="nv">HOST</span><span class="si">}</span><span class="s2">&quot;</span> <div class="codehilite"><pre><span></span><code>$ openssl req -x509 -nodes -days <span class="m">365</span> -newkey rsa:2048 -keyout <span class="si">${</span><span class="nv">KEY_FILE</span><span class="si">}</span> -out <span class="si">${</span><span class="nv">CERT_FILE</span><span class="si">}</span> -subj <span class="s2">&quot;/CN=</span><span class="si">${</span><span class="nv">HOST</span><span class="si">}</span><span class="s2">/O=</span><span class="si">${</span><span class="nv">HOST</span><span class="si">}</span><span class="s2">&quot;</span>
</pre></div> </code></pre></div>
<p>Then create the secret in the cluster via:</p> <p>Then create the secret in the cluster via:</p>
<div class="codehilite"><pre><span></span>kubectl create secret tls <span class="si">${</span><span class="nv">CERT_NAME</span><span class="si">}</span> --key <span class="si">${</span><span class="nv">KEY_FILE</span><span class="si">}</span> --cert <span class="si">${</span><span class="nv">CERT_FILE</span><span class="si">}</span> <div class="codehilite"><pre><span></span><code>kubectl create secret tls <span class="si">${</span><span class="nv">CERT_NAME</span><span class="si">}</span> --key <span class="si">${</span><span class="nv">KEY_FILE</span><span class="si">}</span> --cert <span class="si">${</span><span class="nv">CERT_FILE</span><span class="si">}</span>
</pre></div> </code></pre></div>
<p>The resulting secret will be of type <code class="codehilite">kubernetes.io/tls</code>.</p> <p>The resulting secret will be of type <code class="codehilite"><span class="err">kubernetes.io/tls</span></code>.</p>
<h2 id="default-ssl-certificate">Default SSL Certificate<a class="headerlink" href="#default-ssl-certificate" title="Permanent link"></a></h2> <h2 id="default-ssl-certificate">Default SSL Certificate<a class="headerlink" href="#default-ssl-certificate" title="Permanent link"></a></h2>
<p>NGINX provides the option to configure a server as a catch-all with <p>NGINX provides the option to configure a server as a catch-all with
<a href="http://nginx.org/en/docs/http/server_names.html">server_name</a> <a href="http://nginx.org/en/docs/http/server_names.html">server_name</a>
for requests that do not match any of the configured server names. for requests that do not match any of the configured server names.
This configuration works without out-of-the-box for HTTP traffic. This configuration works without out-of-the-box for HTTP traffic.
For HTTPS, a certificate is naturally required.</p> For HTTPS, a certificate is naturally required.</p>
<p>For this reason the Ingress controller provides the flag <code class="codehilite">--default-ssl-certificate</code>. <p>For this reason the Ingress controller provides the flag <code class="codehilite"><span class="err">--default-ssl-certificate</span></code>.
The secret referred to by this flag contains the default certificate to be used when The secret referred to by this flag contains the default certificate to be used when
accessing the catch-all server. accessing the catch-all server.
If this flag is not provided NGINX will use a self-signed certificate.</p> If this flag is not provided NGINX will use a self-signed certificate.</p>
<p>For instance, if you have a TLS secret <code class="codehilite">foo-tls</code> in the <code class="codehilite">default</code> namespace, <p>For instance, if you have a TLS secret <code class="codehilite"><span class="err">foo-tls</span></code> in the <code class="codehilite"><span class="err">default</span></code> namespace,
add <code class="codehilite">--default-ssl-certificate=default/foo-tls</code> in the <code class="codehilite">nginx-controller</code> deployment.</p> add <code class="codehilite"><span class="err">--default-ssl-certificate=default/foo-tls</span></code> in the <code class="codehilite"><span class="err">nginx-controller</span></code> deployment.</p>
<p>The default certificate will also be used for ingress <code class="codehilite">tls:</code> sections that do not <p>The default certificate will also be used for ingress <code class="codehilite"><span class="c">tls:</span></code> sections that do not
have a <code class="codehilite">secretName</code> option.</p> have a <code class="codehilite"><span class="err">secretName</span></code> option.</p>
<h2 id="ssl-passthrough">SSL Passthrough<a class="headerlink" href="#ssl-passthrough" title="Permanent link"></a></h2> <h2 id="ssl-passthrough">SSL Passthrough<a class="headerlink" href="#ssl-passthrough" title="Permanent link"></a></h2>
<p>The <a href="../cli-arguments/"><code class="codehilite">--enable-ssl-passthrough</code></a> flag enables the SSL Passthrough feature, which is disabled by <p>The <a href="../cli-arguments/"><code class="codehilite"><span class="err">--enable-ssl-passthrough</span></code></a> flag enables the SSL Passthrough feature, which is disabled by
default. This is required to enable passthrough backends in Ingress objects.</p> default. This is required to enable passthrough backends in Ingress objects.</p>
<div class="admonition warning"> <div class="admonition warning">
<p class="admonition-title">Warning</p> <p class="admonition-title">Warning</p>
@ -1353,18 +1353,18 @@ through the use of a special response header. Once a supported browser receives
this header that browser will prevent any communications from being sent over this header that browser will prevent any communications from being sent over
HTTP to the specified domain and will instead send all communications over HTTPS.</p> HTTP to the specified domain and will instead send all communications over HTTPS.</p>
<p>HSTS is enabled by default.</p> <p>HSTS is enabled by default.</p>
<p>To disable this behavior use <code class="codehilite">hsts: &quot;false&quot;</code> in the configuration <a href="../nginx-configuration/configmap/">ConfigMap</a>.</p> <p>To disable this behavior use <code class="codehilite"><span class="c">hsts: &quot;false&quot;</span></code> in the configuration <a href="../nginx-configuration/configmap/">ConfigMap</a>.</p>
<h2 id="server-side-https-enforcement-through-redirect">Server-side HTTPS enforcement through redirect<a class="headerlink" href="#server-side-https-enforcement-through-redirect" title="Permanent link"></a></h2> <h2 id="server-side-https-enforcement-through-redirect">Server-side HTTPS enforcement through redirect<a class="headerlink" href="#server-side-https-enforcement-through-redirect" title="Permanent link"></a></h2>
<p>By default the controller redirects HTTP clients to the HTTPS port <p>By default the controller redirects HTTP clients to the HTTPS port
443 using a 308 Permanent Redirect response if TLS is enabled for that Ingress.</p> 443 using a 308 Permanent Redirect response if TLS is enabled for that Ingress.</p>
<p>This can be disabled globally using <code class="codehilite">ssl-redirect: &quot;false&quot;</code> in the NGINX <a href="../nginx-configuration/configmap/">config map</a>, <p>This can be disabled globally using <code class="codehilite"><span class="c">ssl-redirect: &quot;false&quot;</span></code> in the NGINX <a href="../nginx-configuration/configmap/">config map</a>,
or per-Ingress with the <code class="codehilite">nginx.ingress.kubernetes.io/ssl-redirect: &quot;false&quot;</code> or per-Ingress with the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/ssl-redirect: &quot;false&quot;</span></code>
annotation in the particular resource.</p> annotation in the particular resource.</p>
<div class="admonition tip"> <div class="admonition tip">
<p class="admonition-title">Tip</p> <p class="admonition-title">Tip</p>
<p>When using SSL offloading outside of cluster (e.g. AWS ELB) it may be useful to enforce a <p>When using SSL offloading outside of cluster (e.g. AWS ELB) it may be useful to enforce a
redirect to HTTPS even when there is no TLS certificate available. redirect to HTTPS even when there is no TLS certificate available.
This can be achieved by using the <code class="codehilite">nginx.ingress.kubernetes.io/force-ssl-redirect: &quot;true&quot;</code> This can be achieved by using the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/force-ssl-redirect: &quot;true&quot;</span></code>
annotation in the particular resource.</p> annotation in the particular resource.</p>
</div> </div>
<h2 id="automated-certificate-management-with-kube-lego">Automated Certificate Management with Kube-Lego<a class="headerlink" href="#automated-certificate-management-with-kube-lego" title="Permanent link"></a></h2> <h2 id="automated-certificate-management-with-kube-lego">Automated Certificate Management with Kube-Lego<a class="headerlink" href="#automated-certificate-management-with-kube-lego" title="Permanent link"></a></h2>
@ -1376,8 +1376,8 @@ replaced by <a href="https://github.com/jetstack/cert-manager/">cert-manager</a>
<p><a href="https://github.com/jetstack/kube-lego">Kube-Lego</a> automatically requests missing or expired certificates from <a href="https://letsencrypt.org">Let's Encrypt</a> <p><a href="https://github.com/jetstack/kube-lego">Kube-Lego</a> automatically requests missing or expired certificates from <a href="https://letsencrypt.org">Let's Encrypt</a>
by monitoring ingress resources and their referenced secrets.</p> by monitoring ingress resources and their referenced secrets.</p>
<p>To enable this for an ingress resource you have to add an annotation:</p> <p>To enable this for an ingress resource you have to add an annotation:</p>
<div class="codehilite"><pre><span></span><span class="go">kubectl annotate ing ingress-demo kubernetes.io/tls-acme=&quot;true&quot;</span> <div class="codehilite"><pre><span></span><code><span class="go">kubectl annotate ing ingress-demo kubernetes.io/tls-acme=&quot;true&quot;</span>
</pre></div> </code></pre></div>
<p>To setup Kube-Lego you can take a look at this <a href="https://github.com/jetstack/kube-lego/tree/master/examples">full example</a>. <p>To setup Kube-Lego you can take a look at this <a href="https://github.com/jetstack/kube-lego/tree/master/examples">full example</a>.
The first version to fully support Kube-Lego is Nginx Ingress controller 0.8.</p> The first version to fully support Kube-Lego is Nginx Ingress controller 0.8.</p>
@ -1391,14 +1391,15 @@ May 2018, <a href="https://developer.android.com/about/dashboards/#Platform">app
are not compatible with nginx-ingress's default configuration.</p> are not compatible with nginx-ingress's default configuration.</p>
<p>To change this default behavior, use a <a href="../nginx-configuration/configmap/">ConfigMap</a>.</p> <p>To change this default behavior, use a <a href="../nginx-configuration/configmap/">ConfigMap</a>.</p>
<p>A sample ConfigMap fragment to allow these older clients to connect could look something like the following:</p> <p>A sample ConfigMap fragment to allow these older clients to connect could look something like the following:</p>
<div class="codehilite"><pre><span></span><span class="n">kind</span><span class="o">:</span> <span class="n">ConfigMap</span> <div class="codehilite"><pre><span></span><code><span class="n">kind</span><span class="o">:</span> <span class="n">ConfigMap</span>
<span class="n">apiVersion</span><span class="o">:</span> <span class="n">v1</span> <span class="n">apiVersion</span><span class="o">:</span> <span class="n">v1</span>
<span class="n">metadata</span><span class="o">:</span> <span class="n">metadata</span><span class="o">:</span>
<span class="n">name</span><span class="o">:</span> <span class="n">nginx</span><span class="o">-</span><span class="n">config</span> <span class="n">name</span><span class="o">:</span> <span class="n">nginx</span><span class="o">-</span><span class="n">config</span>
<span class="n">data</span><span class="o">:</span> <span class="n">data</span><span class="o">:</span>
<span class="n">ssl</span><span class="o">-</span><span class="n">ciphers</span><span class="o">:</span> <span class="s2">&quot;ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA&quot;</span> <span class="n">ssl</span><span class="o">-</span><span class="n">ciphers</span><span class="o">:</span> <span class="s2">&quot;ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA&quot;</span>
<span class="n">ssl</span><span class="o">-</span><span class="n">protocols</span><span class="o">:</span> <span class="s2">&quot;TLSv1 TLSv1.1 TLSv1.2&quot;</span> <span class="n">ssl</span><span class="o">-</span><span class="n">protocols</span><span class="o">:</span> <span class="s2">&quot;TLSv1 TLSv1.1 TLSv1.2&quot;</span>
</pre></div> </code></pre></div>
@ -1456,9 +1457,9 @@ are not compatible with nginx-ingress's default configuration.</p>
<div class="md-footer-copyright"> <div class="md-footer-copyright">
powered by powered by
<a href="https://www.mkdocs.org">MkDocs</a> <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
and and
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
@ -1468,7 +1469,7 @@ are not compatible with nginx-ingress's default configuration.</p>
</div> </div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script> <script src="../../assets/javascripts/application.c33a9706.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script> <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>