Skip to content

Commit d3d7cff

Browse files
weltekialexellis
authored andcommitted
Migrate to Traefik
Update installation and expose-tunnels docs for the migration from NGINX to Traefik ingress. - Add NGINX Ingress Controller retirement notice - Change default ingress class to traefik in example values - Add Traefik rate limiting section with RateLimit and InFlightReq middleware examples - Add Ingress NGINX section with legacy configuration for users not yet migrated - Add upgrade notice about ingress class change in 0.5.0 Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
1 parent 1c80e3e commit d3d7cff

File tree

3 files changed

+128
-29
lines changed

3 files changed

+128
-29
lines changed

docs/uplink/expose-tunnels.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ Follow the instruction for Kubernetes Ingress or Istio depending on how you depl
6565
1. Create a new certificate Issuer for tunnels:
6666

6767
```bash
68-
export EMAIL="you@example.com"
69-
7068
cat > tunnel-issuer-prod.yaml <<EOF
7169
apiVersion: cert-manager.io/v1
7270
kind: Issuer
@@ -76,13 +74,12 @@ Follow the instruction for Kubernetes Ingress or Istio depending on how you depl
7674
spec:
7775
acme:
7876
server: https://acme-v02.api.letsencrypt.org/directory
79-
email: $EMAIL
8077
privateKeySecretRef:
8178
name: tunnels-letsencrypt-prod
8279
solvers:
8380
- http01:
8481
ingress:
85-
class: "nginx"
82+
class: "traefik"
8683
EOF
8784
```
8885
@@ -95,9 +92,9 @@ Follow the instruction for Kubernetes Ingress or Istio depending on how you depl
9592
name: grafana-tunnel-ingress
9693
namespace: tunnels
9794
annotations:
98-
kubernetes.io/ingress.class: nginx
9995
cert-manager.io/issuer: tunnels-letsencrypt-prod
10096
spec:
97+
ingressClassName: traefik
10198
rules:
10299
- host: grafana.example.com
103100
http:
@@ -126,9 +123,9 @@ metadata:
126123
name: openfaas-tunnel-ingress
127124
namespace: tunnels
128125
annotations:
129-
kubernetes.io/ingress.class: nginx
130126
cert-manager.io/issuer: tunnels-letsencrypt-prod
131127
spec:
128+
ingressClassName: traefik
132129
rules:
133130
- host: openfaas.example.com
134131
http:
@@ -151,8 +148,6 @@ spec:
151148
1. Create a new certificate Issuer for tunnels:
152149
153150
```bash
154-
export EMAIL="you@example.com"
155-
156151
cat > tunnel-issuer-prod.yaml <<EOF
157152
apiVersion: cert-manager.io/v1
158153
kind: Issuer
@@ -162,7 +157,6 @@ spec:
162157
spec:
163158
acme:
164159
server: https://acme-v02.api.letsencrypt.org/directory
165-
email: $EMAIL
166160
privateKeySecretRef:
167161
name: tunnels-letsencrypt-prod
168162
solvers:
@@ -320,7 +314,6 @@ metadata:
320314
namespace: $NS
321315
spec:
322316
acme:
323-
email: webmaster@$DOMAIN
324317
server: https://acme-v02.api.letsencrypt.org/directory
325318
privateKeySecretRef:
326319
name: $ISSUER_NAME
@@ -349,12 +342,22 @@ dataRouter:
349342
350343
ingress:
351344
enabled: true
352-
annotations:
353-
# Apply basic rate limiting.
354-
nginx.ingress.kubernetes.io/limit-connections: "300"
355-
nginx.ingress.kubernetes.io/limit-rpm: "1000"
356345
```
357346
347+
!!! tip "Optional: rate limiting for the data-router"
348+
349+
Traefik Middleware can be used to apply rate limiting on the data-router Ingress. See [Traefik rate limiting](/uplink/installation/#traefik-rate-limiting) for details on creating Middleware resources.
350+
351+
To reference the middleware, add the annotation to your `values.yaml`:
352+
353+
```yaml
354+
dataRouter:
355+
tls:
356+
ingress:
357+
annotations:
358+
traefik.ingress.kubernetes.io/router.middlewares: inlets-data-router-ratelimit@kubernetescrd,inlets-data-router-inflight-limit@kubernetescrd
359+
```
360+
358361
Apply the updated values:
359362
360363
```bash

docs/uplink/installation.md

Lines changed: 110 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ Install [cert-manager](https://cert-manager.io/docs/), which is used to manage T
3434
You can use Helm, or arkade:
3535

3636
```bash
37-
arkade install cert-manager
37+
helm install \
38+
cert-manager oci://quay.io/jetstack/charts/cert-manager \
39+
--namespace cert-manager \
40+
--create-namespace \
41+
--set crds.enabled=true
3842
```
3943

4044
## Create a namespace for the chart and add the license secret
@@ -78,25 +82,36 @@ You can use Kubernetes Ingress or Istio. We recommend using Ingress (Option A),
7882
7983
### A) Install with Kubernetes Ingress
8084
81-
We recommend [ingress-nginx](https://github.com/kubernetes/ingress-nginx) for Ingress, and have finely tuned the configuration to work well for the underlying websocket for inlets. If your organisation uses a different Ingress Controller, you can alter the `class` fields in the chart.
85+
We recommend [Traefik](https://doc.traefik.io/traefik/) for Ingress, and have finely tuned the configuration to work well for the underlying websocket for inlets. If your organisation uses a different Ingress Controller, you can alter the `class` fields in the chart.
8286
83-
Install ingress-nginx using arkade or Helm:
87+
!!! note "NGINX Ingress Controller Retirement"
88+
89+
The Kubernetes NGINX Ingress Controller project has announced its retirement in March 2026 and will no longer receive updates or security patches.
90+
91+
The uplink chart version 0.5.0 changes the default ingress class from Nginx to Traefik. To upgrade to the latest uplink while keeping NGINX ingress see the [Ingress NGINX section](#ingress-nginx) for legacy configuration options.
92+
93+
Install traefik with Helm:
8494
8595
```bash
86-
arkade install ingress-nginx
96+
helm repo add traefik https://traefik.github.io/charts
97+
helm repo update
98+
99+
helm install traefik traefik/traefik \
100+
--namespace=traefik \
101+
--create-namespace
87102
```
88103
104+
See also: [Traefik installation](https://doc.traefik.io/traefik/getting-started/install-traefik/#use-the-helm-chart)
105+
89106
Create a `values.yaml` file for the inlets-uplink-provider chart:
90107
91108
```yaml
92109
ingress:
110+
class: "traefik"
93111
issuer:
94112
# When set, a production issuer will be generated for you
95113
# to use a pre-existing issuer, set issuer.enabled=false
96114
enabled: true
97-
# Email address used for ACME registration for the production issuer
98-
email: "user@example.com"
99-
class: "nginx"
100115
101116
clientRouter:
102117
# Customer tunnels will connect with a URI of:
@@ -109,7 +124,9 @@ clientRouter:
109124
enabled: true
110125
```
111126
112-
Make sure to replace the domain and email with your actual domain name and email address.
127+
Make sure to replace the domain with your actual domain name.
128+
129+
Optionally, you can add rate limiting to the client-router Ingress using Traefik Middleware. See [Traefik rate limiting](#traefik-rate-limiting) for details.
113130
114131
Want to use the staging issuer for testing?
115132
@@ -140,8 +157,6 @@ ingress:
140157
# When set, a production issuer will be generated for you
141158
# to use a pre-existing issuer, set issuer.enabled=false
142159
enabled: true
143-
# Email address used for ACME registration for the production issuer
144-
email: "user@example.com"
145160
class: "istio"
146161
147162
clientRouter:
@@ -155,7 +170,7 @@ clientRouter:
155170
enabled: true
156171
```
157172
158-
Make sure to replace the domain and email with your actual domain name and email address.
173+
Make sure to replace the domain with your actual domain name.
159174
160175
### Deploy with Helm
161176
@@ -224,7 +239,7 @@ If you installed inlets-uplink with Kubernetes ingress, you can verify that ingr
224239
$ kubectl get -n inlets ingress/client-router
225240
226241
NAME CLASS HOSTS ADDRESS PORTS AGE
227-
client-router <none> uplink.example.com 188.166.194.102 80, 443 31m
242+
client-router traefik uplink.example.com 188.166.194.102 80, 443 31m
228243
```
229244
230245
```bash
@@ -263,6 +278,10 @@ Next, run the Helm chart installation command again, and remember to use the sam
263278
264279
Over time, you may find using a tool like FluxCD or ArgoCD to manage the installation and updates makes more sense than running Helm commands manually.
265280
281+
!!! warning "Ingress class change in chart version 0.5.0"
282+
283+
The default ingress class changed from Nginx to Traefik in chart version 0.5.0. If you are still using NGINX ingress, make sure your values.yaml includes the required configuration from the [Ingress NGINX section](#ingress-nginx) before upgrading.
284+
266285
If the Custom Resource Definition (CRD) has changed, you can extract it from the Chart repo and install it before or after upgrading. As a rule, Helm won't install or upgrade CRDs a second time if there's already an existing version:
267286
268287
```bash
@@ -305,7 +324,7 @@ Overview of inlets-uplink parameters in `values.yaml`.
305324
| `ingress.issuer.name` | Name of cert-manager Issuer. | `letsencrypt-prod` |
306325
| `ingress.issuer.enabled` | Create a cert-manager Issuer. Set to false if you wish to specify your own pre-existing object for each component. | `true` |
307326
| `ingress.issuer.email` | Let's Encrypt email. Only used for certificate renewing notifications. | `""` |
308-
| `ingress.class` | Ingress class for client router ingress. | `nginx` |
327+
| `ingress.class` | Ingress class for client router ingress. | `traefik` |
309328
| `clientRouter.image` | Container image used for the client router. | `ghcr.io/openfaasltd/uplink-client-router:0.1.5` |
310329
| `clientRouter.domain` | Domain name for inlets uplink. Customer tunnels will connect with a URI of: wss://uplink.example.com/namespace/tunnel. | `""` |
311330
| `clientRouter.tls.ingress.enabled` | Enable ingress for the client router. | `enabled` |
@@ -339,3 +358,81 @@ This data includes the following:
339358
* Kubernetes version
340359
* Inlets Uplink version
341360
* Number of installations of Inlets Uplink
361+
362+
## Traefik rate limiting
363+
364+
With Traefik, rate limiting is configured using [Middleware](https://doc.traefik.io/traefik/middlewares/overview/) custom resources. You can use the [RateLimit](https://doc.traefik.io/traefik/middlewares/http/ratelimit/) middleware to limit requests per second and the [InFlightReq](https://doc.traefik.io/traefik/middlewares/http/inflightreq/) middleware to limit simultaneous connections.
365+
366+
Create a `Middleware` resource for rate limiting in the `inlets` namespace:
367+
368+
```yaml
369+
apiVersion: traefik.io/v1alpha1
370+
kind: Middleware
371+
metadata:
372+
name: uplink-rate-limit
373+
namespace: inlets
374+
spec:
375+
rateLimit:
376+
average: 17
377+
period: 1s
378+
burst: 50
379+
```
380+
381+
Create a `Middleware` resource for limiting simultaneous connections:
382+
383+
```yaml
384+
apiVersion: traefik.io/v1alpha1
385+
kind: Middleware
386+
metadata:
387+
name: uplink-inflight-limit
388+
namespace: inlets
389+
spec:
390+
inFlightReq:
391+
amount: 300
392+
```
393+
394+
To apply the middleware to the client-router Ingress, add the `traefik.ingress.kubernetes.io/router.middlewares` annotation in your `values.yaml`:
395+
396+
```yaml
397+
clientRouter:
398+
tls:
399+
ingress:
400+
annotations:
401+
traefik.ingress.kubernetes.io/router.middlewares: inlets-uplink-rate-limit@kubernetescrd,inlets-uplink-inflight-limit@kubernetescrd
402+
```
403+
404+
The annotation value follows the format `<namespace>-<middleware-name>@kubernetescrd`. Multiple middleware can be chained with commas.
405+
406+
## Ingress NGINX
407+
408+
The Kubernetes NGINX Ingress Controller project has announced its retirement in March 2026 and will no longer receive updates or security patches. The uplink chart version 0.5.0 changes the default ingress class from Nginx to Traefik.
409+
If you want to update to the latest uplink version but have not migrated your ingress controller yet, you need to add the following additional parameters in the values.yaml configuration for the uplink Helm chart.
410+
411+
```yaml
412+
ingress:
413+
class: "nginx"
414+
415+
clientRouter:
416+
tls:
417+
ingress:
418+
annotations:
419+
nginx.ingress.kubernetes.io/limit-connections: "300"
420+
nginx.ingress.kubernetes.io/limit-rpm: "1000"
421+
# 10 minutes for the websocket
422+
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
423+
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
424+
# Up the keepalive timeout to max
425+
nginx.ingress.kubernetes.io/keepalive-timeout: "350"
426+
nginx.ingress.kubernetes.io/proxy-buffer-size: 128k
427+
```
428+
429+
When you have the data-router deployed you can add these additional rate-limiting annotations as well. They used to be set as defaults by the chart.
430+
431+
```yaml
432+
dataRouter:
433+
tls:
434+
ingress:
435+
annotations:
436+
nginx.ingress.kubernetes.io/limit-connections: "300"
437+
nginx.ingress.kubernetes.io/limit-rpm: "1000"
438+
```

docs/uplink/troubleshooting.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Troubleshooting
22

3-
43
## Client connections
54

65
Depending on how you are running the client, with Kubernetes or as a systemd service, use the following commands to check the logs.
@@ -145,7 +144,7 @@ When using TCP tunnels, Proxy Protocol can be a common source of connectivity is
145144

146145
Check if your tunneled service supports Proxy Protocol and verify the configuration at each network hop:
147146

148-
- Load balancers (AWS ALB, nginx, HAProxy)
147+
- Load balancers (AWS ALB, Traefik, HAProxy)
149148
- Ingress controllers
150149
- Service meshes (Istio, Linkerd)
151150
- The tunneled application itself

0 commit comments

Comments
 (0)