You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update documentation across multiple pages to recommend Traefik
as the default ingress controller instead of ingress-nginx:
- Switch ingress controller references from nginx to Traefik
- Update installation commands to use arkade install traefik2
- Replace nginx-specific annotations with Traefik equivalents
- Update ingressClassName from nginx to traefik
- Add Traefik timeout configuration guide
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
Copy file name to clipboardExpand all lines: docs/architecture/production.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -193,9 +193,7 @@ Whether you need to configure new networking for your OpenFaaS deployments, or i
193
193
194
194
It is recommended that you use an IngressController and TLS so that traffic between your clients and your OpenFaaS Gateway is encrypted.
195
195
196
-
You may already have opinions about what IngressController you want to use, the maintainers like to use Nginx given its broad adoption and relative ubiquity.
197
-
198
-
> See also: [Nginx IngressController](https://github.com/kubernetes/ingress-nginx)
196
+
> See also: [Traefik Proxy](https://doc.traefik.io/traefik/)
199
197
200
198
Heptio Contour also includes automatic retries and additional Ingress extensions which you may find useful:
Copy file name to clipboardExpand all lines: docs/deployment/kubernetes.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ There are three recommended ways to install OpenFaaS and you can pick whatever m
74
74
75
75
#### 1) Deploy the Chart with `arkade` (fastest option)
76
76
77
-
The `arkade install` command installs OpenFaaS using its official helm chart. arkade can also install other important software for OpenFaaS users such as `cert-manager` and `nginx-ingress`. It's the easiest and quickest way to get up and running.
77
+
The `arkade install` command installs OpenFaaS using its official helm chart. arkade can also install other important software for OpenFaaS users such as `cert-manager` and `traefik`. It's the easiest and quickest way to get up and running.
78
78
79
79
You can use [arkade](https://arkade.dev/) to install OpenFaaS to a regular cloud cluster, your laptop, a VM, a Raspberry Pi, or a 64-bit Arm machine.
80
80
@@ -197,7 +197,7 @@ Also, ensure any [default load-balancer timeouts within GKE](https://cloud.googl
197
197
To enable TLS while using Helm, try one of the following references:
198
198
199
199
*[Get TLS for OpenFaaS the easy way with arkade](https://blog.alexellis.io/tls-the-easy-way-with-openfaas-and-k3sup/)
200
-
*[Configure TLS with nginx-ingress and cert-manager](/reference/tls-openfaas)
200
+
*[Configure TLS with Traefik and cert-manager](/reference/tls-openfaas)
201
201
202
202
### Setting an Image Pull Policy for your functions
Copy file name to clipboardExpand all lines: docs/reference/tls-openfaas.md
+43-38Lines changed: 43 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
##TLS for OpenFaaS
1
+
# TLS for OpenFaaS
2
2
3
3
Transport Layer Security (TLS) is a cryptographic protocol that provides secure encryption on top of HTTP. It is required for any OpenFaaS gateway which is exposed to the Internet.
4
4
@@ -8,62 +8,69 @@ This guide explains how to obtain TLS certificates for the OpenFaaS Gateway runn
8
8
* Configure cert-manager to obtain a certificate from Let's Encrypt
9
9
* Configure the an Ingress record for the OpenFaaS Gateway
10
10
11
-
###Pre-requisites
11
+
## Pre-requisites
12
12
13
13
* A domain name under your control, and access to create A or CNAME records
14
14
* A public IP address with NodePorts, a Load Balancer or a tunnel such as [inlets](https://inlets.dev/)
15
15
* A Kubernetes cluster
16
16
17
17
Where you see `example.com` given in an example, replace that with your own domain name.
18
18
19
-
###Make sure you can obtain public IP addresses
19
+
## Make sure you can obtain public IP addresses
20
20
21
21
Managed Kubernetes services have a built-in LoadBalancer provisioner, which will provide a public IP address or CNAME for you, once you create a Service of type LoadBalancer.
22
22
23
23
If you're running self-managed Kubernetes, where each node has its own Public IP address, then you can configure your Ingress Controller to use a NodePort mapped to port 80 and 443 on the host.
24
24
25
25
If you are running on a local or private network, you can use [inlets-operator](https://github.com/inlets/inlets-operator) instead, which provisions a VM and uses its public IP address over a websocket tunnel.
26
26
27
-
###Set up an Ingress Controller
27
+
## Set up an Ingress Controller
28
28
29
-
We recommend ingress-nginx for OpenFaaS, however any Ingress controller will work, or you can use Istio with separate instructions.
29
+
We recommend Traefik for OpenFaaS, however any Ingress controller will work, or you can use Istio with separate instructions.
30
30
31
-
To install ingress-nginx, use either the Helm chart, or arkade:
See also: [Traefik installation](https://doc.traefik.io/traefik/getting-started/install-traefik/)
39
42
40
-
####Timeouts for synchronous invocations
43
+
### Timeouts for synchronous invocations
41
44
42
45
Despite configuring OpenFaaS and your functions for [extended timeouts](/tutorials/expanded-timeouts.md), you may find that your Ingress Controller, Istio Gateway, or Cloud Load Balancer implements its own timeouts on connections. If you think you have everything configured correctly for OpenFaaS, but see a timeout at a very specific number such as 30s or 60s, then check the timeouts on your Ingress Controller or Load Balancer.
43
46
44
-
For Ingress Nginx, to extend a synchronous invocation beyond one minute, add the `nginx.ingress.kubernetes.io/proxy-read-timeout` annotation to your Ingress resource. This annotation is specified in seconds - for example, to extend the timeout to 30 minutes, use `nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"`.
47
+
For Traefik, timeouts are typically configured at the EntryPoint level in the static configuration. See the [expanded timeouts guide](/tutorials/expanded-timeouts.md#load-balancers-ingress-and-service-meshes) for more details on configuring Traefik timeouts.
48
+
49
+
Ingress Nginx is now a retired project and should not be used for new installations. If you are still using Ingress Nginx, to extend a synchronous invocation beyond one minute, add the `nginx.ingress.kubernetes.io/proxy-read-timeout` annotation to your Ingress resource. This annotation is specified in seconds - for example, to extend the timeout to 30 minutes, use `nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"`.
45
50
46
-
###Install cert-manager
51
+
## Install cert-manager
47
52
48
53
cert-manager is a Kubernetes operator maintained by the Cloud Native Computing Foundation (CNCF) which automates TLS certificate management.
49
54
50
-
To install cert-manager, use either the Helm chart, or arkade:
See also: [cert-manager installation](https://cert-manager.io/docs/installation/)
57
66
58
-
###Configure cert-manager
67
+
## Configure cert-manager
59
68
60
69
You'll need to create an Issuer or ClusterIssuer for your cert-manager installation. This will tell cert-manager which domain it is operating on, and how to register an account for you.
61
70
62
71
The below will create an Issuer that only operates in the openfaas namespace, with a HTTP01 challenge. Note the ingress class specified in the HTTP01 challenge, this should match the class of your Ingress controller. You can view ingress classes with `kubectl get ingressclass`.
@@ -109,38 +114,37 @@ Apply the staging and production Issuers:
109
114
$ kubectl apply -f issuer.yaml
110
115
```
111
116
112
-
###Create the required DNS records
117
+
## Create the required DNS records
113
118
114
119
You will need to create an A or CNAME record for your domain, pointing to the public IP address of your Ingress controller.
115
120
116
-
If you created the Ingress Controller with arkade, you'll see a new service in the default namespace called `ingress-nginx-controller`. You can find the public IP address with:
121
+
After installing Traefik, you'll see a new LoadBalancer service for traefik in the `traefik namespace. You can find the public IP address with:
117
122
118
123
```sh
119
-
$ kubectl get svc -n default ingress-nginx-controller
Take the IP address from the `EXTERNAL-IP` column and create an A record for your domain in your domain management software, or a CNAME record if you're using AWS EKS, and see a domain name in this field.
130
+
Take the IP address from the `EXTERNAL-IP` column and create an A record for your domain in your domain management software, or a CNAME record if you see a domain name in this field.
126
131
127
132
All users should create an entry for: `gateway.example.com` and then OpenFaaS dashboard users should create an additional record pointing at the same address for: `dashboard.example.com`.
128
133
129
-
###Configure TLS for the OpenFaaS gateway
134
+
## Configure TLS for the OpenFaaS gateway
130
135
131
136
You can now configure the OpenFaaS gateway to use TLS by setting the following Helm values, you can save them in a file called `tls.yaml`:
If you're using something other than ingress-nginx, then change the `ingressClassName` field accordingly. Note that the `kubernetes.io/ingress.class` annotation is deprecated and should not be used.
166
+
If you're using something other than Traefik, then change the `ingressClassName` field accordingly. Note that the `kubernetes.io/ingress.class` annotation is deprecated and should not be used.
163
167
164
168
The `cert-manager.io/issuer` annotation is used to pick between the staging and production Issuers for Let's Encrypt. If this is your first time working with cert-manager, you may want to use the staging issuer first to avoid running into rate limits if you have something misconfigured.
165
169
170
+
> Note: For extended timeouts beyond Traefik's defaults, see the [expanded timeouts guide](/tutorials/expanded-timeouts.md#load-balancers-ingress-and-service-meshes) for information on configuring Traefik's EntryPoint timeouts.
171
+
166
172
Now upgrade OpenFaaS via helm, use any custom values.yaml files that you have saved from a previous installation:
167
173
168
174
```sh
@@ -173,7 +179,7 @@ helm repo update && \
173
179
--values values-custom.yaml
174
180
```
175
181
176
-
###Configure TLS for the OpenFaaS dashboard
182
+
## Configure TLS for the OpenFaaS dashboard
177
183
178
184
If you're using OpenFaaS Standard or OpenFaaS for Enterprises, you will probably want to create an additional Ingress record for the OpenFaaS dashboard.
As above, run the `helm upgrade` command to apply the changes.
226
231
227
-
###Verifying the installation
232
+
## Verifying the installation
228
233
229
234
First, check that the DNS records you created have taken effect. You can use `nslookup` or `dig` to check that the domain names resolve to the public address of your Ingress Controller's service.
Copy file name to clipboardExpand all lines: docs/tutorials/expanded-timeouts.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,17 @@ AWS EKS is configured to use an [Elastic Load Balancer (ELB)](https://aws.amazon
86
86
87
87
Google Cloud's various Load Balancer options have their [own configuration options too](https://cloud.google.com/load-balancing/docs/https).
88
88
89
-
For Ingress Nginx, set the `nginx.ingress.kubernetes.io/proxy-read-timeout` annotation to extend the timeout. This annotation is specified in seconds - for example, to extend the timeout to 30 minutes, use `nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"`.
89
+
For Traefik, see [Configuring Traefik timeouts](#configuring-traefik-timeouts) below.
90
+
91
+
Ingress Nginx is now a retired project and should not be used for new installations. If you are still using it, set the `nginx.ingress.kubernetes.io/proxy-read-timeout` annotation to extend the timeout. This annotation is specified in seconds - for example, to extend the timeout to 30 minutes, use `nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"`.
92
+
93
+
### Configuring Traefik timeouts
94
+
95
+
Traefik has two separate sets of timeouts to be aware of:
96
+
97
+
**Client-to-Traefik (EntryPoints)** - configured in the static configuration (CLI flags or Helm values). Controls how long Traefik waits for the client to send a request or receive a response. The key fields are `readTimeout` (default 60s), `writeTimeout` (default 0s) and `idleTimeout` (default 180s). See [EntryPoints - RespondingTimeouts](https://doc.traefik.io/traefik/routing/entrypoints/#respondingtimeouts).
98
+
99
+
**Traefik-to-App (ServersTransport)** - configured in the dynamic configuration using a [ServersTransport CRD](https://doc.traefik.io/traefik/reference/routing-configuration/kubernetes/crd/http/serverstransport/), and referenced via the `traefik.ingress.kubernetes.io/service.serverstransport` annotation on the Ingress. By default there is no timeout on how long Traefik waits for a backend to respond (`responseHeaderTimeout` is 0s). Consider setting `responseHeaderTimeout` to match the gateway's `upstreamTimeout` so that Traefik returns a 504 quickly when a function hangs, rather than waiting indefinitely.
90
100
91
101
Finally, if you need to invoke a function for longer than one of your infrastructure components allows, then you should use an [asynchronous invocation](/reference/async). Asynchronous function invocations bypass these components because they are eventually invoked from the queue-worker, not the Internet. The queue-worker for OpenFaaS Standard will also retry invocations if required.
See also: [Traefik installation](https://doc.traefik.io/traefik/getting-started/install-traefik/)
68
+
64
69
## Install OpenFaaS with local Ingress enabled
65
70
66
71
Usually, Ingress is used when a cluster has a public IP address, and you want to obtain TLS certificates from Let's Encrypt. In this case, we'll use it to access the OpenFaaS gateway on the host machine.
@@ -77,7 +82,7 @@ ingress:
77
82
serviceName: gateway
78
83
servicePort: 8080
79
84
path: /
80
-
ingressClassName: nginx
85
+
ingressClassName: traefik
81
86
```
82
87
83
88
> Note: if you're migrating from an older version of Kubernetes, the `annotations.kubernetes.io/ingress.class` [annotation is deprecated](https://kubernetes.io/docs/concepts/services-networking/ingress/#deprecated-annotation), use `ingressClassName` instead.
0 commit comments