Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/traefik/traefik/llms.txt

Use this file to discover all available pages before exploring further.

Providers Overview

Traefik’s Many Friends - Configuration Discovery Made Simple Providers are the infrastructure components that Traefik queries to discover routing configuration. Whether you’re using container orchestrators, cloud platforms, or configuration files, Traefik automatically detects changes and dynamically updates routes.

What are Providers?

Configuration discovery in Traefik is achieved through Providers. These are infrastructure components like:
  • Orchestrators: Docker, Kubernetes, Nomad, AWS ECS
  • Service Catalogs: Consul Catalog
  • Key-Value Stores: etcd, Consul, Redis, ZooKeeper
  • File-based: YAML/TOML configuration files
  • API-based: HTTP endpoints
Traefik queries provider APIs to find routing information, and when it detects changes, it dynamically updates routes in real-time.

Provider Categories

Providers can be grouped into four main categories:
1

Label-based Providers

Each deployed container has labels attached to it that define routing rules.Examples: Docker, AWS ECS, Consul Catalog, Nomad
labels:
  - "traefik.http.routers.my-app.rule=Host(`example.com`)"
2

Annotation-based Providers

Separate objects with annotations define container characteristics.Examples: Kubernetes (Ingress, CRD, Gateway API)
metadata:
  annotations:
    traefik.ingress.kubernetes.io/router.entrypoints: websecure
3

Key-Value Providers

Configuration is stored in distributed key-value stores.Examples: etcd, Consul, Redis, ZooKeeper
etcdctl put /traefik/http/routers/my-router/rule "Host(`example.com`)"
4

File-based Providers

Configuration defined in static YAML or TOML files.Examples: File provider, HTTP provider
http:
  routers:
    my-router:
      rule: "Host(`example.com`)"

Supported Providers

ProviderTypeConfiguration MethodProvider Name
DockerOrchestratorLabelsdocker
Kubernetes CRDOrchestratorCustom Resourceskubernetescrd
Kubernetes Gateway APIOrchestratorGateway APIkubernetesgateway
FileManualYAML/TOMLfile
Consul CatalogOrchestratorTagsconsulcatalog
etcdKV StoreKey-Valueetcd
AWS ECSCloudLabelsecs
NomadOrchestratorTagsnomad

Provider Namespaces

When you declare objects like middleware, services, or TLS options, they reside in their provider’s namespace.

Cross-Provider References

To reference objects from another provider, use the @ separator:
<resource-name>@<provider-name>
labels:
  # Reference middleware from file provider
  - "traefik.http.routers.my-app.middlewares=auth@file"
When using Kubernetes, don’t confuse the provider namespace with the Kubernetes namespace. Cross-provider references don’t use Kubernetes namespaces.

Configuration Reload

Throttling Provider Updates

Control how frequently Traefik processes configuration changes:
providers:
  providersThrottleDuration: 2s
providers:
  providersThrottleDuration: 10s
This prevents configuration reload storms when providers update rapidly.

Service Discovery Scope

By default, Traefik creates routes for all detected containers. You can restrict discovery using:

exposedByDefault

Control whether services are exposed automatically:
providers:
  docker:
    exposedByDefault: false
When false, only services with traefik.enable=true are exposed. Supported by: Docker, ECS, Consul Catalog, Nomad

Constraints

Filter services based on labels or tags:
providers:
  docker:
    constraints: "Label(`environment`, `production`)"
Constraints apply to ALL resources from that provider. Use carefully to avoid accidentally hiding services.
Supported by: Docker, ECS, Consul Catalog, Nomad, Kubernetes CRD, Kubernetes Ingress, Kubernetes Gateway

Quick Start Examples

providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: true

Best Practices

1

Use Multiple Providers

Combine providers for flexibility. Use File provider for shared middleware and certificates, plus orchestrator providers for services.
2

Implement Constraints

Use constraints to separate environments (staging/production) or control which services Traefik manages.
3

Set Throttle Duration

Configure providersThrottleDuration in dynamic environments to prevent excessive reloads.
4

Organize Namespaces

Use provider namespaces strategically to organize and reference cross-provider resources.

Next Steps

Docker Provider

Configure Traefik with Docker containers using labels

Kubernetes

Deploy Traefik in Kubernetes with CRDs or Gateway API

File Provider

Use static YAML/TOML files for configuration

AWS ECS

Integrate Traefik with Amazon ECS services