Traefik Enterprise Provider¶
The default Traefik Proxy file provider can be difficult to operate in a distributed environment. For this reason, Traefik Enterprise has a built-in dynamic configuration provider that replaces the file provider. This provider uses the same file formats as the file provider for ease of use. For more information on the file format, please refer to the reference.
Applying a Traefik Enterprise Provider Configuration¶
Traefik Enterprise provider configuration can be applied to a cluster using the apply
command in teectl
:
teectl apply --file=config.toml
The apply
command supports both TOML and YAML dynamic configuration formats, in addition to Go Templating.
More information about the apply
command can be found in the teectl
reference.
Referencing resources across providers
The Traefik Enterprise provider leverages the Traefik Proxy provider namespacing system.
All resources defined using the Traefik Enterprise provider are available from other providers under the traefikee
namespace.
For example, a middleware called google-auth
defined in the TraefiKEE provider is available as google-auth@traefikee
from any other provider.
# Defines a google-auth middleware
[http.middlewares]
[http.middlewares.google-auth.plugin.oidcAuth]
source = "google"
redirectURL = "/callback"
[http.middlewares.google-auth.plugin.oidcAuth.session]
secret = "0123456789secret"
---
# Defines a google-auth middleware
http:
middlewares:
google-auth:
plugin:
oidcAuth:
source: "google"
redirectURL: "/callback"
session:
secret: "0123456789secret"
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: secured-app
spec:
# [...]
routes:
- match: Host(`secured.example.com`)
kind: Rule
middlewares:
# Refers to the google-auth middleware defined with the Traefik Enterprise provider
- google-auth@traefikee
[...]
labels:
# Refers to the google-auth middleware defined with the Traefik Enterprise provider
- "traefik.http.routers.secured-app.middlewares=google-auth@traefikee"
Getting the Traefik Enterprise Provider Configuration¶
To get the currently applied Traefik Enterprise provider configuration, use teectl
:
teectl get traefikee-provider-config
The format of the output can be specified with the --format
option.
More information about the get traefikee-provider-config
command can be found in the teectl
reference.
Deleting the Traefik Enterprise Provider Configuration¶
If the Traefik Enterprise provider configuration is no longer needed, it can be deleted using teectl
:
teectl delete traefikee-provider-config
More information about the delete traefikee-provider-config
command can be found in the teectl
reference.