Skip to content

Commit 0ba02b1

Browse files
weltekiampcode-com
andcommitted
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 with Helm and arkade examples - Update FunctionIngress ingressType from nginx to traefik - Update service names and namespaces for Traefik Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com> Amp-Thread-ID: https://ampcode.com/threads/T-019c4cec-42e5-71c9-82d5-a1da8b78a945 Co-authored-by: Amp <amp@ampcode.com>
1 parent 6d4abef commit 0ba02b1

File tree

6 files changed

+77
-37
lines changed

6 files changed

+77
-37
lines changed

docs/architecture/production.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ Whether you need to configure new networking for your OpenFaaS deployments, or i
158158
159159
It is recommended that you use an IngressController and TLS so that traffic between your clients and your OpenFaaS Gateway is encrypted.
160160

161-
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.
161+
You may already have opinions about what IngressController you want to use, the maintainers like to use Traefik given its broad adoption and relative ubiquity.
162162

163-
> See also: [Nginx IngressController](https://github.com/kubernetes/ingress-nginx)
163+
> See also: [Traefik Proxy](https://doc.traefik.io/traefik/)
164164
165165
Heptio Contour also includes automatic retries and additional Ingress extensions which you may find useful:
166166

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-functions.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Let's deploy a function from the store:
4141
faas-cli store deploy env
4242
```
4343

44-
If you're using ingress-nginx, then check the public IP with `kubectl get svc/nginxingress-nginx-ingress-controller`, note down the `EXTERNAL-IP`.
44+
If you're using Traefik, then check the public IP with `kubectl get svc/traefik -n kube-system`, note down the `EXTERNAL-IP`.
4545

4646
Create a DNS A record or CNAME `env.example.com` pointing to the `EXTERNAL-IP`
4747

@@ -55,13 +55,13 @@ Edit the following fields:
5555
* `issuerRef.name` - as per the Issuer name created above
5656
* `issuerRef.kind` - optional: either `Issuer` or `ClusterIssuer`
5757

58-
If you're not using ingress-nginx, then also change the `spec.ingressType` field.
58+
If you're not using Traefik, then also change the `spec.ingressType` field.
5959

6060
The `FunctionIngress` currently makes use of the `HTTP01` challenge, so a separate TLS certificate will be obtained for each FunctionIngress you create.
6161

6262
```sh
6363
export DOMAIN="env.example.com"
64-
64+
6565
cat << EOF > env-fni.yaml
6666
apiVersion: openfaas.com/v1
6767
kind: FunctionIngress
@@ -71,7 +71,7 @@ metadata:
7171
spec:
7272
domain: "env.example.com"
7373
function: "env"
74-
ingressType: "nginx"
74+
ingressType: "traefik"
7575
tls:
7676
enabled: true
7777
issuerRef:
@@ -160,7 +160,7 @@ metadata:
160160
spec:
161161
domain: "$DOMAIN"
162162
function: "env"
163-
ingressType: "nginx"
163+
ingressType: "traefik"
164164
path: "/v1/env/(.*)"
165165
tls:
166166
enabled: true
@@ -176,7 +176,7 @@ metadata:
176176
spec:
177177
domain: "$DOMAIN"
178178
function: "nodeinfo"
179-
ingressType: "nginx"
179+
ingressType: "traefik"
180180
path: "/v1/nodeinfo/(.*)"
181181
tls:
182182
enabled: true
@@ -193,4 +193,3 @@ kubectl apply -f api-v1-fni.yaml
193193
```
194194

195195
You'll now be able to access the above functions via `https://api.example.com/v1/env/` and `https://api.example.com/v1/nodeinfo/`.
196-

docs/reference/tls-openfaas.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@ 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.
4545

4646
### Install cert-manager
4747

@@ -80,7 +80,7 @@ spec:
8080
- selector: {}
8181
http01:
8282
ingress:
83-
class: nginx
83+
class: traefik
8484
---
8585
apiVersion: cert-manager.io/v1
8686
kind: Issuer
@@ -97,7 +97,7 @@ spec:
9797
- selector: {}
9898
http01:
9999
ingress:
100-
class: nginx
100+
class: traefik
101101
---
102102
103103
EOF
@@ -113,13 +113,13 @@ $ kubectl apply -f issuer.yaml
113113

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

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:
116+
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:
117117

118118
```sh
119-
$ kubectl get svc -n default ingress-nginx-controller
119+
$ kubectl get svc/traefik -n kube-system
120120

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
121+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
122+
traefik LoadBalancer 10.43.87.4 18.136.136.18 80:31876/TCP,443:31706/TCP 28d
123123
```
124124

125125
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 +129,16 @@ All users should create an entry for: `gateway.example.com` and then OpenFaaS da
129129
### Configure TLS for the OpenFaaS gateway
130130

131131
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-
132+
133133
```sh
134134
export DOMAIN="gw.example.com"
135-
export NGINX_TIMEOUT_SECS="1800" # 30 minutes
136135

137136
cat > tls.yaml <<EOF
138137
ingress:
139138
enabled: true
140-
ingressClassName: nginx
139+
ingressClassName: traefik
141140
annotations:
142141
cert-manager.io/issuer: letsencrypt-prod
143-
nginx.ingress.kubernetes.io/proxy-read-timeout: "$NGINX_TIMEOUT_SECS"
144142
tls:
145143
- hosts:
146144
- $DOMAIN
@@ -159,10 +157,12 @@ ingress:
159157
EOF
160158
```
161159

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.
160+
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.
163161

164162
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.
165163

164+
> 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.
165+
166166
Now upgrade OpenFaaS via helm, use any custom values.yaml files that you have saved from a previous installation:
167167

168168
```sh
@@ -182,15 +182,13 @@ Edit the previous example:
182182
```sh
183183
export DOMAIN="gw.example.com"
184184
export DOMAIN_DASHBOARD="dashboard.example.com"
185-
export NGINX_TIMEOUT_SECS="1800" # 30 minutes
186185

187186
cat > tls.yaml <<EOF
188187
ingress:
189188
enabled: true
190-
ingressClassName: nginx
189+
ingressClassName: traefik
191190
annotations:
192191
cert-manager.io/issuer: letsencrypt-prod
193-
nginx.ingress.kubernetes.io/proxy-read-timeout: "$NGINX_TIMEOUT_SECS"
194192
tls:
195193
- hosts:
196194
- $DOMAIN

docs/tutorials/expanded-timeouts.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,51 @@ 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+
### Configuring Traefik timeouts
90+
91+
For Traefik, timeouts are configured at the EntryPoint level in the static configuration. There are two main timeout values to consider:
92+
93+
* `readTimeout` - Maximum duration for reading the entire request, including the body
94+
* `writeTimeout` - Maximum duration before timing out writes of the response
95+
96+
These timeouts can be configured when installing Traefik via Helm or arkade. For example, to set 30-minute timeouts:
97+
98+
**Using Helm values:**
99+
100+
```yaml
101+
# traefik-values.yaml
102+
ports:
103+
websecure:
104+
port: 8443
105+
expose: true
106+
exposedPort: 443
107+
protocol: TCP
108+
tls:
109+
enabled: true
110+
transport:
111+
respondingTimeouts:
112+
readTimeout: 1800s
113+
writeTimeout: 1800s
114+
```
115+
116+
Then install or upgrade Traefik:
117+
118+
```bash
119+
helm upgrade --install traefik traefik/traefik \
120+
--namespace traefik \
121+
--create-namespace \
122+
-f traefik-values.yaml
123+
```
124+
125+
**Using arkade with custom values:**
126+
127+
```bash
128+
arkade install traefik2 \
129+
--set "ports.websecure.transport.respondingTimeouts.readTimeout=1800s" \
130+
--set "ports.websecure.transport.respondingTimeouts.writeTimeout=1800s"
131+
```
132+
133+
> Note: Unlike ingress-nginx, Traefik does not support per-Ingress timeout annotations. Timeouts must be configured at the EntryPoint level or via advanced ServersTransport configuration. See the Traefik middleware.
90134

91135
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.
92136

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)