2022-06-15 07:51:47 +00:00
|
|
|
---
|
|
|
|
title: "NGINX Ingress"
|
|
|
|
description: "A guide to integrating Authelia with the NGINX Kubernetes Ingress."
|
|
|
|
lead: "A guide to integrating Authelia with the NGINX Kubernetes Ingress."
|
2022-06-28 05:27:14 +00:00
|
|
|
date: 2022-06-15T17:51:47+10:00
|
2022-06-15 07:51:47 +00:00
|
|
|
draft: false
|
|
|
|
images: []
|
|
|
|
menu:
|
|
|
|
integration:
|
|
|
|
parent: "kubernetes"
|
2022-10-02 02:59:09 +00:00
|
|
|
weight: 552
|
2022-06-15 07:51:47 +00:00
|
|
|
toc: true
|
|
|
|
---
|
|
|
|
|
|
|
|
There are two nginx ingress controllers for Kubernetes. The Kubernetes official one [ingress-nginx], and the F5 nginx
|
2022-08-26 11:03:12 +00:00
|
|
|
official one [nginx-ingress-controller]. We only have integration documentation for [ingress-nginx] and there are no
|
|
|
|
plans to support the F5 [nginx-ingress-controller].
|
2022-06-15 07:51:47 +00:00
|
|
|
|
|
|
|
The [nginx documentation](../proxies/nginx.md) may also be useful for crafting advanced snippets to use with annotations
|
|
|
|
even though it's not specific to Kubernetes.
|
|
|
|
|
2022-06-22 12:58:23 +00:00
|
|
|
## Get Started
|
|
|
|
|
|
|
|
It's __*strongly recommended*__ that users setting up *Authelia* for the first time take a look at our
|
|
|
|
[Get Started](../prologue/get-started.md) guide. This takes you through various steps which are essential to
|
|
|
|
bootstrapping *Authelia*.
|
|
|
|
|
2022-06-15 07:51:47 +00:00
|
|
|
## NGINX Ingress Controller (ingress-nginx)
|
|
|
|
|
2022-08-26 11:03:12 +00:00
|
|
|
If you use NGINX Ingress Controller ([ingress-nginx]) you can protect an ingress with the following annotations. The
|
2022-06-15 07:51:47 +00:00
|
|
|
example assumes that the public domain Authelia is served on is `https://auth.example.com` and there is a
|
|
|
|
Kubernetes service with the name `authelia` in the `default` namespace with TCP port `80` configured to route to the
|
|
|
|
Authelia HTTP port and that your cluster is configured with the default
|
|
|
|
DNS domain name of `cluster.local`.
|
|
|
|
|
2022-08-26 11:03:12 +00:00
|
|
|
*__Important Note:__ The following annotations should be applied to an Ingress you wish to protect. They __SHOULD NOT__
|
|
|
|
be applied to the Authelia Ingress itself.*
|
|
|
|
|
2022-06-15 07:51:47 +00:00
|
|
|
### Ingress Annotations
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
annotations:
|
2022-07-26 05:26:38 +00:00
|
|
|
nginx.ingress.kubernetes.io/auth-method: GET
|
2023-01-25 09:36:40 +00:00
|
|
|
nginx.ingress.kubernetes.io/auth-url: http://authelia.default.svc.cluster.local/api/authz/auth-request
|
2022-07-26 05:26:38 +00:00
|
|
|
nginx.ingress.kubernetes.io/auth-signin: https://auth.example.com?rm=$request_method
|
2023-01-25 09:36:40 +00:00
|
|
|
nginx.ingress.kubernetes.io/auth-response-headers: Authorization,Proxy-Authorization,Remote-User,Remote-Name,Remote-Groups,Remote-Email
|
2022-06-15 07:51:47 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
[ingress-nginx]: https://kubernetes.github.io/ingress-nginx/
|
|
|
|
[nginx-ingress-controller]: https://docs.nginx.com/nginx-ingress-controller/
|