canonical / traefik-route-k8s-operator

Configuration charm for traefik-k8s.
https://charmhub.io/traefik-route-k8s
Apache License 2.0
0 stars 3 forks source link
ingress juju juju-charm kubernetes routing

traefik-route-k8s-operator

CharmHub Badge Release Discourse Status

Description

[!NOTE]
THIS CHARM IS DEPRECATED.

The traefik_route v0 library is DEPRECATED and is now maintained under https://github.com/canonical/traefik-k8s-operator.

Please fetch the new library with charmcraft fetch-lib charms.traefik_k8s.v0.traefik_route.

Traefik-route-k8s provides separation of concerns between the general needs of the ingress and ingress-per-unit relation interfaces, and the need to specify per-relation routing logic at runtime which in this case is specific to Traefik. The traefik-k8s charm provides support for a few built-in routing types and optionally setting an external hostname.

The traefik-route-k8s charm proposed here addresses advanced use-cases, providing the cloud admin full control over the routing template.

This charm allows to preserve the generality of the ingress_per_unit relation interface of the traefik-k8s charm, while exposing Traefik-specific routing configurations through a configuration charm that sits between traefik-k8s and the proxied application.

Usage

The idea is that this charm sits between the charm in need of ingress (let's call it Charm), and traefik-k8s. For example a juju topology for providing ingress to a prometheus-k8s charm could look like:

classDiagram
    direction LR
    traefik_k8s "1" --|> "*" traefik_route_k8s : traefik_route
    traefik_route_k8s "1" --|> "1" prometheus_k8s : ingress_per_unit

This way the complexity of configuring the ingress is hidden from the (developers/maintainers of the) end consumer, prometheus-k8s in this example, while at the same time all advanced configuration options remain available to the cloud admin.

The information flow can be visualized as:

sequenceDiagram
    traefik --> traefik-route: traefik_route
    note left of traefik-route: user relates traefik and traefik-route

    traefik-route --> charm: ingress_per_unit
    note left of charm: user relates charm and traefik-route
    note left of traefik-route: user configures traefik-route (config template and root_url)

    charm ->> traefik-route: (model & unit name)
    note left of traefik-route: traefik-route renders the config
    traefik-route ->>  traefik: (rendered) config yaml
    traefik-route ->>  charm: ingress (root_url) 

Configuration fields:

You can configure TraefikRoute with the following parameters:

Relations

Provides an “ingress-per-unit” relation using the “ingress_per_unit” relation interface, with limit 1.

Requires a “traefik-route” relation using a “traefik_route” relation interface, with limit 1.

OCI Images

This is a workload-less charm.

Contributing

Please see the Juju SDK docs for guidelines on enhancements to this charm following best practice guidelines, and CONTRIBUTING.md for developer guidance.