Skip to content

Commit 9e1a4d9

Browse files
committed
Replace ingress-nginx references with Traefik
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>
1 parent db7c703 commit 9e1a4d9

File tree

5 files changed

+40
-31
lines changed

5 files changed

+40
-31
lines changed

docs/architecture/production.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,7 @@ Whether you need to configure new networking for your OpenFaaS deployments, or i
193193

194194
It is recommended that you use an IngressController and TLS so that traffic between your clients and your OpenFaaS Gateway is encrypted.
195195

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/)
199197

200198
Heptio Contour also includes automatic retries and additional Ingress extensions which you may find useful:
201199

docs/deployment/kubernetes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ There are three recommended ways to install OpenFaaS and you can pick whatever m
7474

7575
#### 1) Deploy the Chart with `arkade` (fastest option)
7676

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.
7878

7979
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.
8080

@@ -197,7 +197,7 @@ Also, ensure any [default load-balancer timeouts within GKE](https://cloud.googl
197197
To enable TLS while using Helm, try one of the following references:
198198

199199
* [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)
201201

202202
### Setting an Image Pull Policy for your functions
203203

docs/reference/tls-openfaas.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,24 @@ If you are running on a local or private network, you can use [inlets-operator](
2626

2727
### Set up an Ingress Controller
2828

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.
3030

31-
To install ingress-nginx, use either the Helm chart, or arkade:
31+
To install Traefik, use either the Helm chart, or arkade:
3232

3333
```sh
34-
$ arkade install ingress-nginx
34+
$ arkade install traefik2
3535
```
3636

37-
See also: [ingress-nginx installation](https://kubernetes.github.io/ingress-nginx/deploy/)
37+
See also: [Traefik installation](https://doc.traefik.io/traefik/getting-started/install-traefik/)
3838

3939

4040
#### Timeouts for synchronous invocations
4141

4242
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.
4343

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"`.
44+
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.
45+
46+
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"`.
4547

4648
### Install cert-manager
4749

@@ -80,7 +82,7 @@ spec:
8082
- selector: {}
8183
http01:
8284
ingress:
83-
class: nginx
85+
class: traefik
8486
---
8587
apiVersion: cert-manager.io/v1
8688
kind: Issuer
@@ -97,7 +99,7 @@ spec:
9799
- selector: {}
98100
http01:
99101
ingress:
100-
class: nginx
102+
class: traefik
101103
---
102104
103105
EOF
@@ -113,13 +115,13 @@ $ kubectl apply -f issuer.yaml
113115

114116
You will need to create an A or CNAME record for your domain, pointing to the public IP address of your Ingress controller.
115117

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:
118+
If you created the Ingress Controller with arkade, you'll see a new service in the kube-system namespace called `traefik. You can find the public IP address with:
117119

118120
```sh
119-
$ kubectl get svc -n default ingress-nginx-controller
121+
$ kubectl get svc/traefik -n kube-system
120122

121-
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
122-
ingress-nginx-controller LoadBalancer 10.43.87.4 18.136.136.18 80:31876/TCP,443:30108/TCP 28d
123+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
124+
traefik LoadBalancer 10.43.87.4 18.136.136.18 80:31876/TCP,443:31706/TCP 28d
123125
```
124126

125127
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.
@@ -129,18 +131,17 @@ All users should create an entry for: `gateway.example.com` and then OpenFaaS da
129131
### Configure TLS for the OpenFaaS gateway
130132

131133
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`:
132-
134+
133135
```sh
134136
export DOMAIN="gw.example.com"
135-
export NGINX_TIMEOUT_SECS="1800" # 30 minutes
136137

137138
cat > tls.yaml <<EOF
138139
ingress:
139140
enabled: true
140-
ingressClassName: nginx
141+
ingressClassName: traefik
141142
annotations:
142143
cert-manager.io/issuer: letsencrypt-prod
143-
nginx.ingress.kubernetes.io/proxy-read-timeout: "$NGINX_TIMEOUT_SECS"
144+
traefik.ingress.kubernetes.io/router.entrypoints: websecure
144145
tls:
145146
- hosts:
146147
- $DOMAIN
@@ -159,10 +160,12 @@ ingress:
159160
EOF
160161
```
161162

162-
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.
163+
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.
163164

164165
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.
165166

167+
> 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.
168+
166169
Now upgrade OpenFaaS via helm, use any custom values.yaml files that you have saved from a previous installation:
167170

168171
```sh
@@ -182,15 +185,14 @@ Edit the previous example:
182185
```sh
183186
export DOMAIN="gw.example.com"
184187
export DOMAIN_DASHBOARD="dashboard.example.com"
185-
export NGINX_TIMEOUT_SECS="1800" # 30 minutes
186188

187189
cat > tls.yaml <<EOF
188190
ingress:
189191
enabled: true
190-
ingressClassName: nginx
192+
ingressClassName: traefik
191193
annotations:
192194
cert-manager.io/issuer: letsencrypt-prod
193-
nginx.ingress.kubernetes.io/proxy-read-timeout: "$NGINX_TIMEOUT_SECS"
195+
traefik.ingress.kubernetes.io/router.entrypoints: websecure
194196
tls:
195197
- hosts:
196198
- $DOMAIN

docs/tutorials/expanded-timeouts.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,17 @@ AWS EKS is configured to use an [Elastic Load Balancer (ELB)](https://aws.amazon
8686

8787
Google Cloud's various Load Balancer options have their [own configuration options too](https://cloud.google.com/load-balancing/docs/https).
8888

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.
90100

91101
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.
92102

docs/tutorials/local-kind-ingress.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Most users will use port-forwarding to access the OpenFaaS gateway, it's the simplest option and works everywhere.
44

5-
However, in this tutorial, we will show you how to deploy OpenFaaS with ingress-nginx.
5+
However, in this tutorial, we will show you how to deploy OpenFaaS with Traefik ingress.
66

77
When you use an Ingress Controller:
88

@@ -53,12 +53,12 @@ EOF
5353
kind create cluster --name openfaas --config kind-config.yaml
5454
```
5555

56-
## Install the ingress-nginx IngressController
56+
## Install the Traefik IngressController
5757

58-
Use arkade, or [install ingress-nginx manually](https://kubernetes.github.io/ingress-nginx/deploy/).
58+
Use arkade, or [install Traefik manually](https://doc.traefik.io/traefik/getting-started/install-traefik/).
5959

6060
```sh
61-
arkade install ingress-nginx
61+
arkade install traefik2
6262
```
6363

6464
## Install OpenFaaS with local Ingress enabled
@@ -77,7 +77,7 @@ ingress:
7777
serviceName: gateway
7878
servicePort: 8080
7979
path: /
80-
ingressClassName: nginx
80+
ingressClassName: traefik
8181
```
8282
8383
> 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.
@@ -103,4 +103,3 @@ faas-cli store deploy env
103103
104104
faas-cli list
105105
```
106-

0 commit comments

Comments
 (0)