Deploy GitHub Pages
This commit is contained in:
parent
ec2af1dbc3
commit
006cda8fee
62 changed files with 1885 additions and 1843 deletions
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<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
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -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>
|
||||
<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>
|
||||
<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>
|
||||
<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><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">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>
|
||||
|
|
@ -1186,16 +1186,17 @@
|
|||
<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">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: "nginx"</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: "nginx"</span></code> annotation.
|
||||
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>
|
||||
<div class="codehilite"><pre><span></span>kubectl get services -n ingress-nginx
|
||||
</pre></div>
|
||||
<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><code><span class="err">kubectl get services -n ingress-nginx</span>
|
||||
</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">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1262,7 +1263,7 @@ Please note that the ingress resource should be placed inside the same namespace
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<a href="#command-line-arguments" tabindex="1" class="md-skip">
|
||||
<a href="#command-line-arguments" tabindex="0" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -1150,7 +1150,7 @@
|
|||
|
||||
<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>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>
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -1160,183 +1160,183 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code class="codehilite">--default-server-port int</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><code class="codehilite"><span class="err">--default-server-port int</span></code></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>
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code class="codehilite">--enable-dynamic-certificates</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><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"><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>
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
@ -1344,6 +1344,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1398,9 +1399,9 @@
|
|||
<div class="md-footer-copyright">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1410,7 +1411,7 @@
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<a href="#custom-errors" tabindex="1" class="md-skip">
|
||||
<a href="#custom-errors" tabindex="0" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -1149,8 +1149,8 @@
|
|||
|
||||
|
||||
<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
|
||||
that it passes several HTTP headers down to its <code class="codehilite">default-backend</code> in case of error:</p>
|
||||
<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"><span class="err">default-backend</span></code> in case of error:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -1160,45 +1160,45 @@ that it passes several HTTP headers down to its <code class="codehilite">default
|
|||
</thead>
|
||||
<tbody>
|
||||
<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>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code class="codehilite">X-Format</code></td>
|
||||
<td>Value of the <code class="codehilite">Accept</code> header sent by the client</td>
|
||||
<td><code class="codehilite"><span class="err">X-Format</span></code></td>
|
||||
<td>Value of the <code class="codehilite"><span class="err">Accept</span></code> header sent by the client</td>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<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>
|
||||
<div class="admonition important">
|
||||
<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>
|
||||
</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>
|
||||
|
|
@ -1206,6 +1206,7 @@ NGINX does not change the response from the custom default backend.</p>
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1260,9 +1261,9 @@ NGINX does not change the response from the custom default backend.</p>
|
|||
<div class="md-footer-copyright">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1272,7 +1273,7 @@ NGINX does not change the response from the custom default backend.</p>
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<a href="#default-backend" tabindex="1" class="md-skip">
|
||||
<a href="#default-backend" tabindex="0" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -1153,17 +1153,18 @@
|
|||
(i.e., all the requests that are not mapped with an Ingress).</p>
|
||||
<p>Basically a default backend exposes two URLs:</p>
|
||||
<ul>
|
||||
<li><code class="codehilite">/healthz</code> that returns 200</li>
|
||||
<li><code class="codehilite">/</code> that returns 404</li>
|
||||
<li><code class="codehilite"><span class="err">/healthz</span></code> that returns 200</li>
|
||||
<li><code class="codehilite"><span class="err">/</span></code> that returns 404</li>
|
||||
</ul>
|
||||
<div class="admonition example">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1218,9 +1219,9 @@ provides an additional service for the purpose of customizing the error pages se
|
|||
<div class="md-footer-copyright">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1230,7 +1231,7 @@ provides an additional service for the purpose of customizing the error pages se
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<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
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -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>
|
||||
<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:
|
||||
<code class="codehilite"><namespace/service name>:<service port>:[PROXY]:[PROXY]</code></p>
|
||||
<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"><span class="o"><</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">></span><span class="err">:</span><span class="o"><</span><span class="n">service</span><span class="w"> </span><span class="n">port</span><span class="o">></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.
|
||||
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>
|
||||
<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>
|
||||
<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>
|
||||
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"><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><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">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">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">9000</span><span class="p">:</span> <span class="s">"default/example-go:8080"</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>.
|
||||
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>
|
||||
<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>
|
||||
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><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">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">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">53</span><span class="p">:</span> <span class="s">"kube-system/kube-dns:53"</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>
|
||||
<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">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>
|
||||
|
|
@ -1201,10 +1201,11 @@ 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">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>
|
||||
</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">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1271,7 +1272,7 @@ The next example shows how to expose the service <code class="codehilite">kube-d
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<a href="#external-articles" tabindex="1" class="md-skip">
|
||||
<a href="#external-articles" tabindex="0" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -1158,6 +1158,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1212,9 +1213,9 @@
|
|||
<div class="md-footer-copyright">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1224,7 +1225,7 @@
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<a href="#exposing-fastcgi-servers" tabindex="1" class="md-skip">
|
||||
<a href="#exposing-fastcgi-servers" tabindex="0" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -688,20 +688,13 @@
|
|||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#the-fastcgi-ingress-annotations" class="md-nav__link">
|
||||
The FastCGI Ingress Annotations
|
||||
<a href="#fastcgi-ingress-annotations" class="md-nav__link">
|
||||
FastCGI Ingress Annotations
|
||||
</a>
|
||||
|
||||
<nav class="md-nav">
|
||||
<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">
|
||||
<a href="#the-nginxingresskubernetesiofastcgi-index-annotation" class="md-nav__link">
|
||||
The nginx.ingress.kubernetes.io/fastcgi-index Annotation
|
||||
|
|
@ -1209,20 +1202,13 @@
|
|||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#the-fastcgi-ingress-annotations" class="md-nav__link">
|
||||
The FastCGI Ingress Annotations
|
||||
<a href="#fastcgi-ingress-annotations" class="md-nav__link">
|
||||
FastCGI Ingress Annotations
|
||||
</a>
|
||||
|
||||
<nav class="md-nav">
|
||||
<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">
|
||||
<a href="#the-nginxingresskubernetesiofastcgi-index-annotation" class="md-nav__link">
|
||||
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>— Wikipedia</p>
|
||||
</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>
|
||||
<p>The <em>Pod</em> example object below exposes port <code class="codehilite">9000</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>
|
||||
<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><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">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>
|
||||
|
|
@ -1282,10 +1268,10 @@
|
|||
<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="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>
|
||||
<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>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><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">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>
|
||||
|
|
@ -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="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>
|
||||
</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>
|
||||
<div class="codehilite"><pre><span></span><span class="c1"># The ConfigMap MUST be created first for the ingress controller to be able to</span>
|
||||
<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><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="nt">apiVersion</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span>
|
||||
|
|
@ -1328,41 +1314,41 @@
|
|||
<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">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>
|
||||
<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">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>
|
||||
<h2 id="fastcgi-ingress-annotations">FastCGI Ingress Annotations<a class="headerlink" href="#fastcgi-ingress-annotations" title="Permanent link"> ¶</a></h2>
|
||||
<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>
|
||||
<blockquote>
|
||||
<p><code class="codehilite">nginx.ingress.kubernetes.io/backend-protocol: "FCGI"</code></p>
|
||||
<p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/backend-protocol: "FCGI"</span></code></p>
|
||||
</blockquote>
|
||||
<p>This enables the <em>FastCGI</em> mode for the whole <em>Ingress</em> object.</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>
|
||||
<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><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"><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"><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>
|
||||
<p><code class="codehilite">nginx.ingress.kubernetes.io/fastcgi-index: "index.php"</code></p>
|
||||
<p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/fastcgi-index: "index.php"</span></code></p>
|
||||
</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>
|
||||
<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>
|
||||
<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"><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>
|
||||
<p><code class="codehilite">nginx.ingress.kubernetes.io/fastcgi-params-configmap: "example-configmap"</code></p>
|
||||
<p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/fastcgi-params-configmap: "example-configmap"</span></code></p>
|
||||
</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><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>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><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">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">data</span><span class="p">:</span>
|
||||
<span class="nt">SCRIPT_FILENAME</span><span class="p">:</span> <span class="s">"/example/index.php"</span>
|
||||
<span class="nt">HTTP_PROXY</span><span class="p">:</span> <span class="s">""</span>
|
||||
</pre></div>
|
||||
</code></pre></div>
|
||||
Using the <em>namespace/</em> prefix is also supported, for example:</p>
|
||||
<blockquote>
|
||||
<p><code class="codehilite">nginx.ingress.kubernetes.io/fastcgi-params-configmap: "example-namespace/example-configmap"</code></p>
|
||||
<p><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/fastcgi-params-configmap: "example-namespace/example-configmap"</span></code></p>
|
||||
</blockquote>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1417,9 +1403,9 @@ Using the <em>namespace/</em> prefix is also supported, for example:</p>
|
|||
<div class="md-footer-copyright">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1429,7 +1415,7 @@ Using the <em>namespace/</em> prefix is also supported, for example:</p>
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<a href="#ingress-path-matching" tabindex="1" class="md-skip">
|
||||
<a href="#ingress-path-matching" tabindex="0" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -1277,17 +1277,17 @@
|
|||
<h2 id="regular-expression-support">Regular Expression Support<a class="headerlink" href="#regular-expression-support" title="Permanent link"> ¶</a></h2>
|
||||
<div class="admonition important">
|
||||
<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>
|
||||
<p>The ingress controller supports <strong>case insensitive</strong> regular expressions in the <code class="codehilite">spec.rules.http.paths.path</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>
|
||||
<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"><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">
|
||||
<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.
|
||||
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 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>
|
||||
<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">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>
|
||||
|
|
@ -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">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>
|
||||
</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>
|
||||
<div class="codehilite"><pre><span></span>location ~* "^/foo/.*" {
|
||||
...
|
||||
}
|
||||
</pre></div>
|
||||
<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><code><span class="err">location ~* "^/foo/.*" {</span>
|
||||
<span class="err"> ...</span>
|
||||
<span class="err">}</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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><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>
|
||||
<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">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>
|
||||
|
|
@ -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">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>
|
||||
</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">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>
|
||||
|
|
@ -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">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>
|
||||
</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>
|
||||
<div class="codehilite"><pre><span></span>location ~* ^/foo/bar/.+ {
|
||||
...
|
||||
}
|
||||
<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><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 ~* "^/foo/bar/" {
|
||||
...
|
||||
}
|
||||
<span class="k">location</span> <span class="o">~*</span> <span class="ss">"^/foo/bar/"</span> <span class="err">{</span>
|
||||
<span class="p">...</span>
|
||||
<span class="err">}</span>
|
||||
|
||||
location ~* "^/foo/bar" {
|
||||
...
|
||||
}
|
||||
</pre></div>
|
||||
<span class="k">location</span> <span class="o">~*</span> <span class="ss">"^/foo/bar"</span> <span class="err">{</span>
|
||||
<span class="p">...</span>
|
||||
<span class="err">}</span>
|
||||
</code></pre></div>
|
||||
|
||||
<p>The following request URI's would match the corresponding location blocks:</p>
|
||||
<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">test.com/foo/bar/</code> matches <code class="codehilite">~* ^/foo/bar/</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/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"><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"><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>
|
||||
<p><strong>IMPORTANT NOTES</strong>:</p>
|
||||
<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>
|
||||
<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>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>
|
||||
<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">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>
|
||||
|
|
@ -1399,22 +1399,23 @@ location ~* "^/foo/bar" {
|
|||
<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">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>
|
||||
<div class="codehilite"><pre><span></span>location ~* "^/foo/bar/[A-Z0-9]{3}" {
|
||||
...
|
||||
}
|
||||
<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><code><span class="k">location</span> <span class="o">~*</span> <span class="ss">"^/foo/bar/[A-Z0-9]{3}"</span> <span class="err">{</span>
|
||||
<span class="p">...</span>
|
||||
<span class="err">}</span>
|
||||
|
||||
location ~* "^/foo/bar/bar" {
|
||||
...
|
||||
}
|
||||
</pre></div>
|
||||
<span class="k">location</span> <span class="o">~*</span> <span class="ss">"^/foo/bar/bar"</span> <span class="err">{</span>
|
||||
<span class="p">...</span>
|
||||
<span class="err">}</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1469,9 +1470,9 @@ location ~* "^/foo/bar/bar" {
|
|||
<div class="md-footer-copyright">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1481,7 +1482,7 @@ location ~* "^/foo/bar/bar" {
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<a href="#miscellaneous" tabindex="1" class="md-skip">
|
||||
<a href="#miscellaneous" tabindex="0" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -1279,38 +1279,39 @@
|
|||
|
||||
<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>
|
||||
<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>Another option is to enable proxy protocol using <code class="codehilite">use-proxy-protocol: "true"</code>.</p>
|
||||
<p>Another option is to enable proxy protocol using <code class="codehilite"><span class="c">use-proxy-protocol: "true"</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>
|
||||
<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>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>
|
||||
<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 default value of this settings is <code class="codehilite">60 seconds</code>.</p>
|
||||
<p>A more adequate value to support websockets is a value higher than one hour (<code class="codehilite">3600</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"><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"><span class="err">3600</span></code>).</p>
|
||||
<div class="admonition important">
|
||||
<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>
|
||||
<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>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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1365,9 +1366,9 @@ The previous behavior can be restored using <code class="codehilite">retry-non-i
|
|||
<div class="md-footer-copyright">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1377,7 +1378,7 @@ The previous behavior can be restored using <code class="codehilite">retry-non-i
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<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
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -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>
|
||||
<div class="admonition important">
|
||||
<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>
|
||||
<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>
|
||||
|
|
@ -1260,50 +1260,51 @@
|
|||
<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>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>
|
||||
</pre></div>
|
||||
<div class="codehilite"><pre><span></span><code><span class="go">kubectl apply --kustomize github.com/kubernetes/ingress-nginx/deploy/prometheus/</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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>
|
||||
<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">default-http-backend ClusterIP 10.103.59.201 <none> 80/TCP 3d</span>
|
||||
<span class="go">ingress-nginx NodePort 10.97.44.72 <none> 80:30100/TCP,443:30154/TCP,10254:32049/TCP 5h</span>
|
||||
<span class="go">prometheus-server NodePort 10.98.233.86 <none> 9090:32630/TCP 1m</span>
|
||||
</pre></div>
|
||||
</code></pre></div>
|
||||
|
||||
<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>
|
||||
</pre></div>
|
||||
<div class="codehilite"><pre><span></span><code><span class="go">kubectl get nodes -o wide</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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==\"InternalIP\"\)].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==\"InternalIP\"\)].address}</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>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>
|
||||
<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>
|
||||
</pre></div>
|
||||
<div class="codehilite"><pre><span></span><code><span class="go">kubectl apply --kustomize github.com/kubernetes/ingress-nginx/deploy/grafana/</span>
|
||||
</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">default-http-backend ClusterIP 10.103.59.201 <none> 80/TCP 3d</span>
|
||||
<span class="go">ingress-nginx NodePort 10.97.44.72 <none> 80:30100/TCP,443:30154/TCP,10254:32049/TCP 5h</span>
|
||||
<span class="go">prometheus-server NodePort 10.98.233.86 <none> 9090:32630/TCP 10m</span>
|
||||
<span class="go">grafana NodePort 10.98.233.87 <none> 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.
|
||||
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><img alt="Dashboard" src="../../images/grafana.png" /></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1370,7 +1371,7 @@ According to the above example, this URL will be http://10.192.0.3:31086</p>
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<a href="#multiple-ingress-controllers" tabindex="1" class="md-skip">
|
||||
<a href="#multiple-ingress-controllers" tabindex="0" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -1195,20 +1195,20 @@
|
|||
|
||||
<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,
|
||||
you need to specify the annotation <code class="codehilite">kubernetes.io/ingress.class: "nginx"</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: "nginx"</span></code> in all ingresses that you would like the ingress-nginx controller to claim.</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">annotations</span><span class="p">:</span>
|
||||
<span class="nt">kubernetes.io/ingress.class</span><span class="p">:</span> <span class="s">"gce"</span>
|
||||
</pre></div>
|
||||
</code></pre></div>
|
||||
|
||||
<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">annotations</span><span class="p">:</span>
|
||||
<span class="nt">kubernetes.io/ingress.class</span><span class="p">:</span> <span class="s">"nginx"</span>
|
||||
</pre></div>
|
||||
</code></pre></div>
|
||||
|
||||
<p>will target the nginx controller, forcing the GCE controller to ignore it.</p>
|
||||
<p>To reiterate, setting the annotation to any value which does not match a valid ingress class will force the NGINX Ingress controller to ignore your Ingress.
|
||||
|
|
@ -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>
|
||||
<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).
|
||||
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>
|
||||
<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">spec</span><span class="p">:</span>
|
||||
<span class="nt">containers</span><span class="p">:</span>
|
||||
|
|
@ -1228,18 +1228,19 @@ Here is a partial example:</p>
|
|||
<span class="p p-Indicator">-</span> <span class="s">'--election-id=ingress-controller-leader-internal'</span>
|
||||
<span class="p p-Indicator">-</span> <span class="s">'--ingress-class=nginx-internal'</span>
|
||||
<span class="p p-Indicator">-</span> <span class="s">'--configmap=ingress/nginx-ingress-internal-controller'</span>
|
||||
</pre></div>
|
||||
</code></pre></div>
|
||||
|
||||
<div class="admonition important">
|
||||
<p class="admonition-title">Important</p>
|
||||
<p>Deploying multiple Ingress controllers, of different types (e.g., <code class="codehilite">ingress-nginx</code> & <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> & <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>
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1294,9 +1295,9 @@ result in both or all controllers fighting to satisfy the Ingress, and all of th
|
|||
<div class="md-footer-copyright">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1306,7 +1307,7 @@ result in both or all controllers fighting to satisfy the Ingress, and all of th
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<a href="#annotations" tabindex="1" class="md-skip">
|
||||
<a href="#annotations" tabindex="0" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -1965,13 +1965,13 @@
|
|||
<p class="admonition-title">Tip</p>
|
||||
<p>Annotation keys and values can only be strings.
|
||||
Other types, such as boolean or numeric values must be quoted,
|
||||
i.e. <code class="codehilite">"true"</code>, <code class="codehilite">"false"</code>, <code class="codehilite">"100"</code>.</p>
|
||||
i.e. <code class="codehilite"><span class="err">"true"</span></code>, <code class="codehilite"><span class="err">"false"</span></code>, <code class="codehilite"><span class="err">"100"</span></code>.</p>
|
||||
</div>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Note</p>
|
||||
<p>The annotation prefix can be changed using the
|
||||
<a href="../../cli-arguments/"><code class="codehilite">--annotations-prefix</code> command line argument</a>,
|
||||
but the default is <code class="codehilite">nginx.ingress.kubernetes.io</code>, as described in the
|
||||
<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"><span class="err">nginx.ingress.kubernetes.io</span></code>, as described in the
|
||||
table below.</p>
|
||||
</div>
|
||||
<table>
|
||||
|
|
@ -2405,71 +2405,71 @@ table below.</p>
|
|||
</tbody>
|
||||
</table>
|
||||
<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: "true"</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: "true"</span></code> is set:</p>
|
||||
<ul>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
</ul>
|
||||
<p>Canary rules are evaluated in order of precedence. Precedence is as follows:
|
||||
<code class="codehilite">canary-by-header -> canary-by-cookie -> canary-weight</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>
|
||||
<code class="codehilite"><span class="err">canary-by-header -> canary-by-cookie -> 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"><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>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>
|
||||
<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>
|
||||
<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>
|
||||
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"><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">
|
||||
<p class="admonition-title">Example</p>
|
||||
<p>Please check the <a href="../../../examples/rewrite/">rewrite</a> example.</p>
|
||||
</div>
|
||||
<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.
|
||||
The only affinity type available for NGINX is <code class="codehilite">cookie</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</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"><span class="err">cookie</span></code>.</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">
|
||||
<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 class="admonition example">
|
||||
<p class="admonition-title">Example</p>
|
||||
<p>Please check the <a href="../../../examples/affinity/cookie/">affinity</a> example.</p>
|
||||
</div>
|
||||
<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>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>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: "true"</code>.</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"><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"><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: "true"</span></code>.</p>
|
||||
<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>The annotations are:
|
||||
<div class="codehilite"><pre><span></span>nginx.ingress.kubernetes.io/auth-type: [basic|digest]
|
||||
</pre></div></p>
|
||||
<div class="codehilite"><pre><span></span><code><span class="err">nginx.ingress.kubernetes.io/auth-type: [basic|digest]</span>
|
||||
</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>
|
||||
<div class="codehilite"><pre><span></span>nginx.ingress.kubernetes.io/auth-secret: secretName
|
||||
</pre></div>
|
||||
<div class="codehilite"><pre><span></span><code><span class="err">nginx.ingress.kubernetes.io/auth-secret: secretName</span>
|
||||
</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>
|
||||
<div class="codehilite"><pre><span></span>nginx.ingress.kubernetes.io/auth-secret-type: [auth-file|auth-map]
|
||||
</pre></div>
|
||||
<div class="codehilite"><pre><span></span><code><span class="err">nginx.ingress.kubernetes.io/auth-secret-type: [auth-file|auth-map]</span>
|
||||
</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>
|
||||
<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">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-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"><span class="err">auth-map</span></code> - the keys of the secret are the usernames, and the values are the hashed passwords</li>
|
||||
</ul>
|
||||
<div class="codehilite"><pre><span></span>nginx.ingress.kubernetes.io/auth-realm: "realm string"
|
||||
</pre></div>
|
||||
<div class="codehilite"><pre><span></span><code><span class="err">nginx.ingress.kubernetes.io/auth-realm: "realm string"</span>
|
||||
</code></pre></div>
|
||||
|
||||
<div class="admonition example">
|
||||
<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>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><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: "$request_uri"</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><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: "$request_uri"</span></code> to consistently hash upstream requests by the current request URI.</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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<p>It is possible to enable Client Certificate Authentication using additional annotations in Ingress Rule.</p>
|
||||
<p>The annotations are:</p>
|
||||
<ul>
|
||||
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-tls-secret: secretName</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.
|
||||
<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"><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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
</ul>
|
||||
<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>
|
||||
<p>It is possible to authenticate to a proxied HTTPS backend with certificate using additional annotations in Ingress Rule.</p>
|
||||
<ul>
|
||||
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-ssl-secret: secretName</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.
|
||||
<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"><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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
</ul>
|
||||
<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>
|
||||
<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 "Request-Id: $req_id";</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>
|
||||
<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).
|
||||
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:
|
||||
<div class="codehilite"><pre><span></span>nginx.ingress.kubernetes.io/custom-http-errors: "404,415"
|
||||
</pre></div></p>
|
||||
<div class="codehilite"><pre><span></span><code><span class="err">nginx.ingress.kubernetes.io/custom-http-errors: "404,415"</span>
|
||||
</code></pre></div></p>
|
||||
<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: <svc name></code> to specify a custom default backend. This <code class="codehilite"><svc name></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: <svc name></span></code> to specify a custom default backend. This <code class="codehilite"><span class="err"><svc name></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>
|
||||
<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
|
||||
<code class="codehilite">nginx.ingress.kubernetes.io/enable-cors: "true"</code>. This will add a section in the server
|
||||
<code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/enable-cors: "true"</span></code>. This will add a section in the server
|
||||
location enabling this functionality.</p>
|
||||
<p>CORS can be controlled with the following annotations:</p>
|
||||
<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
|
||||
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>
|
||||
<p>Example: <code class="codehilite">nginx.ingress.kubernetes.io/cors-allow-methods: "PUT, GET, POST, OPTIONS"</code></p>
|
||||
<p>Example: <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/cors-allow-methods: "PUT, GET, POST, OPTIONS"</span></code></p>
|
||||
</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,
|
||||
numbers, _ and -.</p>
|
||||
</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>
|
||||
<p>Example: <code class="codehilite">nginx.ingress.kubernetes.io/cors-allow-headers: "X-Forwarded-For, X-app123-XPTO"</code></p>
|
||||
<p>Example: <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/cors-allow-headers: "X-Forwarded-For, X-app123-XPTO"</span></code></p>
|
||||
</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.
|
||||
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>Default: <code class="codehilite">*</code></li>
|
||||
<li>Default: <code class="codehilite"><span class="err">*</span></code></li>
|
||||
<li>
|
||||
<p>Example: <code class="codehilite">nginx.ingress.kubernetes.io/cors-allow-origin: "https://origin-site.com:4443"</code></p>
|
||||
<p>Example: <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/cors-allow-origin: "https://origin-site.com:4443"</span></code></p>
|
||||
</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>
|
||||
</li>
|
||||
<li>Default: <code class="codehilite">true</code></li>
|
||||
<li>Default: <code class="codehilite"><span class="err">true</span></code></li>
|
||||
<li>
|
||||
<p>Example: <code class="codehilite">nginx.ingress.kubernetes.io/cors-allow-credentials: "false"</code></p>
|
||||
<p>Example: <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/cors-allow-credentials: "false"</span></code></p>
|
||||
</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.
|
||||
Default: <code class="codehilite">1728000</code>
|
||||
Example: <code class="codehilite">nginx.ingress.kubernetes.io/cors-max-age: 600</code></p>
|
||||
Default: <code class="codehilite"><span class="err">1728000</span></code>
|
||||
Example: <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/cors-max-age: 600</span></code></p>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="admonition note">
|
||||
|
|
@ -2601,22 +2601,22 @@ location enabling this functionality.</p>
|
|||
<div class="admonition example">
|
||||
<p class="admonition-title">Example</p>
|
||||
<ul>
|
||||
<li><code class="codehilite">nginx.ingress.kubernetes.io/http2-push-preload: "true"</code></li>
|
||||
<li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/http2-push-preload: "true"</span></code></li>
|
||||
</ul>
|
||||
</div>
|
||||
<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: "<alias 1>,<alias 2>"</code>.
|
||||
This will create a server with the same configuration, but adding new values to the <code class="codehilite">server_name</code> directive.</p>
|
||||
<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: "<alias 1>,<alias 2>"</span></code>.
|
||||
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">
|
||||
<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.
|
||||
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>
|
||||
</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>
|
||||
<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>
|
||||
<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>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><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">metadata</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">return 301 https://m.example.com;</span>
|
||||
<span class="no">}</span>
|
||||
</pre></div>
|
||||
</code></pre></div>
|
||||
|
||||
<div class="admonition attention">
|
||||
<p class="admonition-title">Attention</p>
|
||||
|
|
@ -2648,82 +2648,85 @@ applied to each location provided in the ingress rule.</p>
|
|||
<div class="admonition example">
|
||||
<p class="admonition-title">Example</p>
|
||||
<ul>
|
||||
<li><code class="codehilite">nginx.ingress.kubernetes.io/client-body-buffer-size: "1000"</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">nginx.ingress.kubernetes.io/client-body-buffer-size: 1K</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">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: "1000"</span></code> # 1000 bytes</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"><span class="err">nginx.ingress.kubernetes.io/client-body-buffer-size: 1K</span></code> # 1 kilobyte</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"><span class="err">nginx.ingress.kubernetes.io/client-body-buffer-size: 1M</span></code> # 1 megabyte</li>
|
||||
</ul>
|
||||
</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>
|
||||
<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>
|
||||
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/auth-url</span><span class="p">:</span> <span class="s">"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"</span>
|
||||
</pre></div>
|
||||
<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><code><span class="nt">nginx.ingress.kubernetes.io/auth-url</span><span class="p">:</span> <span class="s">"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"</span>
|
||||
</code></pre></div>
|
||||
|
||||
<p>Additionally it is possible to set:</p>
|
||||
<ul>
|
||||
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-method</code>:
|
||||
<code class="codehilite"><Method></code> to specify the HTTP method to use.</li>
|
||||
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-signin</code>:
|
||||
<code class="codehilite"><SignIn_URL></code> to specify the location of the error page.</li>
|
||||
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-response-headers</code>:
|
||||
<code class="codehilite"><Response_Header_1, ..., Response_Header_n></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>:
|
||||
<code class="codehilite"><ConfigMap></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>:
|
||||
<code class="codehilite"><Request_Redirect_URL></code> to specify the X-Auth-Request-Redirect header value.</li>
|
||||
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-cache-key</code>:
|
||||
<code class="codehilite"><Cache_Key></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>
|
||||
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-cache-duration</code>:
|
||||
<code class="codehilite"><Cache_duration></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>
|
||||
<li><code class="codehilite">nginx.ingress.kubernetes.io/auth-snippet</code>:
|
||||
<code class="codehilite"><Auth_Snippet></code> to specify a custom snippet to use with external authentication, e.g.</li>
|
||||
<li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-method</span></code>:
|
||||
<code class="codehilite"><span class="err"><Method></span></code> to specify the HTTP method to use.</li>
|
||||
<li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-signin</span></code>:
|
||||
<code class="codehilite"><span class="err"><SignIn_URL></span></code> to specify the location of the error page.</li>
|
||||
<li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-response-headers</span></code>:
|
||||
<code class="codehilite"><span class="err"><Response_Header_1, ..., Response_Header_n></span></code> to specify headers to pass to backend once authentication request completes.</li>
|
||||
<li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-proxy-set-headers</span></code>:
|
||||
<code class="codehilite"><span class="err"><ConfigMap></span></code> the name of a ConfigMap that specifies headers to pass to the authentication service</li>
|
||||
<li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-request-redirect</span></code>:
|
||||
<code class="codehilite"><span class="err"><Request_Redirect_URL></span></code> to specify the X-Auth-Request-Redirect header value.</li>
|
||||
<li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/auth-cache-key</span></code>:
|
||||
<code class="codehilite"><span class="err"><Cache_Key></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"><span class="err">nginx.ingress.kubernetes.io/auth-cache-duration</span></code>:
|
||||
<code class="codehilite"><span class="err"><Cache_duration></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"><span class="err">nginx.ingress.kubernetes.io/auth-snippet</span></code>:
|
||||
<code class="codehilite"><span class="err"><Auth_Snippet></span></code> to specify a custom snippet to use with external authentication, e.g.</li>
|
||||
</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="no">proxy_set_header Foo-Header 42;</span>
|
||||
</pre></div>
|
||||
</code></pre></div>
|
||||
|
||||
<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>
|
||||
<div class="admonition example">
|
||||
<p class="admonition-title">Example</p>
|
||||
<p>Please check the <a href="../../../examples/auth/external-auth/">external-auth</a> example.</p>
|
||||
</div>
|
||||
<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: "false"</code> in the NGINX ConfigMap.
|
||||
<code class="codehilite">nginx.ingress.kubernetes.io/enable-global-auth</code>:
|
||||
indicates if GlobalExternalAuth configuration should be applied or not to this Ingress rule. Default values is set to <code class="codehilite">"true"</code>.</p>
|
||||
<p>!!! note For more information please see <a href="../configmap/#global-auth-url">global-auth-url</a>.</p>
|
||||
<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: "false"</span></code> in the NGINX ConfigMap.
|
||||
<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"><span class="err">"true"</span></code>.</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>
|
||||
<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>
|
||||
<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">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">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">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">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">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-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"><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"><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"><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"><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"><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>
|
||||
<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>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>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>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"><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"><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>
|
||||
<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>
|
||||
<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: '308'</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: '308'</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>
|
||||
<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>
|
||||
<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
|
||||
the User guide.</p>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Note</p>
|
||||
<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 class="admonition attention">
|
||||
<p class="admonition-title">Attention</p>
|
||||
|
|
@ -2732,37 +2735,37 @@ invalidates all the other annotations set on an Ingress object.</p>
|
|||
</div>
|
||||
<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>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>
|
||||
<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>
|
||||
<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>
|
||||
<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.
|
||||
If you want to disable this behavior globally, you can use <code class="codehilite">ssl-redirect: "false"</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: "false"</code>
|
||||
If you want to disable this behavior globally, you can use <code class="codehilite"><span class="c">ssl-redirect: "false"</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"><span class="err">nginx.ingress.kubernetes.io/ssl-redirect: "false"</span></code>
|
||||
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
|
||||
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: "true"</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: "true"</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>
|
||||
<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.
|
||||
To enable this feature use the annotation <code class="codehilite">nginx.ingress.kubernetes.io/from-to-www-redirect: "true"</code></p>
|
||||
<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"><span class="err">nginx.ingress.kubernetes.io/from-to-www-redirect: "true"</span></code></p>
|
||||
<div class="admonition attention">
|
||||
<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 class="admonition attention">
|
||||
<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>
|
||||
</div>
|
||||
<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.
|
||||
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>
|
||||
<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>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"><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"><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">
|
||||
<p class="admonition-title">Note</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.
|
||||
In some scenarios is required to have different values. To allow this we provide annotations that allows this customization:</p>
|
||||
<ul>
|
||||
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-connect-timeout</code></li>
|
||||
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-send-timeout</code></li>
|
||||
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-read-timeout</code></li>
|
||||
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-next-upstream</code></li>
|
||||
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-next-upstream-timeout</code></li>
|
||||
<li><code class="codehilite">nginx.ingress.kubernetes.io/proxy-next-upstream-tries</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-connect-timeout</span></code></li>
|
||||
<li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-send-timeout</span></code></li>
|
||||
<li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-read-timeout</span></code></li>
|
||||
<li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-next-upstream</span></code></li>
|
||||
<li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-next-upstream-timeout</span></code></li>
|
||||
<li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-next-upstream-tries</span></code></li>
|
||||
<li><code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/proxy-request-buffering</span></code></li>
|
||||
</ul>
|
||||
<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
|
||||
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>
|
||||
<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>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"><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"><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>
|
||||
<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>
|
||||
<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>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>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"><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>
|
||||
<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>
|
||||
</pre></div>
|
||||
<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>
|
||||
</code></pre></div>
|
||||
|
||||
<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>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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/proxy-buffering</span><span class="p">:</span> <span class="s">"on"</span>
|
||||
</pre></div>
|
||||
<div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/proxy-buffering</span><span class="p">:</span> <span class="s">"on"</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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>
|
||||
<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:
|
||||
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/proxy-buffers-number</span><span class="p">:</span> <span class="s">"4"</span>
|
||||
</pre></div></p>
|
||||
<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><code><span class="nt">nginx.ingress.kubernetes.io/proxy-buffers-number</span><span class="p">:</span> <span class="s">"4"</span>
|
||||
</code></pre></div></p>
|
||||
<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>
|
||||
<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:
|
||||
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/proxy-buffer-size</span><span class="p">:</span> <span class="s">"8k"</span>
|
||||
</pre></div></p>
|
||||
<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><code><span class="nt">nginx.ingress.kubernetes.io/proxy-buffer-size</span><span class="p">:</span> <span class="s">"8k"</span>
|
||||
</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>
|
||||
<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>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">"1024m"</span>
|
||||
</pre></div></p>
|
||||
<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">"1024m"</span>
|
||||
</code></pre></div></p>
|
||||
<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>
|
||||
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/proxy-http-version</span><span class="p">:</span> <span class="s">"1.0"</span>
|
||||
</pre></div>
|
||||
<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">"1.0"</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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>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>
|
||||
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/ssl-ciphers</span><span class="p">:</span> <span class="s">"ALL:!aNULL:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP"</span>
|
||||
</pre></div>
|
||||
<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><code><span class="nt">nginx.ingress.kubernetes.io/ssl-ciphers</span><span class="p">:</span> <span class="s">"ALL:!aNULL:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP"</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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.
|
||||
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">"keep-alive"</span>
|
||||
</pre></div>
|
||||
<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">"keep-alive"</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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
|
||||
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">"false"</span>
|
||||
</pre></div>
|
||||
<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">"false"</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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.
|
||||
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">"true"</span>
|
||||
</pre></div>
|
||||
<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">"true"</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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
|
||||
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">"true"</span>
|
||||
</pre></div>
|
||||
<div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/enable-opentracing</span><span class="p">:</span> <span class="s">"true"</span>
|
||||
</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>
|
||||
<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>
|
||||
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/x-forwarded-prefix</span><span class="p">:</span> <span class="s">"/path"</span>
|
||||
</pre></div>
|
||||
<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><code><span class="nt">nginx.ingress.kubernetes.io/x-forwarded-prefix</span><span class="p">:</span> <span class="s">"/path"</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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>
|
||||
<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">"active"</span>
|
||||
</pre></div>
|
||||
<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">"active"</span>
|
||||
</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">"true"</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>.
|
||||
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>
|
||||
<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.
|
||||
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>
|
||||
<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">"41000_sqli,</span><span class="nv"> </span><span class="s">42000_xss"</span>
|
||||
</pre></div>
|
||||
<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">"true"</span></code> in addition to the above configuration.
|
||||
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"><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"><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"><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><code><span class="nt">nginx.ingress.kubernetes.io/lua-resty-waf-ignore-rulesets</span><span class="p">:</span> <span class="s">"41000_sqli,</span><span class="nv"> </span><span class="s">42000_xss"</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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>
|
||||
<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">'[=[</span><span class="nv"> </span><span class="s">{</span><span class="nv"> </span><span class="s">"access":</span><span class="nv"> </span><span class="s">[</span><span class="nv"> </span><span class="s">{</span><span class="nv"> </span><span class="s">"actions":</span><span class="nv"> </span><span class="s">{</span><span class="nv"> </span><span class="s">"disrupt"</span><span class="nv"> </span><span class="s">:</span><span class="nv"> </span><span class="s">"DENY"</span><span class="nv"> </span><span class="s">},</span><span class="nv"> </span><span class="s">"id":</span><span class="nv"> </span><span class="s">10001,</span><span class="nv"> </span><span class="s">"msg":</span><span class="nv"> </span><span class="s">"my</span><span class="nv"> </span><span class="s">custom</span><span class="nv"> </span><span class="s">rule",</span><span class="nv"> </span><span class="s">"operator":</span><span class="nv"> </span><span class="s">"STR_CONTAINS",</span><span class="nv"> </span><span class="s">"pattern":</span><span class="nv"> </span><span class="s">"foo",</span><span class="nv"> </span><span class="s">"vars":</span><span class="nv"> </span><span class="s">[</span><span class="nv"> </span><span class="s">{</span><span class="nv"> </span><span class="s">"parse":</span><span class="nv"> </span><span class="s">[</span><span class="nv"> </span><span class="s">"values",</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">"type":</span><span class="nv"> </span><span class="s">"REQUEST_ARGS"</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">"body_filter":</span><span class="nv"> </span><span class="s">[],</span><span class="nv"> </span><span class="s">"header_filter":[]</span><span class="nv"> </span><span class="s">}</span><span class="nv"> </span><span class="s">]=]'</span>
|
||||
</pre></div>
|
||||
<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><code><span class="nt">nginx.ingress.kubernetes.io/lua-resty-waf-extra-rules</span><span class="p">:</span> <span class="s">'[=[</span><span class="nv"> </span><span class="s">{</span><span class="nv"> </span><span class="s">"access":</span><span class="nv"> </span><span class="s">[</span><span class="nv"> </span><span class="s">{</span><span class="nv"> </span><span class="s">"actions":</span><span class="nv"> </span><span class="s">{</span><span class="nv"> </span><span class="s">"disrupt"</span><span class="nv"> </span><span class="s">:</span><span class="nv"> </span><span class="s">"DENY"</span><span class="nv"> </span><span class="s">},</span><span class="nv"> </span><span class="s">"id":</span><span class="nv"> </span><span class="s">10001,</span><span class="nv"> </span><span class="s">"msg":</span><span class="nv"> </span><span class="s">"my</span><span class="nv"> </span><span class="s">custom</span><span class="nv"> </span><span class="s">rule",</span><span class="nv"> </span><span class="s">"operator":</span><span class="nv"> </span><span class="s">"STR_CONTAINS",</span><span class="nv"> </span><span class="s">"pattern":</span><span class="nv"> </span><span class="s">"foo",</span><span class="nv"> </span><span class="s">"vars":</span><span class="nv"> </span><span class="s">[</span><span class="nv"> </span><span class="s">{</span><span class="nv"> </span><span class="s">"parse":</span><span class="nv"> </span><span class="s">[</span><span class="nv"> </span><span class="s">"values",</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">"type":</span><span class="nv"> </span><span class="s">"REQUEST_ARGS"</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">"body_filter":</span><span class="nv"> </span><span class="s">[],</span><span class="nv"> </span><span class="s">"header_filter":[]</span><span class="nv"> </span><span class="s">}</span><span class="nv"> </span><span class="s">]=]'</span>
|
||||
</code></pre></div>
|
||||
|
||||
<p>Since the default allowed contents were <code class="codehilite">"text/html", "text/json", "application/json"</code>
|
||||
<p>Since the default allowed contents were <code class="codehilite"><span class="err">"text/html", "text/json", "application/json"</span></code>
|
||||
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">"true"</span>
|
||||
</pre></div>
|
||||
<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">"true"</span>
|
||||
</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>
|
||||
<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">"10"</span>
|
||||
</pre></div>
|
||||
<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">"10"</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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>
|
||||
<p>By default, it will be "true"</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">"false"</span>
|
||||
</pre></div>
|
||||
<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">"false"</span>
|
||||
</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>
|
||||
<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
|
||||
must be disabled manually.</p>
|
||||
<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">"true"</span>
|
||||
</pre></div>
|
||||
<div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/enable-modsecurity</span><span class="p">:</span> <span class="s">"true"</span>
|
||||
</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>
|
||||
<p>You can enable the <a href="https://www.modsecurity.org/CRS/Documentation/">OWASP Core Rule Set</a> by
|
||||
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">"true"</span>
|
||||
</pre></div></p>
|
||||
<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">"true"</span>
|
||||
</code></pre></div></p>
|
||||
<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">"$request_id"</span>
|
||||
</pre></div></p>
|
||||
<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">"$request_id"</span>
|
||||
</code></pre></div></p>
|
||||
<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">SecDebugLog /tmp/modsec_debug.log</span>
|
||||
</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
|
||||
<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></pre></div></p>
|
||||
<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"><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
|
||||
statement:</p>
|
||||
<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/modsecurity/modsecurity.conf</span>
|
||||
</pre></div>
|
||||
</code></pre></div>
|
||||
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>
|
||||
</pre></div></p>
|
||||
</code></pre></div></p>
|
||||
<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>
|
||||
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/enable-influxdb</span><span class="p">:</span> <span class="s">"true"</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">"true"</span>
|
||||
<span class="nt">nginx.ingress.kubernetes.io/influxdb-measurement</span><span class="p">:</span> <span class="s">"nginx-reqs"</span>
|
||||
<span class="nt">nginx.ingress.kubernetes.io/influxdb-port</span><span class="p">:</span> <span class="s">"8089"</span>
|
||||
<span class="nt">nginx.ingress.kubernetes.io/influxdb-host</span><span class="p">:</span> <span class="s">"127.0.0.1"</span>
|
||||
<span class="nt">nginx.ingress.kubernetes.io/influxdb-server-name</span><span class="p">:</span> <span class="s">"nginx-ingress"</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>
|
||||
<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
|
||||
|
|
@ -2954,51 +2957,52 @@ anyone of the <a href="https://github.com/influxdata/telegraf/tree/release-1.7/p
|
|||
Prometheus, etc.. (recommended)</li>
|
||||
</ul>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/backend-protocol</span><span class="p">:</span> <span class="s">"HTTPS"</span>
|
||||
</pre></div>
|
||||
<div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/backend-protocol</span><span class="p">:</span> <span class="s">"HTTPS"</span>
|
||||
</code></pre></div>
|
||||
|
||||
<h3 id="use-regex">Use Regex<a class="headerlink" href="#use-regex" title="Permanent link"> ¶</a></h3>
|
||||
<div class="admonition attention">
|
||||
<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>
|
||||
<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">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>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>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">"true"</span>
|
||||
</pre></div></p>
|
||||
<div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/use-regex</span><span class="p">:</span> <span class="s">"true"</span>
|
||||
</code></pre></div></p>
|
||||
<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">"false"</span>
|
||||
</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>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>
|
||||
<div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/use-regex</span><span class="p">:</span> <span class="s">"false"</span>
|
||||
</code></pre></div></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"><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>
|
||||
<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>
|
||||
<div class="codehilite"><pre><span></span><span class="nt">nginx.ingress.kubernetes.io/satisfy</span><span class="p">:</span> <span class="s">"any"</span>
|
||||
</pre></div>
|
||||
<div class="codehilite"><pre><span></span><code><span class="nt">nginx.ingress.kubernetes.io/satisfy</span><span class="p">:</span> <span class="s">"any"</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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>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>
|
||||
</pre></div>
|
||||
<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>
|
||||
</code></pre></div>
|
||||
|
||||
<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">"off"</span>
|
||||
</pre></div>
|
||||
<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">"off"</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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>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">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -3065,7 +3069,7 @@ Valid Values: HTTP, HTTPS, GRPC, GRPCS and AJP</p>
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<a href="#configmaps" tabindex="1" class="md-skip">
|
||||
<a href="#configmaps" tabindex="0" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -3301,17 +3301,17 @@
|
|||
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>,
|
||||
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">"128"</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">
|
||||
<p class="admonition-title">Important</p>
|
||||
<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".
|
||||
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>
|
||||
<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>
|
||||
|
|
@ -3492,12 +3492,12 @@ Same for numbers, like "100".</p>
|
|||
<tr>
|
||||
<td align="left"><a href="#log-format-upstream">log-format-upstream</a></td>
|
||||
<td align="left">string</td>
|
||||
<td align="left"><code class="codehilite">$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $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] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $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>
|
||||
<td align="left"><a href="#log-format-stream">log-format-stream</a></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>
|
||||
<td align="left"><a href="#enable-multi-accept">enable-multi-accept</a></td>
|
||||
|
|
@ -3547,7 +3547,7 @@ Same for numbers, like "100".</p>
|
|||
<tr>
|
||||
<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"><code class="codehilite"><size of the processor’s cache line></code></td>
|
||||
<td align="left"><code class="codehilite"><span class="err"><size of the processor’s cache line></span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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>
|
||||
<td align="left"><a href="#ssl-session-ticket-key">ssl-session-ticket-key</a></td>
|
||||
<td align="left">string</td>
|
||||
<td align="left"><code class="codehilite"><Randomly Generated></code></td>
|
||||
<td align="left"><code class="codehilite"><span class="err"><Randomly Generated></span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><a href="#ssl-session-timeout">ssl-session-timeout</a></td>
|
||||
|
|
@ -3677,7 +3677,7 @@ Same for numbers, like "100".</p>
|
|||
<tr>
|
||||
<td align="left"><a href="#worker-processes">worker-processes</a></td>
|
||||
<td align="left">string</td>
|
||||
<td align="left"><code class="codehilite"><Number of CPUs></code></td>
|
||||
<td align="left"><code class="codehilite"><span class="err"><Number of CPUs></span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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>
|
||||
<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>
|
||||
<p>Access log path. Goes to <code class="codehilite">/var/log/nginx/access.log</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>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"><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>
|
||||
<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>
|
||||
<p>Error log path. Goes to <code class="codehilite">/var/log/nginx/error.log</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>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"><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>
|
||||
<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>
|
||||
|
|
@ -4131,9 +4131,9 @@ Same for numbers, like "100".</p>
|
|||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
|
|
@ -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>
|
||||
<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>
|
||||
<div class="codehilite"><pre><span></span><span class="err">log-format-upstream:</span> <span class="err">'</span><span class="p">{</span><span class="nt">"time"</span><span class="p">:</span> <span class="s2">"$time_iso8601"</span><span class="p">,</span> <span class="nt">"remote_addr"</span><span class="p">:</span> <span class="s2">"$proxy_protocol_addr"</span><span class="p">,</span> <span class="nt">"x-forward-for"</span><span class="p">:</span> <span class="s2">"$proxy_add_x_forwarded_for"</span><span class="p">,</span> <span class="nt">"request_id"</span><span class="p">:</span> <span class="s2">"$req_id"</span><span class="p">,</span>
|
||||
<div class="codehilite"><pre><span></span><code><span class="err">log-format-upstream:</span> <span class="err">'</span><span class="p">{</span><span class="nt">"time"</span><span class="p">:</span> <span class="s2">"$time_iso8601"</span><span class="p">,</span> <span class="nt">"remote_addr"</span><span class="p">:</span> <span class="s2">"$proxy_protocol_addr"</span><span class="p">,</span> <span class="nt">"x-forward-for"</span><span class="p">:</span> <span class="s2">"$proxy_add_x_forwarded_for"</span><span class="p">,</span> <span class="nt">"request_id"</span><span class="p">:</span> <span class="s2">"$req_id"</span><span class="p">,</span>
|
||||
<span class="nt">"remote_user"</span><span class="p">:</span> <span class="s2">"$remote_user"</span><span class="p">,</span> <span class="nt">"bytes_sent"</span><span class="p">:</span> <span class="err">$bytes_sent</span><span class="p">,</span> <span class="nt">"request_time"</span><span class="p">:</span> <span class="err">$request_time</span><span class="p">,</span> <span class="nt">"status"</span><span class="p">:</span><span class="err">$status</span><span class="p">,</span> <span class="nt">"vhost"</span><span class="p">:</span> <span class="s2">"$host"</span><span class="p">,</span> <span class="nt">"request_proto"</span><span class="p">:</span> <span class="s2">"$server_protocol"</span><span class="p">,</span>
|
||||
<span class="nt">"path"</span><span class="p">:</span> <span class="s2">"$uri"</span><span class="p">,</span> <span class="nt">"request_query"</span><span class="p">:</span> <span class="s2">"$args"</span><span class="p">,</span> <span class="nt">"request_length"</span><span class="p">:</span> <span class="err">$request_length</span><span class="p">,</span> <span class="nt">"duration"</span><span class="p">:</span> <span class="err">$request_time</span><span class="p">,</span><span class="nt">"method"</span><span class="p">:</span> <span class="s2">"$request_method"</span><span class="p">,</span> <span class="nt">"http_referrer"</span><span class="p">:</span> <span class="s2">"$http_referer"</span><span class="p">,</span>
|
||||
<span class="nt">"http_user_agent"</span><span class="p">:</span> <span class="s2">"$http_user_agent"</span> <span class="p">}</span><span class="err">'</span>
|
||||
</pre></div>
|
||||
</code></pre></div>
|
||||
|
||||
<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>
|
||||
|
|
@ -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>
|
||||
<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:
|
||||
<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>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>
|
||||
|
|
@ -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>
|
||||
</ul>
|
||||
<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>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>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"><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>
|
||||
<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><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>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"><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>
|
||||
<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>
|
||||
|
|
@ -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>
|
||||
<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.
|
||||
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>
|
||||
<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>
|
||||
|
|
@ -4310,9 +4310,9 @@ To create a ticket: <code class="codehilite">openssl rand 80 | openssl enc -A -b
|
|||
</blockquote>
|
||||
<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.
|
||||
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.
|
||||
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.
|
||||
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>
|
||||
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"><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"><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">
|
||||
<p class="admonition-title">Important</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>
|
||||
<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>.
|
||||
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>
|
||||
<p><strong>Note:</strong> Brotli does not works in Safari < 11. For more information see <a href="https://caniuse.com/#feat=brotli">https://caniuse.com/#feat=brotli</a></p>
|
||||
</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>
|
||||
<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.
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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.
|
||||
<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>
|
||||
<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"><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>
|
||||
<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>
|
||||
|
|
@ -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>
|
||||
<ul>
|
||||
<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>
|
||||
</ul>
|
||||
<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>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>
|
||||
<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>
|
||||
<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 session cookies, consider the <code class="codehilite">nginx.ingress.kubernetes.io/affinity</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"><span class="err">nginx.ingress.kubernetes.io/affinity</span></code> annotation.</li>
|
||||
</ul>
|
||||
<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>
|
||||
|
|
@ -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>
|
||||
<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>
|
||||
<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 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 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"><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>
|
||||
<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>
|
||||
|
|
@ -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>
|
||||
<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.
|
||||
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>
|
||||
<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>
|
||||
<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>
|
||||
|
|
@ -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>
|
||||
<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>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>
|
||||
<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>
|
||||
|
|
@ -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).
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
|
|
@ -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>
|
||||
<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>
|
||||
<div class="codehilite"><pre><span></span>lua-shared-dicts: "<my dict name>: <my dict size>, [<my dict name>: <my dict size>], ..."
|
||||
</pre></div>
|
||||
<div class="codehilite"><pre><span></span><code><span class="c">lua-shared-dicts: "<my dict name>: <my dict size>, [<my dict name>: <my dict size>], ..."</span>
|
||||
</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
|
||||
<code class="codehilite">my_custom_plugin</code>:</p>
|
||||
<div class="codehilite"><pre><span></span>lua-shared-dicts: "certificate_data: 100, my_custom_plugin: 5"
|
||||
</pre></div>
|
||||
<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"><span class="err">my_custom_plugin</span></code>:</p>
|
||||
<div class="codehilite"><pre><span></span><code><span class="c">lua-shared-dicts: "certificate_data: 100, my_custom_plugin: 5"</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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>
|
||||
|
|
@ -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>
|
||||
<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.
|
||||
Similar to the Ingress rule annotation <code class="codehilite">nginx.ingress.kubernetes.io/auth-url</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".
|
||||
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"><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>
|
||||
<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>
|
||||
<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>
|
||||
<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.
|
||||
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>
|
||||
<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.
|
||||
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>
|
||||
<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.
|
||||
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>
|
||||
<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.
|
||||
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>
|
||||
<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>
|
||||
<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>
|
||||
<p>A comma-separated list of locations that should not get authenticated.
|
||||
<em><strong>default:</strong></em> "/.well-known/acme-challenge"</p>
|
||||
|
|
@ -4586,17 +4586,18 @@ 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>
|
||||
<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.
|
||||
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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -4651,9 +4652,9 @@ It's possible to use here full strings and regular expressions. More details abo
|
|||
<div class="md-footer-copyright">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -4663,7 +4664,7 @@ It's possible to use here full strings and regular expressions. More details abo
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<a href="#custom-nginx-template" tabindex="1" class="md-skip">
|
||||
<a href="#custom-nginx-template" tabindex="0" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -1151,10 +1151,10 @@
|
|||
|
||||
|
||||
<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.
|
||||
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="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>
|
||||
|
|
@ -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="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>
|
||||
</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>.
|
||||
In addition to the built-in functions provided by the Go package the following functions are also available:</p>
|
||||
<ul>
|
||||
|
|
@ -1203,6 +1203,7 @@ In addition to the built-in functions provided by the Go package the following f
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1257,9 +1258,9 @@ In addition to the built-in functions provided by the Go package the following f
|
|||
<div class="md-footer-copyright">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1269,7 +1270,7 @@ In addition to the built-in functions provided by the Go package the following f
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<a href="#nginx-configuration" tabindex="1" class="md-skip">
|
||||
<a href="#nginx-configuration" tabindex="0" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -1155,11 +1155,12 @@
|
|||
<ol>
|
||||
<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="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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1214,9 +1215,9 @@
|
|||
<div class="md-footer-copyright">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1226,7 +1227,7 @@
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<a href="#log-format" tabindex="1" class="md-skip">
|
||||
<a href="#log-format" tabindex="0" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -1152,12 +1152,12 @@
|
|||
|
||||
<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>
|
||||
<div class="codehilite"><pre><span></span>log_format upstreaminfo
|
||||
'$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" "$http_user_agent" '
|
||||
'$request_length $request_time [$proxy_upstream_name] [$proxy_alternative_upstream_name] $upstream_addr '
|
||||
'$upstream_response_length $upstream_response_time $upstream_status $req_id';
|
||||
</pre></div>
|
||||
<div class="codehilite"><pre><span></span><code><span class="err">log_format upstreaminfo</span>
|
||||
<span class="err"> '$remote_addr - $remote_user [$time_local] "$request" '</span>
|
||||
<span class="err"> '$status $body_bytes_sent "$http_referer" "$http_user_agent" '</span>
|
||||
<span class="err"> '$request_length $request_time [$proxy_upstream_name] [$proxy_alternative_upstream_name] $upstream_addr '</span>
|
||||
<span class="err"> '$upstream_response_length $upstream_response_time $upstream_status $req_id';</span>
|
||||
</code></pre></div>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
|
|
@ -1168,75 +1168,75 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code class="codehilite">$status</code></td>
|
||||
<td><code class="codehilite"><span class="err">$status</span></code></td>
|
||||
<td>response status</td>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code class="codehilite">$proxy_upstream_name</code></td>
|
||||
<td>name of the upstream. The format is <code class="codehilite">upstream-<namespace>-<service name>-<service port></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"><span class="err">upstream-<namespace>-<service name>-<service port></span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code class="codehilite">$proxy_alternative_upstream_name</code></td>
|
||||
<td>name of the alternative upstream. The format is <code class="codehilite">upstream-<namespace>-<service name>-<service port></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"><span class="err">upstream-<namespace>-<service name>-<service port></span></code></td>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
@ -1251,19 +1251,19 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
@ -1276,6 +1276,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1330,9 +1331,9 @@
|
|||
<div class="md-footer-copyright">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1342,7 +1343,7 @@
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<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
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -1153,19 +1153,20 @@
|
|||
<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>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.
|
||||
To enable the ModSecurity feature we need to specify <code class="codehilite">enable-modsecurity: "true"</code> in the configuration configmap.</p>
|
||||
<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"><span class="c">enable-modsecurity: "true"</span></code> in the configuration configmap.</p>
|
||||
<blockquote>
|
||||
<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>.
|
||||
The default <code class="codehilite">Serial</code> value in SecAuditLogType can impact performance.</p>
|
||||
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"><span class="err">Serial</span></code> value in SecAuditLogType can impact performance.</p>
|
||||
</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.
|
||||
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>.
|
||||
Using <code class="codehilite">enable-owasp-modsecurity-crs: "true"</code> we enable the use of the rules.</p>
|
||||
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"><span class="c">enable-owasp-modsecurity-crs: "true"</span></code> we enable the use of the rules.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1220,9 +1221,9 @@ Using <code class="codehilite">enable-owasp-modsecurity-crs: "true"</c
|
|||
<div class="md-footer-copyright">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1232,7 +1233,7 @@ Using <code class="codehilite">enable-owasp-modsecurity-crs: "true"</c
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<a href="#opentracing" tabindex="1" class="md-skip">
|
||||
<a href="#opentracing" tabindex="0" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -1255,97 +1255,97 @@
|
|||
By default this feature is disabled.</p>
|
||||
<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:
|
||||
<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">"true"</span>
|
||||
</pre></div></p>
|
||||
</code></pre></div></p>
|
||||
<p>To enable or disable instrumentation for a single Ingress, use
|
||||
the <code class="codehilite">enable-opentracing</code> annotation:
|
||||
<div class="codehilite"><pre><span></span><span class="n">kind</span><span class="o">:</span> <span class="n">Ingress</span>
|
||||
the <code class="codehilite"><span class="err">enable-opentracing</span></code> annotation:
|
||||
<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">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">"true"</span>
|
||||
</pre></div></p>
|
||||
</code></pre></div></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
|
||||
jaeger-collector-host: jaeger-agent.default.svc.cluster.local
|
||||
datadog-collector-host: datadog-agent.default.svc.cluster.local
|
||||
</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>
|
||||
<p><div class="codehilite"><pre><span></span><code><span class="c">zipkin-collector-host: zipkin.default.svc.cluster.local</span>
|
||||
<span class="c">jaeger-collector-host: jaeger-agent.default.svc.cluster.local</span>
|
||||
<span class="c">datadog-collector-host: datadog-agent.default.svc.cluster.local</span>
|
||||
</code></pre></div>
|
||||
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.
|
||||
<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/DataDog/dd-opentracing-cpp">Datadog</a>
|
||||
have been tested.</p>
|
||||
<p>Other optional configuration options:
|
||||
<div class="codehilite"><pre><span></span># specifies the port to use when uploading traces, Default: 9411
|
||||
zipkin-collector-port
|
||||
<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>
|
||||
<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
|
||||
zipkin-service-name
|
||||
<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>
|
||||
<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
|
||||
zipkin-sample-rate
|
||||
<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>
|
||||
<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
|
||||
jaeger-collector-port
|
||||
<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>
|
||||
<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
|
||||
jaeger-service-name
|
||||
<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>
|
||||
<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.
|
||||
# The available samplers are: const, probabilistic, ratelimiting, remote, Default: const
|
||||
jaeger-sampler-type
|
||||
<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>
|
||||
<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>
|
||||
<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
|
||||
jaeger-sampler-param
|
||||
<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>
|
||||
<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.
|
||||
# Default: http://127.0.0.1
|
||||
jaeger-sampler-host
|
||||
<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>
|
||||
<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>
|
||||
<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
|
||||
jaeger-sampler-port
|
||||
<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>
|
||||
<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
|
||||
jaeger-trace-context-header-name
|
||||
<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>
|
||||
<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
|
||||
jaeger-debug-header
|
||||
<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>
|
||||
<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
|
||||
jaeger-baggage-header
|
||||
<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>
|
||||
<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-
|
||||
jaeger-tracer-baggage-header-prefix
|
||||
<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>
|
||||
<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
|
||||
datadog-collector-port
|
||||
<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>
|
||||
<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
|
||||
datadog-service-name
|
||||
<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>
|
||||
<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
|
||||
datadog-operation-name-override
|
||||
<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>
|
||||
<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
|
||||
datadog-priority-sampling
|
||||
<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>
|
||||
<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
|
||||
datadog-sample-rate
|
||||
</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>
|
||||
<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>
|
||||
<span class="n">datadog</span><span class="o">-</span><span class="n">sample</span><span class="o">-</span><span class="n">rate</span>
|
||||
</code></pre></div></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>
|
||||
<p>The following examples show how to deploy and test different distributed tracing systems. These example can be performed
|
||||
using Minikube.</p>
|
||||
<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>
|
||||
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
|
||||
kubectl create -f https://raw.githubusercontent.com/rnburn/zipkin-date-server/master/kubernetes/deployment.yaml
|
||||
</pre></div>
|
||||
<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>
|
||||
<span class="err">kubectl create -f https://raw.githubusercontent.com/rnburn/zipkin-date-server/master/kubernetes/deployment.yaml</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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">'</span>
|
||||
<div class="codehilite"><pre><span></span><code>$ <span class="nb">echo</span> <span class="s1">'</span>
|
||||
<span class="s1">apiVersion: v1</span>
|
||||
<span class="s1">kind: ConfigMap</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"> namespace: kube-system</span>
|
||||
<span class="s1">'</span> <span class="p">|</span> kubectl replace -f -
|
||||
</pre></div>
|
||||
</code></pre></div>
|
||||
|
||||
<p>In the Zipkin interface we can see the details:
|
||||
<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>
|
||||
<li>
|
||||
<p>Enable Ingress addon in Minikube:
|
||||
<div class="codehilite"><pre><span></span>$ minikube addons <span class="nb">enable</span> ingress
|
||||
</pre></div></p>
|
||||
<div class="codehilite"><pre><span></span><code>$ minikube addons <span class="nb">enable</span> ingress
|
||||
</code></pre></div></p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Add Minikube IP to /etc/hosts:
|
||||
<div class="codehilite"><pre><span></span>$ <span class="nb">echo</span> <span class="s2">"</span><span class="k">$(</span>minikube ip<span class="k">)</span><span class="s2"> example.com"</span> <span class="p">|</span> sudo tee -a /etc/hosts
|
||||
</pre></div></p>
|
||||
<div class="codehilite"><pre><span></span><code>$ <span class="nb">echo</span> <span class="s2">"</span><span class="k">$(</span>minikube ip<span class="k">)</span><span class="s2"> example.com"</span> <span class="p">|</span> sudo tee -a /etc/hosts
|
||||
</code></pre></div></p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Apply a basic Service and Ingress Resource:
|
||||
<div class="codehilite"><pre><span></span># Create Echoheaders Deployment
|
||||
$ kubectl run echoheaders --image=k8s.gcr.io/echoserver:1.4 --replicas=1 --port=8080
|
||||
<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>
|
||||
<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
|
||||
$ kubectl expose deployment echoheaders --port=80 --target-port=8080 --name=echoheaders-x
|
||||
<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>
|
||||
<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
|
||||
$ echo '
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: echo-ingress
|
||||
spec:
|
||||
rules:
|
||||
- host: example.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: echoheaders-x
|
||||
servicePort: 80
|
||||
path: /echo
|
||||
' | kubectl apply -f -
|
||||
</pre></div></p>
|
||||
<span class="o">#</span> <span class="n">Apply</span> <span class="n">the</span> <span class="n">Ingress</span> <span class="n">Resource</span>
|
||||
<span class="err">$</span> <span class="n">echo</span> <span class="s1">'</span>
|
||||
<span class="s1"> apiVersion: networking.k8s.io/v1beta1</span>
|
||||
<span class="s1"> kind: Ingress</span>
|
||||
<span class="s1"> metadata:</span>
|
||||
<span class="s1"> name: echo-ingress</span>
|
||||
<span class="s1"> spec:</span>
|
||||
<span class="s1"> rules:</span>
|
||||
<span class="s1"> - host: example.com</span>
|
||||
<span class="s1"> http:</span>
|
||||
<span class="s1"> paths:</span>
|
||||
<span class="s1"> - backend:</span>
|
||||
<span class="s1"> serviceName: echoheaders-x</span>
|
||||
<span class="s1"> servicePort: 80</span>
|
||||
<span class="s1"> path: /echo</span>
|
||||
<span class="s1"> '</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>
|
||||
</code></pre></div></p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Enable OpenTracing and set the jaeger-collector-host:
|
||||
<div class="codehilite"><pre><span></span>$ <span class="nb">echo</span> <span class="s1">'</span>
|
||||
<div class="codehilite"><pre><span></span><code>$ <span class="nb">echo</span> <span class="s1">'</span>
|
||||
<span class="s1"> apiVersion: v1</span>
|
||||
<span class="s1"> kind: ConfigMap</span>
|
||||
<span class="s1"> data:</span>
|
||||
|
|
@ -1409,16 +1409,16 @@ $ echo '
|
|||
<span class="s1"> name: nginx-configuration</span>
|
||||
<span class="s1"> namespace: kube-system</span>
|
||||
<span class="s1"> '</span> <span class="p">|</span> kubectl replace -f -
|
||||
</pre></div></p>
|
||||
</code></pre></div></p>
|
||||
</li>
|
||||
<li>
|
||||
<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
|
||||
</pre></div></p>
|
||||
<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
|
||||
</code></pre></div></p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Make a few requests to the Service:
|
||||
<div class="codehilite"><pre><span></span>$ curl example.com/echo -d <span class="s2">"meow"</span>
|
||||
<div class="codehilite"><pre><span></span><code>$ curl example.com/echo -d <span class="s2">"meow"</span>
|
||||
|
||||
CLIENT VALUES:
|
||||
<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
|
||||
BODY:
|
||||
meow
|
||||
</pre></div></p>
|
||||
</code></pre></div></p>
|
||||
</li>
|
||||
<li>
|
||||
<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
|
||||
</pre></div></p>
|
||||
</code></pre></div></p>
|
||||
<p>In the Jaeger interface we can see the details:
|
||||
<img alt="jaeger screenshot" src="../../../images/jaeger-demo.png" title="jaeger collector screenshot" /></p>
|
||||
</li>
|
||||
|
|
@ -1462,6 +1462,7 @@ http://192.168.99.100:30183
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1516,9 +1517,9 @@ http://192.168.99.100:30183
|
|||
<div class="md-footer-copyright">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1528,7 +1529,7 @@ http://192.168.99.100:30183
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<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">
|
||||
|
||||
|
|
@ -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 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>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<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>
|
||||
|
||||
<a href="#tlshttps" tabindex="1" class="md-skip">
|
||||
<a href="#tlshttps" tabindex="0" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<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>
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" 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>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
|
|
@ -1307,30 +1307,30 @@
|
|||
<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>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">"/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">"</span>
|
||||
</pre></div>
|
||||
<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">"/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">"</span>
|
||||
</code></pre></div>
|
||||
|
||||
<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>
|
||||
</pre></div>
|
||||
<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>
|
||||
</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>
|
||||
<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>
|
||||
for requests that do not match any of the configured server names.
|
||||
This configuration works without out-of-the-box for HTTP traffic.
|
||||
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
|
||||
accessing the catch-all server.
|
||||
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,
|
||||
add <code class="codehilite">--default-ssl-certificate=default/foo-tls</code> in the <code class="codehilite">nginx-controller</code> deployment.</p>
|
||||
<p>The default certificate will also be used for ingress <code class="codehilite">tls:</code> sections that do not
|
||||
have a <code class="codehilite">secretName</code> option.</p>
|
||||
<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"><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"><span class="c">tls:</span></code> sections that do not
|
||||
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>
|
||||
<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>
|
||||
<div class="admonition warning">
|
||||
<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
|
||||
HTTP to the specified domain and will instead send all communications over HTTPS.</p>
|
||||
<p>HSTS is enabled by default.</p>
|
||||
<p>To disable this behavior use <code class="codehilite">hsts: "false"</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: "false"</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>
|
||||
<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>
|
||||
<p>This can be disabled globally using <code class="codehilite">ssl-redirect: "false"</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: "false"</code>
|
||||
<p>This can be disabled globally using <code class="codehilite"><span class="c">ssl-redirect: "false"</span></code> in the NGINX <a href="../nginx-configuration/configmap/">config map</a>,
|
||||
or per-Ingress with the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/ssl-redirect: "false"</span></code>
|
||||
annotation in the particular resource.</p>
|
||||
<div class="admonition tip">
|
||||
<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
|
||||
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: "true"</code>
|
||||
This can be achieved by using the <code class="codehilite"><span class="err">nginx.ingress.kubernetes.io/force-ssl-redirect: "true"</span></code>
|
||||
annotation in the particular resource.</p>
|
||||
</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>
|
||||
|
|
@ -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>
|
||||
by monitoring ingress resources and their referenced secrets.</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="true"</span>
|
||||
</pre></div>
|
||||
<div class="codehilite"><pre><span></span><code><span class="go">kubectl annotate ing ingress-demo kubernetes.io/tls-acme="true"</span>
|
||||
</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>.
|
||||
The first version to fully support Kube-Lego is Nginx Ingress controller 0.8.</p>
|
||||
|
|
@ -1391,17 +1391,18 @@ May 2018, <a href="https://developer.android.com/about/dashboards/#Platform">app
|
|||
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>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">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">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">"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"</span>
|
||||
<span class="n">ssl</span><span class="o">-</span><span class="n">protocols</span><span class="o">:</span> <span class="s2">"TLSv1 TLSv1.1 TLSv1.2"</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">
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a>
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
@ -1468,7 +1469,7 @@ are not compatible with nginx-ingress's default configuration.</p>
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue