Skip to content

Commit f431037

Browse files
committed
Add TLS on AWS EKS with Ingress using AWS Load Balancer Controller
- Document how to use AWS Load Balancer Controller with Traefik on EKS - Add required annotation for internet-facing NLB provisioning - Fix typo in main TLS guide Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
1 parent bfc1fc0 commit f431037

File tree

1 file changed

+64
-2
lines changed

1 file changed

+64
-2
lines changed

docs/reference/tls-openfaas.md

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This guide explains how to obtain TLS certificates for the OpenFaaS Gateway runn
66

77
* Setup an Ingress Controller
88
* Configure cert-manager to obtain a certificate from Let's Encrypt
9-
* Configure the an Ingress record for the OpenFaaS Gateway
9+
* Configure an Ingress record for the OpenFaaS Gateway
1010

1111
## Pre-requisites
1212

@@ -26,7 +26,7 @@ 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 Traefik for OpenFaaS, however any Ingress controller will work, or you can use Istio with separate instructions.
29+
This section covers setting up TLS for OpenFaaS using Traefik as the Ingress Controller, however any Ingress controller will work, or you can use Istio with separate instructions.
3030

3131
Install Traefik with Helm:
3232

@@ -229,6 +229,68 @@ EOF
229229

230230
As above, run the `helm upgrade` command to apply the changes.
231231

232+
---
233+
234+
## AWS EKS with the AWS Load Balancer Controller
235+
236+
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.
237+
238+
### Install the AWS Load Balancer Controller
239+
240+
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.
241+
242+
See also: [AWS Load Balancer Controller documentation](https://kubernetes-sigs.github.io/aws-load-balancer-controller/)
243+
244+
Once installed, verify the controller is running:
245+
246+
```sh
247+
$ kubectl get deployment -n kube-system aws-load-balancer-controller
248+
249+
NAME READY UP-TO-DATE AVAILABLE AGE
250+
aws-load-balancer-controller 2/2 2 2 84s
251+
```
252+
253+
### Install Traefik with the NLB annotation
254+
255+
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.
256+
257+
Install Traefik using Helm with the required annotation:
258+
259+
```sh
260+
helm repo add traefik https://traefik.github.io/charts
261+
helm repo update
262+
263+
helm install --namespace=traefik traefik traefik/traefik \
264+
--create-namespace \
265+
--set "service.annotations.service\.beta\.kubernetes\.io/aws-load-balancer-scheme=internet-facing"
266+
```
267+
268+
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.
269+
270+
Verify that Traefik is running and has an external address:
271+
272+
```sh
273+
$ kubectl get svc -n traefik
274+
275+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
276+
traefik LoadBalancer 10.100.45.123 xxx.elb.amazonaws.com 80:31876/TCP,443:31706/TCP 60s
277+
```
278+
279+
The `EXTERNAL-IP` field will show an NLB hostname (e.g. `xxx.elb.amazonaws.com`).
280+
281+
### Configure cert-manager, Issuers, and OpenFaaS TLS
282+
283+
The remaining steps are the same as the in the [general Ingress setup](#general-setup-with-traefik):
284+
285+
1. [Install cert-manager](#install-cert-manager)
286+
2. [Configure cert-manager](#configure-cert-manager)
287+
3. [Configure TLS for the OpenFaaS gateway](#configure-tls-for-the-openfaas-gateway)
288+
4. Optionally, [Configure TLS for the OpenFaaS dashboard](#configure-tls-for-the-openfaas-dashboard)
289+
290+
### Create DNS records
291+
292+
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.
293+
232294
## Verifying the installation
233295

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

0 commit comments

Comments
 (0)