Skip to content

Commit c824b40

Browse files
committed
Restructure TLS documentation to separate AWS and Gateway API guides
- Split AWS EKS Ingress setup into dedicated guide (tls-aws-ingress.md) - Add comprehensive Gateway API section to main TLS guide using Envoy Gateway - Reduce duplication in AWS Gateway API guide by referencing common setup steps - Update navigation to include new AWS-specific guides Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
1 parent b5cf8dc commit c824b40

File tree

4 files changed

+428
-259
lines changed

4 files changed

+428
-259
lines changed

docs/reference/tls-aws-gateway-api.md

Lines changed: 8 additions & 197 deletions
Original file line numberDiff line numberDiff line change
@@ -306,206 +306,17 @@ The NLB approach requires the `TCPRoute` CRD which is part of the experimental G
306306
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.3.0/experimental-install.yaml
307307
```
308308

309-
### Install Envoy Gateway
309+
### Set up Envoy Gateway, cert-manager, and HTTPRoutes
310310

311-
Install Envoy Gateway using Helm.
311+
Follow the [Gateway API with Envoy Gateway](/reference/tls-openfaas.md#gateway-api-with-envoy-gateway) section in the TLS for OpenFaaS guide to:
312312

313-
```sh
314-
helm install eg oci://docker.io/envoyproxy/gateway-helm \
315-
--version v1.7.0 \
316-
-n envoy-gateway-system \
317-
--create-namespace
318-
```
319-
320-
Wait for Envoy Gateway to become available:
321-
322-
```sh
323-
kubectl wait --timeout=5m -n envoy-gateway-system \
324-
deployment/envoy-gateway --for=condition=Available
325-
```
326-
327-
See also: [Envoy Gateway installation](https://gateway.envoyproxy.io/docs/install/install-helm/)
328-
329-
### Create the Envoy GatewayClass
330-
331-
Create a GatewayClass for Envoy Gateway:
332-
333-
```bash
334-
cat > gatewayclass-eg.yaml <<EOF
335-
apiVersion: gateway.networking.k8s.io/v1
336-
kind: GatewayClass
337-
metadata:
338-
name: eg
339-
spec:
340-
controllerName: gateway.envoyproxy.io/gatewayclass-controller
341-
EOF
342-
```
343-
344-
```bash
345-
kubectl apply -f gatewayclass-eg.yaml
346-
```
347-
348-
### Install cert-manager
349-
350-
cert-manager is used to obtain TLS certificates from Let's Encrypt for the Envoy Gateway.
351-
352-
```sh
353-
helm install \
354-
cert-manager oci://quay.io/jetstack/charts/cert-manager \
355-
--namespace cert-manager \
356-
--create-namespace \
357-
--set crds.enabled=true \
358-
--set config.apiVersion="controller.config.cert-manager.io/v1alpha1" \
359-
--set config.kind="ControllerConfiguration" \
360-
--set config.enableGatewayAPI=true
361-
```
362-
363-
The `enableGatewayAPI` flag tells cert-manager to watch for Gateway API resources when solving ACME challenges.
364-
365-
### Create a cert-manager Issuer
366-
367-
Create an Issuer in the `openfaas` namespace that uses Let's Encrypt with an HTTP-01 challenge. The solver uses `gatewayHTTPRoute` instead of the `ingress` class used in a traditional Ingress-based setup:
368-
369-
```bash
370-
cat > issuer.yaml <<EOF
371-
apiVersion: cert-manager.io/v1
372-
kind: Issuer
373-
metadata:
374-
name: letsencrypt-prod
375-
namespace: openfaas
376-
spec:
377-
acme:
378-
server: https://acme-v02.api.letsencrypt.org/directory
379-
privateKeySecretRef:
380-
name: letsencrypt-prod-account-key
381-
solvers:
382-
- http01:
383-
gatewayHTTPRoute:
384-
parentRefs:
385-
- name: openfaas-gateway
386-
namespace: openfaas
387-
kind: Gateway
388-
EOF
389-
```
390-
391-
```bash
392-
kubectl apply -f issuer.yaml
393-
```
394-
395-
The `parentRefs` field points to the Envoy Gateway we'll create in the next step. The referenced Gateway must have a listener on port 80 so that Let's Encrypt can reach the HTTP-01 challenge URL.
396-
397-
### Create the Envoy Gateway
398-
399-
Create the Envoy Gateway with listeners for both HTTP (for ACME challenges) and HTTPS (for application traffic):
400-
401-
```bash
402-
cat > envoy-gateway.yaml <<EOF
403-
apiVersion: gateway.networking.k8s.io/v1
404-
kind: Gateway
405-
metadata:
406-
name: openfaas-gateway
407-
namespace: openfaas
408-
annotations:
409-
cert-manager.io/issuer: letsencrypt-prod
410-
spec:
411-
gatewayClassName: eg
412-
listeners:
413-
- name: http
414-
port: 80
415-
protocol: HTTP
416-
allowedRoutes:
417-
namespaces:
418-
from: Same
419-
- name: gateway
420-
hostname: "gw.example.com"
421-
port: 443
422-
protocol: HTTPS
423-
allowedRoutes:
424-
namespaces:
425-
from: Same
426-
tls:
427-
mode: Terminate
428-
certificateRefs:
429-
- name: openfaas-gateway-cert
430-
- name: dashboard
431-
hostname: "dashboard.example.com"
432-
port: 443
433-
protocol: HTTPS
434-
allowedRoutes:
435-
namespaces:
436-
from: Same
437-
tls:
438-
mode: Terminate
439-
certificateRefs:
440-
- name: openfaas-dashboard-cert
441-
EOF
442-
```
443-
444-
```bash
445-
kubectl apply -f envoy-gateway.yaml
446-
```
447-
448-
The `cert-manager.io/issuer` annotation tells cert-manager to automatically create Certificate resources for each HTTPS listener. The certificates will be stored in the Secrets referenced by `certificateRefs`.
449-
450-
### Create HTTPRoutes
451-
452-
Create an HTTPRoute for the OpenFaaS gateway:
453-
454-
```bash
455-
cat > httproute.yaml <<EOF
456-
apiVersion: gateway.networking.k8s.io/v1
457-
kind: HTTPRoute
458-
metadata:
459-
name: openfaas-gateway
460-
namespace: openfaas
461-
spec:
462-
parentRefs:
463-
- name: openfaas-gateway
464-
hostnames:
465-
- "gw.example.com"
466-
rules:
467-
- matches:
468-
- path:
469-
type: PathPrefix
470-
value: /
471-
backendRefs:
472-
- name: gateway
473-
port: 8080
474-
EOF
475-
```
476-
477-
```bash
478-
kubectl apply -f httproute.yaml
479-
```
480-
481-
If you are using the [OpenFaaS Dashboard](/openfaas-pro/dashboard.md), create an additional HTTPRoute:
482-
483-
```bash
484-
cat > httproute-dashboard.yaml <<EOF
485-
apiVersion: gateway.networking.k8s.io/v1
486-
kind: HTTPRoute
487-
metadata:
488-
name: openfaas-dashboard
489-
namespace: openfaas
490-
spec:
491-
parentRefs:
492-
- name: openfaas-gateway
493-
hostnames:
494-
- "dashboard.example.com"
495-
rules:
496-
- matches:
497-
- path:
498-
type: PathPrefix
499-
value: /
500-
backendRefs:
501-
- name: dashboard
502-
port: 8080
503-
EOF
504-
```
313+
1. Install Envoy Gateway and create its GatewayClass
314+
2. Install cert-manager with Gateway API support
315+
3. Create a cert-manager Issuer
316+
4. Create the Envoy Gateway with HTTP and HTTPS listeners
317+
5. Create HTTPRoutes for the OpenFaaS gateway (and optionally the dashboard)
505318

506-
```bash
507-
kubectl apply -f httproute-dashboard.yaml
508-
```
319+
Once the Envoy Gateway, HTTPRoutes, and certificates are configured, continue with the steps below to place an NLB in front of Envoy Gateway.
509320

510321
### Create the NLB GatewayClass and Gateway
511322

docs/reference/tls-aws-ingress.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# TLS on AWS EKS with Ingress
2+
3+
If you're running on AWS EKS, the [AWS Load Balancer Controller](https://kubernetes-sigs.github.io/aws-load-balancer-controller/) can be used to provision a Network Load Balancer (NLB) for Traefik's LoadBalancer Service. Traefik still acts as the Ingress Controller and handles TLS termination with cert-manager, but the NLB provides the public endpoint.
4+
5+
For Gateway API approaches on AWS, see [TLS on AWS with Gateway API](/reference/tls-aws-gateway-api.md).
6+
7+
## Pre-requisites
8+
9+
* AWS EKS cluster with OpenFaaS installed via Helm
10+
* A domain name under your control, and access to create A or CNAME records
11+
12+
Where you see `example.com` given in an example, replace that with your own domain name.
13+
14+
## Install the AWS Load Balancer Controller
15+
16+
Follow the [AWS documentation to install the AWS Load Balancer Controller using Helm](https://docs.aws.amazon.com/eks/latest/userguide/lbc-helm.html). The installation guide covers IAM configuration and the controller deployment.
17+
18+
See also: [AWS Load Balancer Controller documentation](https://kubernetes-sigs.github.io/aws-load-balancer-controller/)
19+
20+
Once installed, verify the controller is running:
21+
22+
```sh
23+
$ kubectl get deployment -n kube-system aws-load-balancer-controller
24+
25+
NAME READY UP-TO-DATE AVAILABLE AGE
26+
aws-load-balancer-controller 2/2 2 2 84s
27+
```
28+
29+
## Install Traefik with the NLB annotation
30+
31+
On EKS with the AWS Load Balancer Controller, Traefik's LoadBalancer Service needs the correct annotation so that the controller provisions an internet-facing NLB.
32+
33+
Install Traefik using Helm with the required annotation:
34+
35+
```sh
36+
helm repo add traefik https://traefik.github.io/charts
37+
helm repo update
38+
39+
helm install --namespace=traefik traefik traefik/traefik \
40+
--create-namespace \
41+
--set "service.annotations.service\.beta\.kubernetes\.io/aws-load-balancer-scheme=internet-facing"
42+
```
43+
44+
The `service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing` annotation ensures the NLB is publicly accessible. Without it, the AWS Load Balancer Controller defaults to an `internal` scheme, which would prevent Let's Encrypt HTTP01 challenges from reaching your cluster.
45+
46+
Verify that Traefik is running and has an external address:
47+
48+
```sh
49+
$ kubectl get svc -n traefik
50+
51+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
52+
traefik LoadBalancer 10.100.45.123 xxx.elb.amazonaws.com 80:31876/TCP,443:31706/TCP 60s
53+
```
54+
55+
The `EXTERNAL-IP` field will show an NLB hostname (e.g. `xxx.elb.amazonaws.com`).
56+
57+
## Configure cert-manager, Issuers, and OpenFaaS TLS
58+
59+
The remaining steps are the same as in the [general Ingress setup](/reference/tls-openfaas.md#ingress-with-traefik):
60+
61+
1. [Install cert-manager](/reference/tls-openfaas.md#install-cert-manager)
62+
2. [Configure cert-manager](/reference/tls-openfaas.md#configure-cert-manager)
63+
3. [Configure TLS for the OpenFaaS gateway](/reference/tls-openfaas.md#configure-tls-for-the-openfaas-gateway)
64+
4. Optionally, [Configure TLS for the OpenFaaS dashboard](/reference/tls-openfaas.md#configure-tls-for-the-openfaas-dashboard)
65+
66+
## Create DNS records
67+
68+
On EKS the `EXTERNAL-IP` field shows a hostname rather than an IP address. Create a **CNAME record** pointing your domain to the NLB hostname instead of an A record.
69+
70+
## Verifying the installation
71+
72+
See the [verification steps](/reference/tls-openfaas.md#verifying-the-installation) in the main TLS guide.

0 commit comments

Comments
 (0)