Remove Pilot support
This commit is contained in:
parent
a002ccfce3
commit
ab8d7d2e78
23 changed files with 35 additions and 1264 deletions
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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() {
|
||||
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue