traefik_plugin_rawdata

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

README

Traefik Plugin Rawdata

Traefik Provider plugin to import /api/rawdata from another Traefik instance.

Highly experimental, you might use this as a stopgap solution while migrating services for example. But in production I would avoiding using this plugin as a permanent solution.

Usecase

Traefik's built-in provider configuration has some limits.

For example, https://github.com/traefik/traefik/issues/6063 while Docker Swarm and Docker as-is are supported. You can't specify them both. Nor can you use multiple HTTP endpoints https://doc.traefik.io/traefik/providers/http/#endpoint.

This plugin offers a poor man workaround, where you add another Traefik instance purely for discovery and import this to your main Traefik instance.

Gotchas

This plugin does not attempt to rewrite service IP's, networking information, or anything like hat. So whatever your secondary Traefik instance discovers, needs to be accessible by your primary Traefik instance in the same way.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PollInterval   string `json:"pollInterval,omitempty"`
	Endpoint       string `json:"endpoint,omitempty"`
	Namespace      string `json:"namespace,omitempty"`
	StripNamespace bool   `json:"stripNamespace,omitempty"`
}

Config the plugin configuration.

func CreateConfig

func CreateConfig() *Config

CreateConfig creates the default plugin configuration.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider a simple provider plugin.

func New

func New(ctx context.Context, config *Config, name string) (*Provider, error)

New creates a new Provider plugin.

func (*Provider) Init

func (p *Provider) Init() error

Init the provider.

func (*Provider) Provide

func (p *Provider) Provide(cfgChan chan<- json.Marshaler) error

Provide creates and send dynamic configuration.

func (*Provider) Stop

func (p *Provider) Stop() error

Stop to stop the provider and the related go routines.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL