Plugins and Traefik Pilot¶
Traefik Pilot is a software-as-a-service (SaaS) platform that connects to Traefik Enterprise to extend its capabilities. It offers a number of features to enhance observability and control of Traefik Enterprise through a global control plane and dashboard, including:
- Metrics for network activity of Traefik Enterprise
- Alerts for service health issues and security vulnerabilities
- Plugins that extend the functionality of Traefik Enterprise
Learn More About Traefik Pilot
This section is intended only as a brief overview for Traefik Enterprise users who are not familiar with Traefik Pilot. To explore all that Traefik Pilot has to offer, please consult the Traefik Pilot Documentation
Prerequisites
Traefik Pilot is compatible with Traefik Enterprise v2.4 or later.
Connecting to Traefik Pilot¶
To connect Traefik Enterprise to Traefik Pilot, login or create an account at the Traefik Pilot homepage and choose Register New Traefik Instance.
To complete the connection, Traefik Pilot will issue a token that must be added to your static configuration, according to the instructions provided by the Traefik Pilot dashboard. For more information, consult the Quick Start Guide
Health and security alerts for registered Traefik Enterprise clusters can be enabled from the Preferences in your Traefik Pilot Profile.
Plugins¶
Plugins are available to any Traefik Enterprise cluster that has the plugin registry installed. They are a powerful system for extending Traefik Enterprise with custom features and behaviors.
You can browse community-contributed plugins from the catalog in the Traefik Pilot Dashboard, or alternatively add your own private plugins.
Experimental Features
Plugins can potentially modify the behavior of Traefik Enterprise in unforeseen ways. Exercise caution when adding new plugins to production Traefik Enterprise clusters.
Community Plugins¶
To add a community plugin to a Traefik Enterprise cluster, you must modify that instance's static configuration. The code to be added is provided for you when you choose Install the Plugin from the Traefik Pilot dashboard. To learn more about Traefik plugins, consult the documentation.
Private Plugins¶
To add a private plugin to a Traefik Enterprise cluster, you must first zip your plugin, with the plugin code under a
root folder in the zip. It can then be added to the plugin registry using teectl
:
teectl create plugin --archivepath=./plugin.zip --version=v0.1.0
Once the plugin has been added to the plugin registry, it can be added to the instance's static configuration.
experimental:
plugins:
example:
moduleName: github.com/your/plugin
version: v0.1.0
[experimental]
[experimental.plugins]
[experimental.plugins.example]
moduleName = "github.com/your/plugin"
version = "v0.1.0"
To learn more about developing plugins and see code for example plugins, please see the developer documentation.
Using a Middleware Plugin¶
To use a middleware plugin, it must be added and configured in the dynamic configuration. An example of this is shown below:
labels:
- "traefik.http.middlewares.my-middleware.plugin.example.heaader.Foo=Bar"
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: my-middleware
spec:
plugin:
example:
headers:
Foo: Bar
- "traefik.http.middlewares.my-middleware.plugin.example.headers.Foo=Bar"
"labels": {
"traefik.http.middlewares.my-middleware.plugin.example.headers.Foo": "Bar"
}
labels:
- "traefik.http.middlewares.my-middleware.plugin.example.headers.Foo=Bar"
http:
middlewares:
my-middleware:
plugin:
example:
headers:
Foo: Bar
[http.middlewares]
[http.middlewares.my-middleware.plugin.example.headers]
Foo = "Bar"
Viewing Added Plugins¶
You can view the plugins that have been added to the plugin registry using a teectl
command:
teectl get plugins
NAME TYPE SUMMARY MODULE VERSION
Demo Plugin middleware [Demo] Add Request Header github.com/traefik/plugindemo v0.2.1
Deleting Unused Plugins¶
All plugins, both community and private, are stored in the plugin registry. Unused plugins can be removed using a teectl
command:
teectl delete plugin --modulename=github.com/your/plugin --version=v0.1.0
Deleting Private Plugins
Once a version of a private plugin has been deleted, it can never be added to the plugin registry again. This is done to ensure a plugin version cannot be replaced unbeknownst to the user.