Skip to main content

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
2

Annotation-based Providers

Separate objects with annotations define container characteristics.Examples: Kubernetes (Ingress, CRD, Gateway API)
3

Key-Value Providers

Configuration is stored in distributed key-value stores.Examples: etcd, Consul, Redis, ZooKeeper
4

File-based Providers

Configuration defined in static YAML or TOML files.Examples: File provider, HTTP provider

Supported Providers

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:
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:
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:
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:
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

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