LinuxCommandLibrary

traefik

Route and manage microservices traffic

TLDR

Start the server with the default configuration

$ traefik
copy

Start the server with a custom configuration file
$ traefik --ConfigFile [config_file.toml]
copy

Start the server with cluster mode enabled
$ traefik --cluster
copy

Start server with web UI enabled
$ traefik --web
copy

SYNOPSIS

traefik [flags]

PARAMETERS

--accesslog
    Enables the access log. The log format can be customized via the `format` option (default: common).

--accesslog.bufferingSize
    Defines the number of access log lines to buffer.

--accesslog.fields.defaultMode
    Default mode for fields.

--accesslog.fields.headers.defaultMode
    Default mode for headers in fields.

--accesslog.fields.headers.names
    Defines headers names that will be used in fields.

--accesslog.fields.names
    Defines fields names that will be used in the accesslog.

--accesslog.filepath
    Access log file path. Stdout is used if not specified.

--accesslog.format
    Access log format: common, json, logfmt.

--api
    Enable the API and dashboard.

--api.dashboard
    Enable the dashboard.

--api.debug
    Enable debug mode.

--entrypoints
    Define available entrypoints (Can be defined multiple times)

--providers
    Enable providers (Can be defined multiple times)

--global.checkNewVersion
    Check if a new version is available.

--configFile
    Load configuration from file.

--help
    Show help message

DESCRIPTION

Traefik is a modern, cloud-native edge router that automates and simplifies routing to your services. It is designed to be easily configured and dynamically adapt to your infrastructure. It automatically discovers the appropriate configuration for your services and routes traffic to them. Traefik natively supports multiple orchestration systems like Kubernetes, Docker, Docker Swarm, Mesos/Marathon, Consul, Etcd, Rancher, and more. It is designed to be a *dynamic* proxy, constantly monitoring your infrastructure for changes and automatically updating its configuration. Traefik offers advanced features like automatic TLS certificate generation using Let's Encrypt, circuit breakers, health checks, metrics integration (Prometheus, Datadog, StatsD), request tracing, and more. It provides a user-friendly dashboard for monitoring the health and status of your services and the Traefik instance itself. Traefik can be used in various scenarios, from simple local development setups to complex production environments.

CAVEATS

Configuration is complex and often requires understanding of the underlying infrastructure being integrated with. Debugging misconfigurations can be challenging without proper logging and monitoring.

DYNAMIC CONFIGURATION

Traefik's dynamic configuration capabilities are a core feature. It automatically discovers and updates its routing configuration based on changes in your infrastructure (e.g., new containers being deployed, services scaling up or down). This eliminates the need for manual configuration and restarts, making it ideal for dynamic environments.

TLS & SECURITY

Traefik simplifies TLS configuration by automatically generating and renewing certificates using Let's Encrypt. It also provides various security features, such as rate limiting, authentication middleware, and HTTP to HTTPS redirection.

HISTORY

Traefik was originally created by Emile Vauge.
It quickly gained popularity due to its ease of use, automatic configuration, and support for various orchestration systems. Traefik has evolved through multiple major versions, with significant improvements in performance, features, and stability. Its development is driven by the open-source community and commercial support is available.

SEE ALSO

nginx(8), haproxy(1)

Copied to clipboard