authelia/internal/suites/example/kube
Clément Michaud 730e88df9d
[FEATURE] Make Authelia serve over TLS in all suites (#864)
* [BUGFIX] Fix dev workflow by using TLS for all suites.

* Fix traefik 1.x and 2.x suites.

* Display authelia logs on suite failure.

* Fix HAProxy suite.

* Extend timeout of test case.

* Display current URL in verify assertion.

* fix doLoginTwoFactor by adding a timeout

* when doLoginTwoFactor is used with blank target and a protected domain is quickly visited authelia sometimes redirects back to the portal
* fix by adding one second timeout
* bump go version to 1.14.2

* Fix Kube suite and bump dashboard.

* Update dist authelia-frontend to proxy_pass with variable

* Apply suggestions from code review

Co-Authored-By: Amir Zarrinkafsh <nightah@me.com>

* Apply suggestions from code review

Co-Authored-By: Amir Zarrinkafsh <nightah@me.com>

* Remove debug logs since it's polluting logs.

Also set timeout back to 5 seconds in HA suite.

Co-authored-by: James Elliott <james-d-elliott@users.noreply.github.com>
Co-authored-by: Amir Zarrinkafsh <nightah@me.com>
2020-04-14 09:57:28 +10:00
..
apps [FEATURE] Make Authelia serve over TLS in all suites (#864) 2020-04-14 09:57:28 +10:00
authelia [FEATURE] Make Authelia serve over TLS in all suites (#864) 2020-04-14 09:57:28 +10:00
ingress-controller [MISC] Restructure repo folder layout (#628) 2020-02-09 18:04:27 +01:00
ldap [BUGFIX] [BREAKING] Set username retrieved from authentication backend in session. (#687) 2020-03-15 18:10:25 +11:00
mail [MISC] Restructure repo folder layout (#628) 2020-02-09 18:04:27 +01:00
storage [MISC] Restructure repo folder layout (#628) 2020-02-09 18:04:27 +01:00
README.md [MISC] Restructure repo folder layout (#628) 2020-02-09 18:04:27 +01:00
bootstrap-authelia.sh [FEATURE] Make Authelia serve over TLS in all suites (#864) 2020-04-14 09:57:28 +10:00
bootstrap-dashboard.sh [FEATURE] Make Authelia serve over TLS in all suites (#864) 2020-04-14 09:57:28 +10:00
bootstrap.sh [MISC] Restructure repo folder layout (#628) 2020-02-09 18:04:27 +01:00
dashboard.yml [MISC] Restructure repo folder layout (#628) 2020-02-09 18:04:27 +01:00
namespace.yml [MISC] Restructure repo folder layout (#628) 2020-02-09 18:04:27 +01:00
test.yml [MISC] Restructure repo folder layout (#628) 2020-02-09 18:04:27 +01:00

README.md

Authelia on Kubernetes

Authelia is now available on Kube in order to protect your most critical applications using 2-factor authentication and Single Sign-On.

This example leverages ingress-nginx to delegate authentication and authorization to Authelia within the cluster.

Getting started

You can either try to install Authelia on your running instance of Kubernetes or deploy the dedicated suite called kubernetes.

Set up a Kube cluster

The simplest way to start a Kubernetes cluster is to deploy the kubernetes suite with

authelia-scripts suites setup kubernetes

This will take a few seconds (or minutes) to deploy the cluster.

How does it work?

Authentication via Authelia

In a Kube clusters, the routing logic of requests is handled by ingress controllers following rules provided by ingress configurations.

In this example, ingress-nginx controller has been installed to handle the incoming requests. Some of them (specified in the ingress configuration) are forwarded to Authelia so that it can verify whether they are allowed and should reach the protected endpoint.

The authentication is provided at the ingress level by an annotation called nginx.ingress.kubernetes.io/auth-url that is filled with the URL of Authelia's verification endpoint. The ingress controller also requires the URL to the authentication portal so that the user can be redirected if he is not yet authenticated. This annotation is as follows: nginx.ingress.kubernetes.io/auth-signin: "https://login.example.com:8080/"

Those annotations can be seen in apps/apps.yml configuration.

Production grade infrastructure

What is great with using ingress-nginx is that it is compatible with kube-lego which removes the usual pain of manually renewing SSL certificates. It uses letsencrypt to issue and renew certificates every three month without any manual intervention.

What do I need to know to deploy it in my cluster?

Given your cluster already runs a LDAP server, a Redis, a SQL database, a SMTP server and a nginx ingress-controller, you can deploy Authelia and update your ingress configurations. An example is provided here.

Questions

If you have questions about the implementation, please post them on Gitter