Skip to content

Commit

Permalink
Remove Pilot support
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored Sep 14, 2022
1 parent a002ccf commit ab8d7d2
Show file tree
Hide file tree
Showing 23 changed files with 35 additions and 1,264 deletions.
3 changes: 1 addition & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Security Policy

We strongly advise you to register your Traefik instances to [Pilot](https://pilot.traefik.io) to be notified of security advisories that apply to your Traefik version.
You can also join our security mailing list to be aware of the latest announcements from our security team.
You can join our security mailing list to be aware of the latest announcements from our security team.
You can subscribe sending a mail to [email protected] or on [the online viewer](https://groups.google.com/a/traefik.io/forum/#!forum/security).

Reported vulnerabilities can be found on [cve.mitre.org](https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=traefik).
Expand Down
13 changes: 0 additions & 13 deletions cmd/traefik/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ func initPlugins(staticCfg *static.Configuration) (*plugins.Client, map[string]p
if hasPlugins(staticCfg) {
opts := plugins.ClientOptions{
Output: outputDir,
Token: getPilotToken(staticCfg),
}

var err error
Expand Down Expand Up @@ -75,18 +74,6 @@ func checkUniquePluginNames(e *static.Experimental) error {
return nil
}

func isPilotEnabled(staticCfg *static.Configuration) bool {
return staticCfg.Pilot != nil && staticCfg.Pilot.Token != ""
}

func getPilotToken(staticCfg *static.Configuration) string {
if staticCfg.Pilot == nil {
return ""
}

return staticCfg.Pilot.Token
}

func hasPlugins(staticCfg *static.Configuration) bool {
return staticCfg.Experimental != nil && len(staticCfg.Experimental.Plugins) > 0
}
Expand Down
28 changes: 3 additions & 25 deletions cmd/traefik/traefik.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
"github.com/traefik/traefik/v2/pkg/metrics"
"github.com/traefik/traefik/v2/pkg/middlewares/accesslog"
"github.com/traefik/traefik/v2/pkg/middlewares/capture"
"github.com/traefik/traefik/v2/pkg/pilot"
"github.com/traefik/traefik/v2/pkg/provider/acme"
"github.com/traefik/traefik/v2/pkg/provider/aggregator"
"github.com/traefik/traefik/v2/pkg/provider/hub"
Expand Down Expand Up @@ -204,22 +203,8 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
return nil, err
}

// Pilot

var aviator *pilot.Pilot
var pilotRegistry *metrics.PilotRegistry
if isPilotEnabled(staticConfiguration) {
pilotRegistry = metrics.RegisterPilot()

aviator = pilot.New(staticConfiguration.Pilot.Token, pilotRegistry, routinesPool)

routinesPool.GoCtx(func(ctx context.Context) {
aviator.Tick(ctx)
})
}

if staticConfiguration.Pilot != nil {
log.WithoutContext().Warn("Traefik Pilot is deprecated and will be removed soon. Please check our Blog for migration instructions later this year.")
log.WithoutContext().Warn("Traefik Pilot has been removed.")
}

// Plugins
Expand Down Expand Up @@ -263,9 +248,6 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
// Metrics

metricRegistries := registerMetricClients(staticConfiguration.Metrics)
if pilotRegistry != nil {
metricRegistries = append(metricRegistries, pilotRegistry)
}
metricsRegistry := metrics.NewMultiRegistry(metricRegistries)

// Service manager factory
Expand Down Expand Up @@ -315,7 +297,7 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
})

// Switch router
watcher.AddListener(switchRouter(routerFactory, serverEntryPointsTCP, serverEntryPointsUDP, aviator))
watcher.AddListener(switchRouter(routerFactory, serverEntryPointsTCP, serverEntryPointsUDP))

// Metrics
if metricsRegistry.IsEpEnabled() || metricsRegistry.IsSvcEnabled() {
Expand Down Expand Up @@ -391,16 +373,12 @@ func getDefaultsEntrypoints(staticConfiguration *static.Configuration) []string
return defaultEntryPoints
}

func switchRouter(routerFactory *server.RouterFactory, serverEntryPointsTCP server.TCPEntryPoints, serverEntryPointsUDP server.UDPEntryPoints, aviator *pilot.Pilot) func(conf dynamic.Configuration) {
func switchRouter(routerFactory *server.RouterFactory, serverEntryPointsTCP server.TCPEntryPoints, serverEntryPointsUDP server.UDPEntryPoints) func(conf dynamic.Configuration) {
return func(conf dynamic.Configuration) {
rtConf := runtime.NewConfig(conf)

routers, udpRouters := routerFactory.CreateRouters(rtConf)

if aviator != nil {
aviator.SetDynamicConfiguration(conf)
}

serverEntryPointsTCP.Switch(routers)
serverEntryPointsUDP.Switch(udpRouters)
}
Expand Down
13 changes: 5 additions & 8 deletions docs/content/deprecation/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,19 @@ This page is maintained and updated periodically to reflect our roadmap and any

| Feature | Deprecated | End of Support | Removal |
|-------------------------------------------------------------|------------|----------------|---------|
| [Pilot Dashboard (Metrics)](#pilot-dashboard-metrics) | 2.7 | 2.8 | 3.0 |
| [Pilot Plugins](#pilot-plugins) | 2.7 | 2.8 | 3.0 |
| [Pilot](#pilot) | 2.7 | 2.8 | 2.9 |
| [Consul Enterprise Namespace](#consul-enterprise-namespace) | 2.8 | N/A | 3.0 |
| [TLS 1.0 and 1.1 Support](#tls-10-and-11) | N/A | 2.8 | N/A |

## Impact

### Pilot Dashboard (Metrics)
### Pilot

Metrics will continue to function normally up to 2.8, when they will be disabled.
In 3.0, the Pilot platform and all Traefik integration code will be permanently removed.
In 2.9, the Pilot platform and all Traefik integration code will be permanently removed.

### Pilot Plugins

Starting on 2.7 the pilot token will not be a requirement anymore.
Since 2.8, a [new plugin catalog](https://plugins.traefik.io) is available, decoupled from pilot.
Starting on 2.7 the pilot token will not be a requirement anymore for plugins.
Since 2.8, a [new plugin catalog](https://plugins.traefik.io) is available, decoupled from Pilot.

### Consul Enterprise Namespace

Expand Down
2 changes: 1 addition & 1 deletion docs/content/middlewares/http/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,6 @@ http:
## Community Middlewares
Please take a look at the community-contributed plugins in the [plugin catalog](https://pilot.traefik.io/plugins).
Please take a look at the community-contributed plugins in the [plugin catalog](https://plugins.traefik.io/plugins).
{!traefik-for-business-applications.md!}
6 changes: 6 additions & 0 deletions docs/content/migration/v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,3 +484,9 @@ Since `v2.5.0`, the `PreferServerCipherSuites` is [deprecated and ignored](https
in `v2.8.2` the `preferServerCipherSuites` option is also deprecated and ignored in Traefik.

In `v2.8.2`, Traefik now reject certificates signed with the SHA-1 hash function. ([details](https://tip.golang.org/doc/go1.18#sha1))

## v2.9

### Traefik Pilot

In `v2.9`, Traefik Pilot support has been removed.
6 changes: 0 additions & 6 deletions docs/content/reference/static-configuration/cli-ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,6 @@ Prefix to use for metrics collection. (Default: ```traefik```)
`--metrics.statsd.pushinterval`:
StatsD push interval. (Default: ```10```)

`--pilot.dashboard`:
Enable Traefik Pilot in the dashboard. (Default: ```true```)

`--pilot.token`:
Traefik Pilot token.

`--ping`:
Enable ping. (Default: ```false```)

Expand Down
6 changes: 0 additions & 6 deletions docs/content/reference/static-configuration/env-ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,6 @@ Prefix to use for metrics collection. (Default: ```traefik```)
`TRAEFIK_METRICS_STATSD_PUSHINTERVAL`:
StatsD push interval. (Default: ```10```)

`TRAEFIK_PILOT_DASHBOARD`:
Enable Traefik Pilot in the dashboard. (Default: ```true```)

`TRAEFIK_PILOT_TOKEN`:
Traefik Pilot token.

`TRAEFIK_PING`:
Enable ping. (Default: ```false```)

Expand Down
4 changes: 0 additions & 4 deletions docs/content/reference/static-configuration/file.toml
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,6 @@
entryPoint = "foobar"
[certificatesResolvers.CertificateResolver1.acme.tlsChallenge]

[pilot]
token = "foobar"
dashboard = true

[hub]
[hub.tls]
insecure = true
Expand Down
3 changes: 0 additions & 3 deletions docs/content/reference/static-configuration/file.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,6 @@ certificatesResolvers:
httpChallenge:
entryPoint: foobar
tlsChallenge: {}
pilot:
token: foobar
dashboard: true
hub:
tls:
insecure: true
Expand Down
4 changes: 4 additions & 0 deletions internal/gendoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ THIS FILE MUST NOT BE EDITED BY HAND
continue
}

if strings.HasPrefix(flat.Name, "pilot.") || strings.HasPrefix(flat.Name, "TRAEFIK_PILOT_") {
continue
}

if prefix == "" {
w.writeln("`" + prefix + strings.ReplaceAll(flat.Name, "[0]", "_n") + "`: ")
} else {
Expand Down
9 changes: 2 additions & 7 deletions pkg/config/static/pilot.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ package static
// Pilot Configuration related to Traefik Pilot.
// Deprecated.
type Pilot struct {
Token string `description:"Traefik Pilot token." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" loggable:"false"`
Dashboard bool `description:"Enable Traefik Pilot in the dashboard." json:"dashboard,omitempty" toml:"dashboard,omitempty" yaml:"dashboard,omitempty"`
}

// SetDefaults sets the default values.
func (p *Pilot) SetDefaults() {
p.Dashboard = true
Token string `description:"Traefik Pilot token. (Deprecated)" json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" loggable:"false"`
Dashboard bool `description:"Enable Traefik Pilot in the dashboard. (Deprecated)" json:"dashboard,omitempty" toml:"dashboard,omitempty" yaml:"dashboard,omitempty"`
}
10 changes: 2 additions & 8 deletions pkg/config/static/static_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type Configuration struct {
CertificatesResolvers map[string]CertificateResolver `description:"Certificates resolvers configuration." json:"certificatesResolvers,omitempty" toml:"certificatesResolvers,omitempty" yaml:"certificatesResolvers,omitempty" export:"true"`

// Deprecated.
Pilot *Pilot `description:"Traefik Pilot configuration." json:"pilot,omitempty" toml:"pilot,omitempty" yaml:"pilot,omitempty" export:"true"`
Pilot *Pilot `description:"Traefik Pilot configuration (Deprecated)." json:"pilot,omitempty" toml:"pilot,omitempty" yaml:"pilot,omitempty" export:"true"`

Hub *hub.Provider `description:"Traefik Hub configuration." json:"hub,omitempty" toml:"hub,omitempty" yaml:"hub,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"`

Expand Down Expand Up @@ -250,16 +250,10 @@ func (c *Configuration) SetEffectiveConfiguration() {
}

// Enable anonymous usage when pilot is enabled.
if c.Pilot != nil && c.Pilot.Token != "" {
if c.Pilot != nil {
c.Global.SendAnonymousUsage = true
}

// Create Pilot struct to apply default value on undefined configuration.
if c.Pilot == nil {
c.Pilot = &Pilot{}
c.Pilot.SetDefaults()
}

// Disable Gateway API provider if not enabled in experimental.
if c.Experimental == nil || !c.Experimental.KubernetesGateway {
c.Providers.KubernetesGateway = nil
Expand Down
Loading

0 comments on commit ab8d7d2

Please sign in to comment.