Traefik Ingress Operator for Kubernetes

  • Canonical Observability
Channel Revision Published Runs on
latest/stable 199 19 Nov 2024
Ubuntu 20.04
latest/candidate 203 19 Nov 2024
Ubuntu 20.04
latest/beta 218 19 Nov 2024
Ubuntu 20.04
latest/edge 218 18 Nov 2024
Ubuntu 20.04
1.0/stable 164 16 Feb 2024
Ubuntu 20.04
1.0/candidate 164 22 Nov 2023
Ubuntu 20.04
1.0/beta 164 22 Nov 2023
Ubuntu 20.04
1.0/edge 164 22 Nov 2023
Ubuntu 20.04
juju deploy traefik-k8s --channel edge
Show information

Platform:

This feature is available in traefik-k8s starting from revision 206.

In order to enable BasicAuth in traefik-k8s you will need to:

Generate a user string

First you will need to generate a user string with the right format:

<username>:<hashed-password>

where the password must be hashed with either MD5, SHA1, or BCrypt.

We recommend using htpasswd to generate the user string:

(on ubuntu) $ sudo apt-get install apache2-utils

$ htpasswd -nbB YOUR_USERNAME YOUR_PASSWORD

For example, running with `admin/admin:

$ htpasswd -nbB admin admin admin:$2y$05$ChsVYFWoLO7YbNnRZSS2IeLcKzL1jgfdOdCfyhtz4tcPOvmTkQYPy

TIP: Use a strong password.

Pass the user string to traefik-k8s

$ juju config traefik-k8s basic_auth_user='<YOUR_USER_STRING>'

Remember to escape the user string! The hash can contain some odd characters that may confuse your shell.

Wait for traefik to process the action and ta-da! you should now have enabled BasicAuth. Any url you try to access through this traefik instance will request the username/password combination you chose.

We don’t yet support multiple users or per-route auth. Need that? Let us know! For the time being, you can consider deploying multiple traefiks to segment your namespace with separate user domains.


Help improve this document in the forum (guidelines). Last updated 2 months ago.