---
title: "Charmhub | Deploy traefik-route-k8s\n using Charmhub - The Open Operator Collection"
description: "Deploy the latest version of traefik-route-k8s\n on any cloud."
url: https://charmhub.io/traefik-route-k8s/configurations
---

# traefik-route-k8s

[Canonical Observability](https://charmhub.io/publisher/observability "View all packages from Canonical Observability")

* [Canonical Observability](https://charmhub.io/publisher/observability "View all packages from Canonical Observability")

Platform:

20.04

stable 23

```
juju deploy traefik-route-k8s
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

* [root\_url](https://charmhub.io/traefik-route-k8s/configurations#root_url)
* [rule](https://charmhub.io/traefik-route-k8s/configurations#rule)

[Learn about configurations >](https://juju.is/docs/juju/configuration#heading--application-configuration)

* root\_url | string

  The url to advertise to the unit in need of ingress.
  The value of the field is going to be processed in exactly the same way as the `rule` field. The assumption is that the url is going to match the rule; however, we have no way to validate and/or enforce this condition; so beware! For example, given a downstream unit called `prometheus/0` in the `cos` model, the following configuration is valid:

  rule="Host(`{{juju_unit}}.{{juju_model}}.foo.bar`)"
  root\_url="http://{{juju\_unit}}.{{juju\_model}}.foo.bar/baz"

  while the following configuration is not:

  rule="Host(`{{juju_model}}-{{juju_unit}}.foo.bar`) ||
  HostRegexp(`{subdomain:[a-z]+}.foo.bar`) ||
  Host(`doobadooba.com`)"
  root\_url="ka-ching.com"

  The reason why this is not valid is that the url does not match the rule: so the url advertised to the unit will not in fact be routed correctly by Traefik. Note that Traefik will still work 'correctly', i.e. the application will be reachable at (for example) `http://doobadooba.com`. Examples of 'good' root\_url values for this case would be:

  root\_url="{{juju\_model}}-{{juju\_unit}}.foo.bar/baz"
  root\_url="baz.foo.bar"
  root\_url="doobadooba.com/choo"
* rule | string

  A Traefik routing rule, see https://doc.traefik.io/traefik/routing/routers/ for an overview.
  The value of the field is going to be processed as a Jinja2 template, with the following globals available:

  + {{juju\_model}} resolves to the model name of the downstream proxied
    application.
  + {{juju\_application}} resolves to the application name of the downstream
    proxied application.
  + {{juju\_unit}} resolves to the unit name of the downstream proxied unit;
    to avoid issues when used together with the Host directive or similar,
    the slash character between application name and unit index is replaced by a dash.

  For example, given a downstream unit called `prometheus/0` in the `cos` model, the following:

  Host(`foo.bar/{{juju_unit}}-{{juju_model}}`)

  would evaluate to:

  Host(`foo.bar/cos-prometheus-0`)

  If the host is omitted, but the root\_url is provided, the charm will extract the hostname from the url and generate a Host rule for you.
  root\_url=`http://{{juju_unit}}.bar.baz:80/qux`
  --> rule=Host(`{{juju_unit}}.bar.baz`)
