1
0
Fork 0

Merge branch v2.10 into v3.0

This commit is contained in:
Fernandez Ludovic 2023-03-21 12:00:46 +01:00
commit 7875826bd9
387 changed files with 19080 additions and 976 deletions

View file

@ -20,6 +20,8 @@ import (
const collectorURL = "https://collect.traefik.io/9vxmmkcdmalbdi635d4jgc5p5rx0h7h8"
// Collected data.
//
//nolint:musttag // cannot be changed for historical reasons.
type data struct {
Version string
Codename string

View file

@ -141,6 +141,7 @@
sampleRate = 42.0
[tracing.datadog]
localAgentHostPort = "foobar"
localAgentSocket = "foobar"
debug = true
prioritySampling = true
traceIDHeaderName = "foobar"

View file

@ -8,5 +8,6 @@ type Experimental struct {
LocalPlugins map[string]plugins.LocalDescriptor `description:"Local plugins configuration." json:"localPlugins,omitempty" toml:"localPlugins,omitempty" yaml:"localPlugins,omitempty" export:"true"`
KubernetesGateway bool `description:"Allow the Kubernetes gateway api provider usage." json:"kubernetesGateway,omitempty" toml:"kubernetesGateway,omitempty" yaml:"kubernetesGateway,omitempty" export:"true"`
Hub bool `description:"Enable the Traefik Hub provider." json:"hub,omitempty" toml:"hub,omitempty" yaml:"hub,omitempty" export:"true"`
// Deprecated.
Hub bool `description:"Enable the Traefik Hub provider." json:"hub,omitempty" toml:"hub,omitempty" yaml:"hub,omitempty" export:"true"`
}

View file

@ -9,9 +9,8 @@ import (
)
func (c *Configuration) initHubProvider() error {
// Hub provider is an experimental feature. It requires the experimental flag to be enabled before continuing.
if c.Experimental == nil || !c.Experimental.Hub {
return errors.New("the experimental flag for Hub is not set")
if c.Experimental != nil && c.Experimental.Hub {
log.Warn().Msg("Experimental flag for Traefik Hub is deprecated, because Traefik Hub is now GA.")
}
if _, ok := c.EntryPoints[hub.TunnelEntrypoint]; !ok {

View file

@ -260,7 +260,7 @@ func (c *Configuration) SetEffectiveConfiguration() {
c.Hub = nil
log.Error().Err(err).Msg("Unable to activate the Hub provider")
} else {
log.Debug().Msg("Experimental Hub provider has been activated")
log.Debug().Msg("Hub provider has been activated")
}
}

View file

@ -68,7 +68,7 @@ func RegisterDatadog(ctx context.Context, config *types.Datadog) Registry {
if config.AddEntryPointsLabels {
registry.epEnabled = config.AddEntryPointsLabels
registry.entryPointReqsCounter = datadogClient.NewCounter(ddEntryPointReqsName, 1.0)
registry.entryPointReqsCounter = NewCounterWithNoopHeaders(datadogClient.NewCounter(ddEntryPointReqsName, 1.0))
registry.entryPointReqsTLSCounter = datadogClient.NewCounter(ddEntryPointReqsTLSName, 1.0)
registry.entryPointReqDurationHistogram, _ = NewHistogramWithScale(datadogClient.NewHistogram(ddEntryPointReqDurationName, 1.0), time.Second)
registry.entryPointReqsBytesCounter = datadogClient.NewCounter(ddEntryPointReqsBytesName, 1.0)
@ -77,7 +77,7 @@ func RegisterDatadog(ctx context.Context, config *types.Datadog) Registry {
if config.AddRoutersLabels {
registry.routerEnabled = config.AddRoutersLabels
registry.routerReqsCounter = datadogClient.NewCounter(ddRouterReqsName, 1.0)
registry.routerReqsCounter = NewCounterWithNoopHeaders(datadogClient.NewCounter(ddRouterReqsName, 1.0))
registry.routerReqsTLSCounter = datadogClient.NewCounter(ddRouterReqsTLSName, 1.0)
registry.routerReqDurationHistogram, _ = NewHistogramWithScale(datadogClient.NewHistogram(ddRouterReqsDurationName, 1.0), time.Second)
registry.routerReqsBytesCounter = datadogClient.NewCounter(ddRouterReqsBytesName, 1.0)
@ -86,7 +86,7 @@ func RegisterDatadog(ctx context.Context, config *types.Datadog) Registry {
if config.AddServicesLabels {
registry.svcEnabled = config.AddServicesLabels
registry.serviceReqsCounter = datadogClient.NewCounter(ddServiceReqsName, 1.0)
registry.serviceReqsCounter = NewCounterWithNoopHeaders(datadogClient.NewCounter(ddServiceReqsName, 1.0))
registry.serviceReqsTLSCounter = datadogClient.NewCounter(ddServiceReqsTLSName, 1.0)
registry.serviceReqDurationHistogram, _ = NewHistogramWithScale(datadogClient.NewHistogram(ddServiceReqsDurationName, 1.0), time.Second)
registry.serviceRetriesCounter = datadogClient.NewCounter(ddServiceRetriesName, 1.0)

View file

@ -81,21 +81,21 @@ func testDatadogRegistry(t *testing.T, metricsPrefix string, datadogRegistry Reg
datadogRegistry.TLSCertsNotAfterTimestampGauge().With("key", "value").Set(1)
datadogRegistry.EntryPointReqsCounter().With("entrypoint", "test").Add(1)
datadogRegistry.EntryPointReqsCounter().With(nil, "entrypoint", "test").Add(1)
datadogRegistry.EntryPointReqsTLSCounter().With("entrypoint", "test", "tls_version", "foo", "tls_cipher", "bar").Add(1)
datadogRegistry.EntryPointReqDurationHistogram().With("entrypoint", "test").Observe(10000)
datadogRegistry.EntryPointReqsBytesCounter().With("entrypoint", "test").Add(1)
datadogRegistry.EntryPointRespsBytesCounter().With("entrypoint", "test").Add(1)
datadogRegistry.RouterReqsCounter().With("router", "demo", "service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
datadogRegistry.RouterReqsCounter().With("router", "demo", "service", "test", "code", strconv.Itoa(http.StatusNotFound), "method", http.MethodGet).Add(1)
datadogRegistry.RouterReqsCounter().With(nil, "router", "demo", "service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
datadogRegistry.RouterReqsCounter().With(nil, "router", "demo", "service", "test", "code", strconv.Itoa(http.StatusNotFound), "method", http.MethodGet).Add(1)
datadogRegistry.RouterReqsTLSCounter().With("router", "demo", "service", "test", "tls_version", "foo", "tls_cipher", "bar").Add(1)
datadogRegistry.RouterReqDurationHistogram().With("router", "demo", "service", "test", "code", strconv.Itoa(http.StatusOK)).Observe(10000)
datadogRegistry.RouterReqsBytesCounter().With("router", "demo", "service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
datadogRegistry.RouterRespsBytesCounter().With("router", "demo", "service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
datadogRegistry.ServiceReqsCounter().With("service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
datadogRegistry.ServiceReqsCounter().With("service", "test", "code", strconv.Itoa(http.StatusNotFound), "method", http.MethodGet).Add(1)
datadogRegistry.ServiceReqsCounter().With(nil, "service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
datadogRegistry.ServiceReqsCounter().With(nil, "service", "test", "code", strconv.Itoa(http.StatusNotFound), "method", http.MethodGet).Add(1)
datadogRegistry.ServiceReqsTLSCounter().With("service", "test", "tls_version", "foo", "tls_cipher", "bar").Add(1)
datadogRegistry.ServiceReqDurationHistogram().With("service", "test", "code", strconv.Itoa(http.StatusOK)).Observe(10000)
datadogRegistry.ServiceRetriesCounter().With("service", "test").Add(1)

57
pkg/metrics/headers.go Normal file
View file

@ -0,0 +1,57 @@
package metrics
import (
"net/http"
"github.com/go-kit/kit/metrics"
)
// CounterWithHeaders represents a counter that can use http.Header values as label values.
type CounterWithHeaders interface {
Add(delta float64)
With(headers http.Header, labelValues ...string) CounterWithHeaders
}
// MultiCounterWithHeaders collects multiple individual CounterWithHeaders and treats them as a unit.
type MultiCounterWithHeaders []CounterWithHeaders
// NewMultiCounterWithHeaders returns a multi-counter, wrapping the passed CounterWithHeaders.
func NewMultiCounterWithHeaders(c ...CounterWithHeaders) MultiCounterWithHeaders {
return c
}
// Add adds the given delta value to the counter value.
func (c MultiCounterWithHeaders) Add(delta float64) {
for _, counter := range c {
counter.Add(delta)
}
}
// With creates a new counter by appending the given label values and http.Header as labels and returns it.
func (c MultiCounterWithHeaders) With(headers http.Header, labelValues ...string) CounterWithHeaders {
next := make(MultiCounterWithHeaders, len(c))
for i := range c {
next[i] = c[i].With(headers, labelValues...)
}
return next
}
// NewCounterWithNoopHeaders returns a CounterWithNoopHeaders.
func NewCounterWithNoopHeaders(counter metrics.Counter) CounterWithNoopHeaders {
return CounterWithNoopHeaders{counter: counter}
}
// CounterWithNoopHeaders is a counter that satisfies CounterWithHeaders but ignores the given http.Header.
type CounterWithNoopHeaders struct {
counter metrics.Counter
}
// Add adds the given delta value to the counter value.
func (c CounterWithNoopHeaders) Add(delta float64) {
c.counter.Add(delta)
}
// With creates a new counter by appending the given label values and returns it.
func (c CounterWithNoopHeaders) With(_ http.Header, labelValues ...string) CounterWithHeaders {
return NewCounterWithNoopHeaders(c.counter.With(labelValues...))
}

View file

@ -87,7 +87,7 @@ func RegisterInfluxDB2(ctx context.Context, config *types.InfluxDB2) Registry {
if config.AddEntryPointsLabels {
registry.epEnabled = config.AddEntryPointsLabels
registry.entryPointReqsCounter = influxDB2Store.NewCounter(influxDBEntryPointReqsName)
registry.entryPointReqsCounter = NewCounterWithNoopHeaders(influxDB2Store.NewCounter(influxDBEntryPointReqsName))
registry.entryPointReqsTLSCounter = influxDB2Store.NewCounter(influxDBEntryPointReqsTLSName)
registry.entryPointReqDurationHistogram, _ = NewHistogramWithScale(influxDB2Store.NewHistogram(influxDBEntryPointReqDurationName), time.Second)
registry.entryPointReqsBytesCounter = influxDB2Store.NewCounter(influxDBEntryPointReqsBytesName)
@ -96,7 +96,7 @@ func RegisterInfluxDB2(ctx context.Context, config *types.InfluxDB2) Registry {
if config.AddRoutersLabels {
registry.routerEnabled = config.AddRoutersLabels
registry.routerReqsCounter = influxDB2Store.NewCounter(influxDBRouterReqsName)
registry.routerReqsCounter = NewCounterWithNoopHeaders(influxDB2Store.NewCounter(influxDBRouterReqsName))
registry.routerReqsTLSCounter = influxDB2Store.NewCounter(influxDBRouterReqsTLSName)
registry.routerReqDurationHistogram, _ = NewHistogramWithScale(influxDB2Store.NewHistogram(influxDBRouterReqsDurationName), time.Second)
registry.routerReqsBytesCounter = influxDB2Store.NewCounter(influxDBRouterReqsBytesName)
@ -105,7 +105,7 @@ func RegisterInfluxDB2(ctx context.Context, config *types.InfluxDB2) Registry {
if config.AddServicesLabels {
registry.svcEnabled = config.AddServicesLabels
registry.serviceReqsCounter = influxDB2Store.NewCounter(influxDBServiceReqsName)
registry.serviceReqsCounter = NewCounterWithNoopHeaders(influxDB2Store.NewCounter(influxDBServiceReqsName))
registry.serviceReqsTLSCounter = influxDB2Store.NewCounter(influxDBServiceReqsTLSName)
registry.serviceReqDurationHistogram, _ = NewHistogramWithScale(influxDB2Store.NewHistogram(influxDBServiceReqsDurationName), time.Second)
registry.serviceRetriesCounter = influxDB2Store.NewCounter(influxDBServiceRetriesTotalName)

View file

@ -75,7 +75,7 @@ func TestInfluxDB2(t *testing.T) {
`(traefik\.entrypoint\.responses\.bytes\.total,code=200,entrypoint=test,method=GET count=1) [\d]{19}`,
}
influxDB2Registry.EntryPointReqsCounter().With("entrypoint", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
influxDB2Registry.EntryPointReqsCounter().With(nil, "entrypoint", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
influxDB2Registry.EntryPointReqsTLSCounter().With("entrypoint", "test", "tls_version", "foo", "tls_cipher", "bar").Add(1)
influxDB2Registry.EntryPointReqDurationHistogram().With("entrypoint", "test").Observe(10000)
influxDB2Registry.EntryPointReqsBytesCounter().With("entrypoint", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
@ -93,8 +93,8 @@ func TestInfluxDB2(t *testing.T) {
`(traefik\.router\.responses\.bytes\.total,code=200,method=GET,router=demo,service=test count=1) [\d]{19}`,
}
influxDB2Registry.RouterReqsCounter().With("router", "demo", "service", "test", "code", strconv.Itoa(http.StatusNotFound), "method", http.MethodGet).Add(1)
influxDB2Registry.RouterReqsCounter().With("router", "demo", "service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
influxDB2Registry.RouterReqsCounter().With(nil, "router", "demo", "service", "test", "code", strconv.Itoa(http.StatusNotFound), "method", http.MethodGet).Add(1)
influxDB2Registry.RouterReqsCounter().With(nil, "router", "demo", "service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
influxDB2Registry.RouterReqsTLSCounter().With("router", "demo", "service", "test", "tls_version", "foo", "tls_cipher", "bar").Add(1)
influxDB2Registry.RouterReqDurationHistogram().With("router", "demo", "service", "test", "code", strconv.Itoa(http.StatusOK)).Observe(10000)
influxDB2Registry.RouterReqsBytesCounter().With("router", "demo", "service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
@ -113,8 +113,8 @@ func TestInfluxDB2(t *testing.T) {
`(traefik\.service\.responses\.bytes\.total,code=200,method=GET,service=test count=1) [\d]{19}`,
}
influxDB2Registry.ServiceReqsCounter().With("service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
influxDB2Registry.ServiceReqsCounter().With("service", "test", "code", strconv.Itoa(http.StatusNotFound), "method", http.MethodGet).Add(1)
influxDB2Registry.ServiceReqsCounter().With(nil, "service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
influxDB2Registry.ServiceReqsCounter().With(nil, "service", "test", "code", strconv.Itoa(http.StatusNotFound), "method", http.MethodGet).Add(1)
influxDB2Registry.ServiceReqsTLSCounter().With("service", "test", "tls_version", "foo", "tls_cipher", "bar").Add(1)
influxDB2Registry.ServiceReqDurationHistogram().With("service", "test", "code", strconv.Itoa(http.StatusOK)).Observe(10000)
influxDB2Registry.ServiceServerUpGauge().With("service", "test", "url", "http://127.0.0.1").Set(1)

View file

@ -31,7 +31,7 @@ type Registry interface {
// entry point metrics
EntryPointReqsCounter() metrics.Counter
EntryPointReqsCounter() CounterWithHeaders
EntryPointReqsTLSCounter() metrics.Counter
EntryPointReqDurationHistogram() ScalableHistogram
EntryPointReqsBytesCounter() metrics.Counter
@ -39,7 +39,7 @@ type Registry interface {
// router metrics
RouterReqsCounter() metrics.Counter
RouterReqsCounter() CounterWithHeaders
RouterReqsTLSCounter() metrics.Counter
RouterReqDurationHistogram() ScalableHistogram
RouterReqsBytesCounter() metrics.Counter
@ -47,7 +47,7 @@ type Registry interface {
// service metrics
ServiceReqsCounter() metrics.Counter
ServiceReqsCounter() CounterWithHeaders
ServiceReqsTLSCounter() metrics.Counter
ServiceReqDurationHistogram() ScalableHistogram
ServiceRetriesCounter() metrics.Counter
@ -70,17 +70,17 @@ func NewMultiRegistry(registries []Registry) Registry {
var lastConfigReloadSuccessGauge []metrics.Gauge
var openConnectionsGauge []metrics.Gauge
var tlsCertsNotAfterTimestampGauge []metrics.Gauge
var entryPointReqsCounter []metrics.Counter
var entryPointReqsCounter []CounterWithHeaders
var entryPointReqsTLSCounter []metrics.Counter
var entryPointReqDurationHistogram []ScalableHistogram
var entryPointReqsBytesCounter []metrics.Counter
var entryPointRespsBytesCounter []metrics.Counter
var routerReqsCounter []metrics.Counter
var routerReqsCounter []CounterWithHeaders
var routerReqsTLSCounter []metrics.Counter
var routerReqDurationHistogram []ScalableHistogram
var routerReqsBytesCounter []metrics.Counter
var routerRespsBytesCounter []metrics.Counter
var serviceReqsCounter []metrics.Counter
var serviceReqsCounter []CounterWithHeaders
var serviceReqsTLSCounter []metrics.Counter
var serviceReqDurationHistogram []ScalableHistogram
var serviceRetriesCounter []metrics.Counter
@ -162,17 +162,17 @@ func NewMultiRegistry(registries []Registry) Registry {
lastConfigReloadSuccessGauge: multi.NewGauge(lastConfigReloadSuccessGauge...),
openConnectionsGauge: multi.NewGauge(openConnectionsGauge...),
tlsCertsNotAfterTimestampGauge: multi.NewGauge(tlsCertsNotAfterTimestampGauge...),
entryPointReqsCounter: multi.NewCounter(entryPointReqsCounter...),
entryPointReqsCounter: NewMultiCounterWithHeaders(entryPointReqsCounter...),
entryPointReqsTLSCounter: multi.NewCounter(entryPointReqsTLSCounter...),
entryPointReqDurationHistogram: MultiHistogram(entryPointReqDurationHistogram),
entryPointReqsBytesCounter: multi.NewCounter(entryPointReqsBytesCounter...),
entryPointRespsBytesCounter: multi.NewCounter(entryPointRespsBytesCounter...),
routerReqsCounter: multi.NewCounter(routerReqsCounter...),
routerReqsCounter: NewMultiCounterWithHeaders(routerReqsCounter...),
routerReqsTLSCounter: multi.NewCounter(routerReqsTLSCounter...),
routerReqDurationHistogram: MultiHistogram(routerReqDurationHistogram),
routerReqsBytesCounter: multi.NewCounter(routerReqsBytesCounter...),
routerRespsBytesCounter: multi.NewCounter(routerRespsBytesCounter...),
serviceReqsCounter: multi.NewCounter(serviceReqsCounter...),
serviceReqsCounter: NewMultiCounterWithHeaders(serviceReqsCounter...),
serviceReqsTLSCounter: multi.NewCounter(serviceReqsTLSCounter...),
serviceReqDurationHistogram: MultiHistogram(serviceReqDurationHistogram),
serviceRetriesCounter: multi.NewCounter(serviceRetriesCounter...),
@ -190,17 +190,17 @@ type standardRegistry struct {
lastConfigReloadSuccessGauge metrics.Gauge
openConnectionsGauge metrics.Gauge
tlsCertsNotAfterTimestampGauge metrics.Gauge
entryPointReqsCounter metrics.Counter
entryPointReqsCounter CounterWithHeaders
entryPointReqsTLSCounter metrics.Counter
entryPointReqDurationHistogram ScalableHistogram
entryPointReqsBytesCounter metrics.Counter
entryPointRespsBytesCounter metrics.Counter
routerReqsCounter metrics.Counter
routerReqsCounter CounterWithHeaders
routerReqsTLSCounter metrics.Counter
routerReqDurationHistogram ScalableHistogram
routerReqsBytesCounter metrics.Counter
routerRespsBytesCounter metrics.Counter
serviceReqsCounter metrics.Counter
serviceReqsCounter CounterWithHeaders
serviceReqsTLSCounter metrics.Counter
serviceReqDurationHistogram ScalableHistogram
serviceRetriesCounter metrics.Counter
@ -237,7 +237,7 @@ func (r *standardRegistry) TLSCertsNotAfterTimestampGauge() metrics.Gauge {
return r.tlsCertsNotAfterTimestampGauge
}
func (r *standardRegistry) EntryPointReqsCounter() metrics.Counter {
func (r *standardRegistry) EntryPointReqsCounter() CounterWithHeaders {
return r.entryPointReqsCounter
}
@ -257,7 +257,7 @@ func (r *standardRegistry) EntryPointRespsBytesCounter() metrics.Counter {
return r.entryPointRespsBytesCounter
}
func (r *standardRegistry) RouterReqsCounter() metrics.Counter {
func (r *standardRegistry) RouterReqsCounter() CounterWithHeaders {
return r.routerReqsCounter
}
@ -277,7 +277,7 @@ func (r *standardRegistry) RouterRespsBytesCounter() metrics.Counter {
return r.routerRespsBytesCounter
}
func (r *standardRegistry) ServiceReqsCounter() metrics.Counter {
func (r *standardRegistry) ServiceReqsCounter() CounterWithHeaders {
return r.serviceReqsCounter
}

View file

@ -2,6 +2,7 @@ package metrics
import (
"bytes"
"net/http"
"strings"
"testing"
"time"
@ -37,12 +38,12 @@ func TestNewMultiRegistry(t *testing.T) {
registries := []Registry{newCollectingRetryMetrics(), newCollectingRetryMetrics()}
registry := NewMultiRegistry(registries)
registry.ServiceReqsCounter().With("key", "requests").Add(1)
registry.ServiceReqsCounter().With(nil, "key", "requests").Add(1)
registry.ServiceReqDurationHistogram().With("key", "durations").Observe(float64(2))
registry.ServiceRetriesCounter().With("key", "retries").Add(3)
for _, collectingRegistry := range registries {
cReqsCounter := collectingRegistry.ServiceReqsCounter().(*counterMock)
cReqsCounter := collectingRegistry.ServiceReqsCounter().(*counterWithHeadersMock)
cReqDurationHistogram := collectingRegistry.ServiceReqDurationHistogram().(*histogramMock)
cRetriesCounter := collectingRegistry.ServiceRetriesCounter().(*counterMock)
@ -67,7 +68,7 @@ func TestNewMultiRegistry(t *testing.T) {
func newCollectingRetryMetrics() Registry {
return &standardRegistry{
serviceReqsCounter: &counterMock{},
serviceReqsCounter: &counterWithHeadersMock{},
serviceReqDurationHistogram: &histogramMock{},
serviceRetriesCounter: &counterMock{},
}
@ -87,6 +88,20 @@ func (c *counterMock) Add(delta float64) {
c.counterValue += delta
}
type counterWithHeadersMock struct {
counterValue float64
lastLabelValues []string
}
func (c *counterWithHeadersMock) With(_ http.Header, labelValues ...string) CounterWithHeaders {
c.lastLabelValues = labelValues
return c
}
func (c *counterWithHeadersMock) Add(delta float64) {
c.counterValue += delta
}
type histogramMock struct {
lastHistogramValue float64
lastLabelValues []string

View file

@ -63,8 +63,8 @@ func RegisterOpenTelemetry(ctx context.Context, config *types.OpenTelemetry) Reg
}
if config.AddEntryPointsLabels {
reg.entryPointReqsCounter = newOTLPCounterFrom(meter, entryPointReqsTotalName,
"How many HTTP requests processed on an entrypoint, partitioned by status code, protocol, and method.")
reg.entryPointReqsCounter = NewCounterWithNoopHeaders(newOTLPCounterFrom(meter, entryPointReqsTotalName,
"How many HTTP requests processed on an entrypoint, partitioned by status code, protocol, and method."))
reg.entryPointReqsTLSCounter = newOTLPCounterFrom(meter, entryPointReqsTLSTotalName,
"How many HTTP requests with TLS processed on an entrypoint, partitioned by TLS Version and TLS cipher Used.")
reg.entryPointReqDurationHistogram, _ = NewHistogramWithScale(newOTLPHistogramFrom(meter, entryPointReqDurationName,
@ -73,8 +73,8 @@ func RegisterOpenTelemetry(ctx context.Context, config *types.OpenTelemetry) Reg
}
if config.AddRoutersLabels {
reg.routerReqsCounter = newOTLPCounterFrom(meter, routerReqsTotalName,
"How many HTTP requests are processed on a router, partitioned by service, status code, protocol, and method.")
reg.routerReqsCounter = NewCounterWithNoopHeaders(newOTLPCounterFrom(meter, routerReqsTotalName,
"How many HTTP requests are processed on a router, partitioned by service, status code, protocol, and method."))
reg.routerReqsTLSCounter = newOTLPCounterFrom(meter, routerReqsTLSTotalName,
"How many HTTP requests with TLS are processed on a router, partitioned by service, TLS Version, and TLS cipher Used.")
reg.routerReqDurationHistogram, _ = NewHistogramWithScale(newOTLPHistogramFrom(meter, routerReqDurationName,
@ -83,8 +83,8 @@ func RegisterOpenTelemetry(ctx context.Context, config *types.OpenTelemetry) Reg
}
if config.AddServicesLabels {
reg.serviceReqsCounter = newOTLPCounterFrom(meter, serviceReqsTotalName,
"How many HTTP requests processed on a service, partitioned by status code, protocol, and method.")
reg.serviceReqsCounter = NewCounterWithNoopHeaders(newOTLPCounterFrom(meter, serviceReqsTotalName,
"How many HTTP requests processed on a service, partitioned by status code, protocol, and method."))
reg.serviceReqsTLSCounter = newOTLPCounterFrom(meter, serviceReqsTLSTotalName,
"How many HTTP requests with TLS processed on a service, partitioned by TLS version and TLS cipher.")
reg.serviceReqDurationHistogram, _ = NewHistogramWithScale(newOTLPHistogramFrom(meter, serviceReqDurationName,

View file

@ -366,7 +366,7 @@ func TestOpenTelemetry(t *testing.T) {
`({"name":"traefik_entrypoint_request_duration_seconds","description":"How long it took to process the request on an entrypoint, partitioned by status code, protocol, and method.","unit":"ms","histogram":{"dataPoints":\[{"attributes":\[{"key":"entrypoint","value":{"stringValue":"test3"}}\],"startTimeUnixNano":"[\d]{19}","timeUnixNano":"[\d]{19}","count":"1","sum":10000,"bucketCounts":\["0","0","0","0","0","0","0","0","0","0","0","1"\],"explicitBounds":\[0.005,0.01,0.025,0.05,0.1,0.25,0.5,1,2.5,5,10\],"min":10000,"max":10000}\],"aggregationTemporality":2}})`,
)
registry.EntryPointReqsCounter().With("entrypoint", "test1", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
registry.EntryPointReqsCounter().With(nil, "entrypoint", "test1", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
registry.EntryPointReqsTLSCounter().With("entrypoint", "test2", "tls_version", "foo", "tls_cipher", "bar").Add(1)
registry.EntryPointReqDurationHistogram().With("entrypoint", "test3").Observe(10000)
msgEntrypoint := <-c
@ -379,8 +379,8 @@ func TestOpenTelemetry(t *testing.T) {
`({"name":"traefik_router_request_duration_seconds","description":"How long it took to process the request on a router, partitioned by service, status code, protocol, and method.","unit":"ms","histogram":{"dataPoints":\[{"attributes":\[{"key":"code","value":{"stringValue":"200"}},{"key":"router","value":{"stringValue":"demo"}},{"key":"service","value":{"stringValue":"test"}}\],"startTimeUnixNano":"[\d]{19}","timeUnixNano":"[\d]{19}","count":"1","sum":10000,"bucketCounts":\["0","0","0","0","0","0","0","0","0","0","0","1"\],"explicitBounds":\[0.005,0.01,0.025,0.05,0.1,0.25,0.5,1,2.5,5,10\],"min":10000,"max":10000}\],"aggregationTemporality":2}})`,
)
registry.RouterReqsCounter().With("router", "RouterReqsCounter", "service", "test", "code", strconv.Itoa(http.StatusNotFound), "method", http.MethodGet).Add(1)
registry.RouterReqsCounter().With("router", "RouterReqsCounter", "service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
registry.RouterReqsCounter().With(nil, "router", "RouterReqsCounter", "service", "test", "code", strconv.Itoa(http.StatusNotFound), "method", http.MethodGet).Add(1)
registry.RouterReqsCounter().With(nil, "router", "RouterReqsCounter", "service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
registry.RouterReqsTLSCounter().With("router", "demo", "service", "test", "tls_version", "foo", "tls_cipher", "bar").Add(1)
registry.RouterReqDurationHistogram().With("router", "demo", "service", "test", "code", strconv.Itoa(http.StatusOK)).Observe(10000)
msgRouter := <-c
@ -394,8 +394,8 @@ func TestOpenTelemetry(t *testing.T) {
`({"name":"traefik_service_server_up","description":"service server is up, described by gauge value of 0 or 1.","unit":"1","gauge":{"dataPoints":\[{"attributes":\[{"key":"service","value":{"stringValue":"test"}},{"key":"url","value":{"stringValue":"http://127.0.0.1"}}\],"startTimeUnixNano":"[\d]{20}","timeUnixNano":"[\d]{19}","asDouble":1}\]}})`,
)
registry.ServiceReqsCounter().With("service", "ServiceReqsCounter", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
registry.ServiceReqsCounter().With("service", "ServiceReqsCounter", "code", strconv.Itoa(http.StatusNotFound), "method", http.MethodGet).Add(1)
registry.ServiceReqsCounter().With(nil, "service", "ServiceReqsCounter", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
registry.ServiceReqsCounter().With(nil, "service", "ServiceReqsCounter", "code", strconv.Itoa(http.StatusNotFound), "method", http.MethodGet).Add(1)
registry.ServiceReqsTLSCounter().With("service", "test", "tls_version", "foo", "tls_cipher", "bar").Add(1)
registry.ServiceReqDurationHistogram().With("service", "test", "code", strconv.Itoa(http.StatusOK)).Observe(10000)
registry.ServiceServerUpGauge().With("service", "test", "url", "http://127.0.0.1").Set(1)

View file

@ -145,10 +145,10 @@ func initStandardRegistry(config *types.Prometheus) Registry {
}
if config.AddEntryPointsLabels {
entryPointReqs := newCounterFrom(stdprometheus.CounterOpts{
entryPointReqs := newCounterWithHeadersFrom(stdprometheus.CounterOpts{
Name: entryPointReqsTotalName,
Help: "How many HTTP requests processed on an entrypoint, partitioned by status code, protocol, and method.",
}, []string{"code", "method", "protocol", "entrypoint"})
}, config.HeaderLabels, []string{"code", "method", "protocol", "entrypoint"})
entryPointReqsTLS := newCounterFrom(stdprometheus.CounterOpts{
Name: entryPointReqsTLSTotalName,
Help: "How many HTTP requests with TLS processed on an entrypoint, partitioned by TLS Version and TLS cipher Used.",
@ -183,10 +183,10 @@ func initStandardRegistry(config *types.Prometheus) Registry {
}
if config.AddRoutersLabels {
routerReqs := newCounterFrom(stdprometheus.CounterOpts{
routerReqs := newCounterWithHeadersFrom(stdprometheus.CounterOpts{
Name: routerReqsTotalName,
Help: "How many HTTP requests are processed on a router, partitioned by service, status code, protocol, and method.",
}, []string{"code", "method", "protocol", "router", "service"})
}, config.HeaderLabels, []string{"code", "method", "protocol", "router", "service"})
routerReqsTLS := newCounterFrom(stdprometheus.CounterOpts{
Name: routerReqsTLSTotalName,
Help: "How many HTTP requests with TLS are processed on a router, partitioned by service, TLS Version, and TLS cipher Used.",
@ -220,10 +220,10 @@ func initStandardRegistry(config *types.Prometheus) Registry {
}
if config.AddServicesLabels {
serviceReqs := newCounterFrom(stdprometheus.CounterOpts{
serviceReqs := newCounterWithHeadersFrom(stdprometheus.CounterOpts{
Name: serviceReqsTotalName,
Help: "How many HTTP requests processed on a service, partitioned by status code, protocol, and method.",
}, []string{"code", "method", "protocol", "service"})
}, config.HeaderLabels, []string{"code", "method", "protocol", "service"})
serviceReqsTLS := newCounterFrom(stdprometheus.CounterOpts{
Name: serviceReqsTLSTotalName,
Help: "How many HTTP requests with TLS processed on a service, partitioned by TLS version and TLS cipher.",
@ -480,6 +480,55 @@ func (d *dynamicConfig) hasServerURL(serviceName, serverURL string) bool {
return false
}
func newCounterWithHeadersFrom(opts stdprometheus.CounterOpts, headers map[string]string, labelNames []string) *counterWithHeaders {
var headerLabels []string
for k := range headers {
headerLabels = append(headerLabels, k)
}
cv := stdprometheus.NewCounterVec(opts, append(labelNames, headerLabels...))
c := &counterWithHeaders{
name: opts.Name,
headers: headers,
cv: cv,
}
if len(labelNames) == 0 && len(headerLabels) == 0 {
c.collector = cv.WithLabelValues()
c.Add(0)
}
return c
}
type counterWithHeaders struct {
name string
cv *stdprometheus.CounterVec
labelNamesValues labelNamesValues
headers map[string]string
collector stdprometheus.Counter
}
func (c *counterWithHeaders) With(headers http.Header, labelValues ...string) CounterWithHeaders {
for headerLabel, headerKey := range c.headers {
labelValues = append(labelValues, headerLabel, headers.Get(headerKey))
}
lnv := c.labelNamesValues.With(labelValues...)
return &counterWithHeaders{
name: c.name,
headers: c.headers,
cv: c.cv,
labelNamesValues: lnv,
collector: c.cv.With(lnv.ToLabels()),
}
}
func (c *counterWithHeaders) Add(delta float64) {
c.collector.Add(delta)
}
func (c *counterWithHeaders) Describe(ch chan<- *stdprometheus.Desc) {
c.cv.Describe(ch)
}
func newCounterFrom(opts stdprometheus.CounterOpts, labelNames []string) *counter {
cv := stdprometheus.NewCounterVec(opts, labelNames)
c := &counter{

View file

@ -92,7 +92,12 @@ func TestPrometheus(t *testing.T) {
promRegistry = prometheus.NewRegistry()
t.Cleanup(promState.reset)
prometheusRegistry := RegisterPrometheus(context.Background(), &types.Prometheus{AddEntryPointsLabels: true, AddRoutersLabels: true, AddServicesLabels: true})
prometheusRegistry := RegisterPrometheus(context.Background(), &types.Prometheus{
AddEntryPointsLabels: true,
AddRoutersLabels: true,
AddServicesLabels: true,
HeaderLabels: map[string]string{"useragent": "User-Agent"},
})
defer promRegistry.Unregister(promState)
if !prometheusRegistry.IsEpEnabled() || !prometheusRegistry.IsRouterEnabled() || !prometheusRegistry.IsSvcEnabled() {
@ -113,7 +118,7 @@ func TestPrometheus(t *testing.T) {
prometheusRegistry.
EntryPointReqsCounter().
With("code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http", "entrypoint", "http").
With(map[string][]string{"User-Agent": {"foobar"}}, "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http", "entrypoint", "http").
Add(1)
prometheusRegistry.
EntryPointReqDurationHistogram().
@ -130,7 +135,7 @@ func TestPrometheus(t *testing.T) {
prometheusRegistry.
RouterReqsCounter().
With("router", "demo", "service", "service1", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http").
With(nil, "router", "demo", "service", "service1", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http").
Add(1)
prometheusRegistry.
RouterReqsTLSCounter().
@ -151,7 +156,7 @@ func TestPrometheus(t *testing.T) {
prometheusRegistry.
ServiceReqsCounter().
With("service", "service1", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http").
With(map[string][]string{"User-Agent": {"foobar"}}, "service", "service1", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http").
Add(1)
prometheusRegistry.
ServiceReqsTLSCounter().
@ -219,6 +224,7 @@ func TestPrometheus(t *testing.T) {
"method": http.MethodGet,
"protocol": "http",
"entrypoint": "http",
"useragent": "foobar",
},
assert: buildCounterAssert(t, entryPointReqsTotalName, 1),
},
@ -255,11 +261,12 @@ func TestPrometheus(t *testing.T) {
{
name: routerReqsTotalName,
labels: map[string]string{
"code": "200",
"method": http.MethodGet,
"protocol": "http",
"service": "service1",
"router": "demo",
"code": "200",
"method": http.MethodGet,
"protocol": "http",
"service": "service1",
"router": "demo",
"useragent": "",
},
assert: buildCounterAssert(t, routerReqsTotalName, 1),
},
@ -309,10 +316,11 @@ func TestPrometheus(t *testing.T) {
{
name: serviceReqsTotalName,
labels: map[string]string{
"code": "200",
"method": http.MethodGet,
"protocol": "http",
"service": "service1",
"code": "200",
"method": http.MethodGet,
"protocol": "http",
"service": "service1",
"useragent": "foobar",
},
assert: buildCounterAssert(t, serviceReqsTotalName, 1),
},
@ -438,15 +446,15 @@ func TestPrometheusMetricRemoval(t *testing.T) {
// should be removed after that scrape.
prometheusRegistry.
EntryPointReqsCounter().
With("entrypoint", "entrypoint2", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http").
With(nil, "entrypoint", "entrypoint2", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http").
Add(1)
prometheusRegistry.
RouterReqsCounter().
With("router", "router2", "service", "bar@providerName", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http").
With(nil, "router", "router2", "service", "bar@providerName", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http").
Add(1)
prometheusRegistry.
ServiceReqsCounter().
With("service", "service1", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http").
With(nil, "service", "service1", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http").
Add(1)
prometheusRegistry.
ServiceServerUpGauge().
@ -464,15 +472,15 @@ func TestPrometheusMetricRemoval(t *testing.T) {
// here the counter examples.
prometheusRegistry.
EntryPointReqsCounter().
With("entrypoint", "entrypoint1", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http").
With(nil, "entrypoint", "entrypoint1", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http").
Add(1)
prometheusRegistry.
RouterReqsCounter().
With("router", "foo@providerName", "service", "bar", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http").
With(nil, "router", "foo@providerName", "service", "bar", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http").
Add(1)
prometheusRegistry.
ServiceReqsCounter().
With("service", "bar@providerName", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http").
With(nil, "service", "bar@providerName", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet, "protocol", "http").
Add(1)
prometheusRegistry.
ServiceServerUpGauge().
@ -550,7 +558,7 @@ func TestPrometheusRemovedMetricsReset(t *testing.T) {
}
prometheusRegistry.
ServiceReqsCounter().
With(labelNamesValues...).
With(nil, labelNamesValues...).
Add(3)
delayForTrackingCompletion()
@ -564,7 +572,7 @@ func TestPrometheusRemovedMetricsReset(t *testing.T) {
prometheusRegistry.
ServiceReqsCounter().
With(labelNamesValues...).
With(nil, labelNamesValues...).
Add(1)
delayForTrackingCompletion()

View file

@ -66,7 +66,7 @@ func RegisterStatsd(ctx context.Context, config *types.Statsd) Registry {
if config.AddEntryPointsLabels {
registry.epEnabled = config.AddEntryPointsLabels
registry.entryPointReqsCounter = statsdClient.NewCounter(statsdEntryPointReqsName, 1.0)
registry.entryPointReqsCounter = NewCounterWithNoopHeaders(statsdClient.NewCounter(statsdEntryPointReqsName, 1.0))
registry.entryPointReqsTLSCounter = statsdClient.NewCounter(statsdEntryPointReqsTLSName, 1.0)
registry.entryPointReqDurationHistogram, _ = NewHistogramWithScale(statsdClient.NewTiming(statsdEntryPointReqDurationName, 1.0), time.Millisecond)
registry.entryPointReqsBytesCounter = statsdClient.NewCounter(statsdEntryPointReqsBytesName, 1.0)
@ -75,7 +75,7 @@ func RegisterStatsd(ctx context.Context, config *types.Statsd) Registry {
if config.AddRoutersLabels {
registry.routerEnabled = config.AddRoutersLabels
registry.routerReqsCounter = statsdClient.NewCounter(statsdRouterReqsName, 1.0)
registry.routerReqsCounter = NewCounterWithNoopHeaders(statsdClient.NewCounter(statsdRouterReqsName, 1.0))
registry.routerReqsTLSCounter = statsdClient.NewCounter(statsdRouterReqsTLSName, 1.0)
registry.routerReqDurationHistogram, _ = NewHistogramWithScale(statsdClient.NewTiming(statsdRouterReqsDurationName, 1.0), time.Millisecond)
registry.routerReqsBytesCounter = statsdClient.NewCounter(statsdRouterReqsBytesName, 1.0)
@ -84,7 +84,7 @@ func RegisterStatsd(ctx context.Context, config *types.Statsd) Registry {
if config.AddServicesLabels {
registry.svcEnabled = config.AddServicesLabels
registry.serviceReqsCounter = statsdClient.NewCounter(statsdServiceReqsName, 1.0)
registry.serviceReqsCounter = NewCounterWithNoopHeaders(statsdClient.NewCounter(statsdServiceReqsName, 1.0))
registry.serviceReqsTLSCounter = statsdClient.NewCounter(statsdServiceReqsTLSName, 1.0)
registry.serviceReqDurationHistogram, _ = NewHistogramWithScale(statsdClient.NewTiming(statsdServiceReqsDurationName, 1.0), time.Millisecond)
registry.serviceRetriesCounter = statsdClient.NewCounter(statsdServiceRetriesTotalName, 1.0)

View file

@ -82,21 +82,21 @@ func testRegistry(t *testing.T, metricsPrefix string, registry Registry) {
registry.TLSCertsNotAfterTimestampGauge().With("key", "value").Set(1)
registry.EntryPointReqsCounter().With("entrypoint", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
registry.EntryPointReqsCounter().With(nil, "entrypoint", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
registry.EntryPointReqsTLSCounter().With("entrypoint", "test", "tls_version", "foo", "tls_cipher", "bar").Add(1)
registry.EntryPointReqDurationHistogram().With("entrypoint", "test").Observe(10000)
registry.EntryPointReqsBytesCounter().With("entrypoint", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
registry.EntryPointRespsBytesCounter().With("entrypoint", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
registry.RouterReqsCounter().With("router", "demo", "service", "test", "code", strconv.Itoa(http.StatusNotFound), "method", http.MethodGet).Add(1)
registry.RouterReqsCounter().With("router", "demo", "service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
registry.RouterReqsCounter().With(nil, "router", "demo", "service", "test", "code", strconv.Itoa(http.StatusNotFound), "method", http.MethodGet).Add(1)
registry.RouterReqsCounter().With(nil, "router", "demo", "service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
registry.RouterReqsTLSCounter().With("router", "demo", "service", "test", "tls_version", "foo", "tls_cipher", "bar").Add(1)
registry.RouterReqDurationHistogram().With("router", "demo", "service", "test", "code", strconv.Itoa(http.StatusOK)).Observe(10000)
registry.RouterReqsBytesCounter().With("router", "demo", "service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
registry.RouterRespsBytesCounter().With("router", "demo", "service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
registry.ServiceReqsCounter().With("service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
registry.ServiceReqsCounter().With("service", "test", "code", strconv.Itoa(http.StatusNotFound), "method", http.MethodGet).Add(1)
registry.ServiceReqsCounter().With(nil, "service", "test", "code", strconv.Itoa(http.StatusOK), "method", http.MethodGet).Add(1)
registry.ServiceReqsCounter().With(nil, "service", "test", "code", strconv.Itoa(http.StatusNotFound), "method", http.MethodGet).Add(1)
registry.ServiceReqsTLSCounter().With("service", "test", "tls_version", "foo", "tls_cipher", "bar").Add(1)
registry.ServiceReqDurationHistogram().With("service", "test", "code", strconv.Itoa(http.StatusOK)).Observe(10000)
registry.ServiceRetriesCounter().With("service", "test").Add(1)

View file

@ -3,8 +3,8 @@ package buffering
import (
"bytes"
"context"
"crypto/rand"
"math"
"math/rand"
"net/http"
"net/http/httptest"
"testing"
@ -16,7 +16,7 @@ import (
func TestBuffering(t *testing.T) {
payload := make([]byte, math.MaxInt8)
rand.Read(payload)
_, _ = rand.Read(payload)
testCases := []struct {
desc string

View file

@ -33,7 +33,7 @@ const (
type metricsMiddleware struct {
next http.Handler
reqsCounter gokitmetrics.Counter
reqsCounter metrics.CounterWithHeaders
reqsTLSCounter gokitmetrics.Counter
reqDurationHistogram metrics.ScalableHistogram
reqsBytesCounter gokitmetrics.Counter
@ -145,7 +145,7 @@ func (m *metricsMiddleware) ServeHTTP(rw http.ResponseWriter, req *http.Request)
labels = append(labels, "code", strconv.Itoa(code))
m.reqDurationHistogram.With(labels...).ObserveFromStart(start)
m.reqsCounter.With(labels...).Add(1)
m.reqsCounter.With(req.Header, labels...).Add(1)
m.respsBytesCounter.With(labels...).Add(float64(capt.ResponseSize()))
m.reqsBytesCounter.With(labels...).Add(float64(capt.RequestSize()))
}

View file

@ -75,11 +75,13 @@ func (p *Provider) buildConfiguration(ctx context.Context, containersInspected [
serviceName := getServiceName(container)
model := struct {
Name string
Labels map[string]string
Name string
ContainerName string
Labels map[string]string
}{
Name: serviceName,
Labels: container.Labels,
Name: serviceName,
ContainerName: strings.TrimPrefix(container.Name, "/"),
Labels: container.Labels,
}
provider.BuildRouterConfiguration(ctx, confFromLabel.HTTP, serviceName, p.defaultRuleTpl, model)

View file

@ -0,0 +1,369 @@
package crd
import (
"fmt"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/generated/clientset/versioned/scheme"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/generated/informers/externalversions"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/traefikio/v1alpha1"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/k8s"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
)
func (c *clientWrapper) appendContainousIngressRoutes(result []*v1alpha1.IngressRoute) []*v1alpha1.IngressRoute {
listed := map[string]struct{}{}
for _, obj := range result {
listed[objectKey(obj.ObjectMeta)] = struct{}{}
}
for ns, factory := range c.factoriesCrd {
ings, err := factory.TraefikContainous().V1alpha1().IngressRoutes().Lister().List(labels.Everything())
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to list ingress routes")
}
for _, ing := range ings {
key := objectKey(ing.ObjectMeta)
if _, ok := listed[key]; ok {
log.Debug().Msgf("Ignoring traefik.containo.us/v1alpha1 ingress route (%s) already listed within traefik.io/v1alpha1 API GroupVersion", key)
continue
}
toVersion, err := scheme.Scheme.ConvertToVersion(ing, GroupVersioner)
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to convert ingress route in namespace")
continue
}
result = append(result, toVersion.(*v1alpha1.IngressRoute))
}
}
return result
}
func (c *clientWrapper) appendContainousIngressRouteTCPs(result []*v1alpha1.IngressRouteTCP) []*v1alpha1.IngressRouteTCP {
listed := map[string]struct{}{}
for _, obj := range result {
listed[objectKey(obj.ObjectMeta)] = struct{}{}
}
for ns, factory := range c.factoriesCrd {
ings, err := factory.TraefikContainous().V1alpha1().IngressRouteTCPs().Lister().List(labels.Everything())
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to list tcp ingress routes")
}
for _, ing := range ings {
key := objectKey(ing.ObjectMeta)
if _, ok := listed[key]; ok {
log.Debug().Msgf("Ignoring traefik.containo.us/v1alpha1 tcp ingress route (%s) already listed within traefik.io/v1alpha1 API GroupVersion", key)
continue
}
toVersion, err := scheme.Scheme.ConvertToVersion(ing, GroupVersioner)
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to convert tcp ingress route")
continue
}
result = append(result, toVersion.(*v1alpha1.IngressRouteTCP))
}
}
return result
}
func (c *clientWrapper) appendContainousIngressRouteUDPs(result []*v1alpha1.IngressRouteUDP) []*v1alpha1.IngressRouteUDP {
listed := map[string]struct{}{}
for _, obj := range result {
listed[objectKey(obj.ObjectMeta)] = struct{}{}
}
for ns, factory := range c.factoriesCrd {
ings, err := factory.TraefikContainous().V1alpha1().IngressRouteUDPs().Lister().List(labels.Everything())
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to list udp ingress routes")
}
for _, ing := range ings {
key := objectKey(ing.ObjectMeta)
if _, ok := listed[key]; ok {
log.Debug().Msgf("Ignoring traefik.containo.us/v1alpha1 udp ingress route (%s) already listed within traefik.io/v1alpha1 API GroupVersion", key)
continue
}
toVersion, err := scheme.Scheme.ConvertToVersion(ing, GroupVersioner)
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to convert udp ingress route")
continue
}
result = append(result, toVersion.(*v1alpha1.IngressRouteUDP))
}
}
return result
}
func (c *clientWrapper) appendContainousMiddlewares(result []*v1alpha1.Middleware) []*v1alpha1.Middleware {
listed := map[string]struct{}{}
for _, obj := range result {
listed[objectKey(obj.ObjectMeta)] = struct{}{}
}
for ns, factory := range c.factoriesCrd {
middlewares, err := factory.TraefikContainous().V1alpha1().Middlewares().Lister().List(labels.Everything())
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to list middlewares")
}
for _, middleware := range middlewares {
key := objectKey(middleware.ObjectMeta)
if _, ok := listed[key]; ok {
log.Debug().Msgf("Ignoring traefik.containo.us/v1alpha1 middleware (%s) already listed within traefik.io/v1alpha1 API GroupVersion", key)
continue
}
toVersion, err := scheme.Scheme.ConvertToVersion(middleware, GroupVersioner)
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to convert middleware")
continue
}
result = append(result, toVersion.(*v1alpha1.Middleware))
}
}
return result
}
func (c *clientWrapper) appendContainousMiddlewareTCPs(result []*v1alpha1.MiddlewareTCP) []*v1alpha1.MiddlewareTCP {
listed := map[string]struct{}{}
for _, obj := range result {
listed[objectKey(obj.ObjectMeta)] = struct{}{}
}
for ns, factory := range c.factoriesCrd {
middlewares, err := factory.TraefikContainous().V1alpha1().MiddlewareTCPs().Lister().List(labels.Everything())
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to list tcp middlewares")
}
for _, middleware := range middlewares {
key := objectKey(middleware.ObjectMeta)
if _, ok := listed[key]; ok {
log.Debug().Msgf("Ignoring traefik.containo.us/v1alpha1 middleware (%s) already listed within traefik.io/v1alpha1 API GroupVersion", key)
continue
}
toVersion, err := scheme.Scheme.ConvertToVersion(middleware, GroupVersioner)
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to convert tcp middleware")
continue
}
result = append(result, toVersion.(*v1alpha1.MiddlewareTCP))
}
}
return result
}
func (c *clientWrapper) appendContainousTraefikServices(result []*v1alpha1.TraefikService) []*v1alpha1.TraefikService {
listed := map[string]struct{}{}
for _, obj := range result {
listed[objectKey(obj.ObjectMeta)] = struct{}{}
}
for ns, factory := range c.factoriesCrd {
traefikServices, err := factory.TraefikContainous().V1alpha1().TraefikServices().Lister().List(labels.Everything())
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to list Traefik services")
}
for _, traefikService := range traefikServices {
key := objectKey(traefikService.ObjectMeta)
if _, ok := listed[key]; ok {
log.Debug().Msgf("Ignoring traefik.containo.us/v1alpha1 Traefik service (%s) already listed within traefik.io/v1alpha1 API GroupVersion", key)
continue
}
toVersion, err := scheme.Scheme.ConvertToVersion(traefikService, GroupVersioner)
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to convert Traefik service")
continue
}
result = append(result, toVersion.(*v1alpha1.TraefikService))
}
}
return result
}
func (c *clientWrapper) appendContainousServersTransport(result []*v1alpha1.ServersTransport) []*v1alpha1.ServersTransport {
listed := map[string]struct{}{}
for _, obj := range result {
listed[objectKey(obj.ObjectMeta)] = struct{}{}
}
for ns, factory := range c.factoriesCrd {
serversTransports, err := factory.TraefikContainous().V1alpha1().ServersTransports().Lister().List(labels.Everything())
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to list servers transports")
}
for _, serversTransport := range serversTransports {
key := objectKey(serversTransport.ObjectMeta)
if _, ok := listed[key]; ok {
log.Debug().Msgf("Ignoring traefik.containo.us/v1alpha1 servers transport (%s) already listed within traefik.io/v1alpha1 API GroupVersion", key)
continue
}
toVersion, err := scheme.Scheme.ConvertToVersion(serversTransport, GroupVersioner)
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to convert servers transport")
continue
}
result = append(result, toVersion.(*v1alpha1.ServersTransport))
}
}
return result
}
func (c *clientWrapper) appendContainousServersTransportTCP(result []*v1alpha1.ServersTransportTCP) []*v1alpha1.ServersTransportTCP {
listed := map[string]struct{}{}
for _, obj := range result {
listed[objectKey(obj.ObjectMeta)] = struct{}{}
}
for ns, factory := range c.factoriesCrd {
serversTransports, err := factory.TraefikContainous().V1alpha1().ServersTransportTCPs().Lister().List(labels.Everything())
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to list servers transports TCP")
}
for _, serversTransport := range serversTransports {
key := objectKey(serversTransport.ObjectMeta)
if _, ok := listed[key]; ok {
log.Debug().Msgf("Ignoring traefik.containo.us/v1alpha1 servers transport TCP (%s) already listed within traefik.io/v1alpha1 API GroupVersion", key)
continue
}
toVersion, err := scheme.Scheme.ConvertToVersion(serversTransport, GroupVersioner)
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to convert servers transport TCP")
continue
}
result = append(result, toVersion.(*v1alpha1.ServersTransportTCP))
}
}
return result
}
func (c *clientWrapper) appendContainousTLSOptions(result []*v1alpha1.TLSOption) []*v1alpha1.TLSOption {
listed := map[string]struct{}{}
for _, obj := range result {
listed[objectKey(obj.ObjectMeta)] = struct{}{}
}
for ns, factory := range c.factoriesCrd {
options, err := factory.TraefikContainous().V1alpha1().TLSOptions().Lister().List(labels.Everything())
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to list tls options")
}
for _, option := range options {
key := objectKey(option.ObjectMeta)
if _, ok := listed[key]; ok {
log.Debug().Msgf("Ignoring traefik.containo.us/v1alpha1 tls option (%s) already listed within traefik.io/v1alpha1 API GroupVersion", key)
continue
}
toVersion, err := scheme.Scheme.ConvertToVersion(option, GroupVersioner)
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to convert tls option")
continue
}
result = append(result, toVersion.(*v1alpha1.TLSOption))
}
}
return result
}
func (c *clientWrapper) appendContainousTLSStores(result []*v1alpha1.TLSStore) []*v1alpha1.TLSStore {
listed := map[string]struct{}{}
for _, obj := range result {
listed[objectKey(obj.ObjectMeta)] = struct{}{}
}
for ns, factory := range c.factoriesCrd {
stores, err := factory.TraefikContainous().V1alpha1().TLSStores().Lister().List(labels.Everything())
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to list tls stores")
}
for _, store := range stores {
key := objectKey(store.ObjectMeta)
if _, ok := listed[key]; ok {
log.Debug().Msgf("Ignoring traefik.containo.us/v1alpha1 tls store (%s) already listed within traefik.io/v1alpha1 API GroupVersion", key)
continue
}
toVersion, err := scheme.Scheme.ConvertToVersion(store, GroupVersioner)
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to convert tls store")
continue
}
result = append(result, toVersion.(*v1alpha1.TLSStore))
}
}
return result
}
func (c *clientWrapper) getContainousTraefikService(ns, name string) (*v1alpha1.TraefikService, bool, error) {
if !c.isWatchedNamespace(ns) {
return nil, false, fmt.Errorf("failed to get service %s/%s: namespace is not within watched namespaces", ns, name)
}
service, err := c.factoriesCrd[c.lookupNamespace(ns)].TraefikContainous().V1alpha1().TraefikServices().Lister().TraefikServices(ns).Get(name)
exist, err := translateNotFoundError(err)
if !exist {
return nil, false, err
}
toVersion, err := scheme.Scheme.ConvertToVersion(service, GroupVersioner)
if err != nil {
log.Error().Err(err).Str("namespace", ns).Msg("Failed to convert Traefik service")
}
return toVersion.(*v1alpha1.TraefikService), exist, err
}
func addContainousInformers(factoryCrd externalversions.SharedInformerFactory, eventHandler *k8s.ResourceEventHandler) {
factoryCrd.TraefikContainous().V1alpha1().IngressRoutes().Informer().AddEventHandler(eventHandler)
factoryCrd.TraefikContainous().V1alpha1().Middlewares().Informer().AddEventHandler(eventHandler)
factoryCrd.TraefikContainous().V1alpha1().MiddlewareTCPs().Informer().AddEventHandler(eventHandler)
factoryCrd.TraefikContainous().V1alpha1().IngressRouteTCPs().Informer().AddEventHandler(eventHandler)
factoryCrd.TraefikContainous().V1alpha1().IngressRouteUDPs().Informer().AddEventHandler(eventHandler)
factoryCrd.TraefikContainous().V1alpha1().TLSOptions().Informer().AddEventHandler(eventHandler)
factoryCrd.TraefikContainous().V1alpha1().ServersTransports().Informer().AddEventHandler(eventHandler)
factoryCrd.TraefikContainous().V1alpha1().TLSStores().Informer().AddEventHandler(eventHandler)
factoryCrd.TraefikContainous().V1alpha1().TraefikServices().Informer().AddEventHandler(eventHandler)
}
func objectKey(meta metav1.ObjectMeta) string {
return fmt.Sprintf("%s/%s", meta.Namespace, meta.Name)
}

View file

@ -11,7 +11,7 @@ import (
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/generated/clientset/versioned"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/generated/informers/externalversions"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/traefik/v1alpha1"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/traefikio/v1alpha1"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/k8s"
"github.com/traefik/traefik/v3/pkg/version"
corev1 "k8s.io/api/core/v1"
@ -175,6 +175,8 @@ func (c *clientWrapper) WatchAll(namespaces []string, stopCh <-chan struct{}) (<
factoryCrd.Traefik().V1alpha1().TLSStores().Informer().AddEventHandler(eventHandler)
factoryCrd.Traefik().V1alpha1().TraefikServices().Informer().AddEventHandler(eventHandler)
addContainousInformers(factoryCrd, eventHandler)
factoryKube := informers.NewSharedInformerFactoryWithOptions(c.csKube, resyncPeriod, informers.WithNamespace(ns))
factoryKube.Core().V1().Services().Informer().AddEventHandler(eventHandler)
factoryKube.Core().V1().Endpoints().Informer().AddEventHandler(eventHandler)
@ -227,7 +229,7 @@ func (c *clientWrapper) GetIngressRoutes() []*v1alpha1.IngressRoute {
result = append(result, ings...)
}
return result
return c.appendContainousIngressRoutes(result)
}
func (c *clientWrapper) GetIngressRouteTCPs() []*v1alpha1.IngressRouteTCP {
@ -241,7 +243,7 @@ func (c *clientWrapper) GetIngressRouteTCPs() []*v1alpha1.IngressRouteTCP {
result = append(result, ings...)
}
return result
return c.appendContainousIngressRouteTCPs(result)
}
func (c *clientWrapper) GetIngressRouteUDPs() []*v1alpha1.IngressRouteUDP {
@ -255,7 +257,7 @@ func (c *clientWrapper) GetIngressRouteUDPs() []*v1alpha1.IngressRouteUDP {
result = append(result, ings...)
}
return result
return c.appendContainousIngressRouteUDPs(result)
}
func (c *clientWrapper) GetMiddlewares() []*v1alpha1.Middleware {
@ -269,7 +271,7 @@ func (c *clientWrapper) GetMiddlewares() []*v1alpha1.Middleware {
result = append(result, middlewares...)
}
return result
return c.appendContainousMiddlewares(result)
}
func (c *clientWrapper) GetMiddlewareTCPs() []*v1alpha1.MiddlewareTCP {
@ -283,7 +285,7 @@ func (c *clientWrapper) GetMiddlewareTCPs() []*v1alpha1.MiddlewareTCP {
result = append(result, middlewares...)
}
return result
return c.appendContainousMiddlewareTCPs(result)
}
// GetTraefikService returns the named service from the given namespace.
@ -295,6 +297,10 @@ func (c *clientWrapper) GetTraefikService(namespace, name string) (*v1alpha1.Tra
service, err := c.factoriesCrd[c.lookupNamespace(namespace)].Traefik().V1alpha1().TraefikServices().Lister().TraefikServices(namespace).Get(name)
exist, err := translateNotFoundError(err)
if !exist {
return c.getContainousTraefikService(namespace, name)
}
return service, exist, err
}
@ -302,14 +308,14 @@ func (c *clientWrapper) GetTraefikServices() []*v1alpha1.TraefikService {
var result []*v1alpha1.TraefikService
for ns, factory := range c.factoriesCrd {
ings, err := factory.Traefik().V1alpha1().TraefikServices().Lister().List(labels.Everything())
traefikServices, err := factory.Traefik().V1alpha1().TraefikServices().Lister().List(labels.Everything())
if err != nil {
log.Error().Err(err).Msgf("Failed to list Traefik services in namespace %s", ns)
}
result = append(result, ings...)
result = append(result, traefikServices...)
}
return result
return c.appendContainousTraefikServices(result)
}
// GetServersTransports returns all ServersTransport.
@ -319,12 +325,12 @@ func (c *clientWrapper) GetServersTransports() []*v1alpha1.ServersTransport {
for ns, factory := range c.factoriesCrd {
serversTransports, err := factory.Traefik().V1alpha1().ServersTransports().Lister().List(labels.Everything())
if err != nil {
log.Error().Err(err).Msgf("Failed to list servers transport in namespace %s", ns)
log.Error().Err(err).Str("namespace", ns).Msg("Failed to list servers transport in namespace")
}
result = append(result, serversTransports...)
}
return result
return c.appendContainousServersTransport(result)
}
// GetServersTransportTCPs returns all ServersTransportTCP.
@ -334,15 +340,12 @@ func (c *clientWrapper) GetServersTransportTCPs() []*v1alpha1.ServersTransportTC
for ns, factory := range c.factoriesCrd {
serversTransports, err := factory.Traefik().V1alpha1().ServersTransportTCPs().Lister().List(labels.Everything())
if err != nil {
log.Error().
Err(err).
Str("namespace", ns).
Msg("Failed to list servers transport TCP in namespace")
log.Error().Err(err).Str("namespace", ns).Msg("Failed to list servers transport TCP in namespace")
}
result = append(result, serversTransports...)
}
return result
return c.appendContainousServersTransportTCP(result)
}
// GetTLSOptions returns all TLS options.
@ -357,7 +360,7 @@ func (c *clientWrapper) GetTLSOptions() []*v1alpha1.TLSOption {
result = append(result, options...)
}
return result
return c.appendContainousTLSOptions(result)
}
// GetTLSStores returns all TLS stores.
@ -372,7 +375,7 @@ func (c *clientWrapper) GetTLSStores() []*v1alpha1.TLSStore {
result = append(result, stores...)
}
return result
return c.appendContainousTLSStores(result)
}
// GetService returns the named service from the given namespace.
@ -421,15 +424,6 @@ func (c *clientWrapper) lookupNamespace(ns string) string {
return ns
}
// translateNotFoundError will translate a "not found" error to a boolean return
// value which indicates if the resource exists and a nil error.
func translateNotFoundError(err error) (bool, error) {
if kubeerror.IsNotFound(err) {
return false, nil
}
return err == nil, err
}
// isWatchedNamespace checks to ensure that the namespace is being watched before we request
// it to ensure we don't panic by requesting an out-of-watch object.
func (c *clientWrapper) isWatchedNamespace(ns string) bool {
@ -443,3 +437,12 @@ func (c *clientWrapper) isWatchedNamespace(ns string) bool {
}
return false
}
// translateNotFoundError will translate a "not found" error to a boolean return
// value which indicates if the resource exists and a nil error.
func translateNotFoundError(err error) (bool, error) {
if kubeerror.IsNotFound(err) {
return false, nil
}
return err == nil, err
}

View file

@ -5,7 +5,7 @@ import (
"os"
"path/filepath"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/traefik/v1alpha1"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/traefikio/v1alpha1"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/k8s"
corev1 "k8s.io/api/core/v1"
"k8s.io/client-go/kubernetes/scheme"

View file

@ -252,3 +252,17 @@ apiVersion: v1
metadata:
name: whoami-without-endpoints-subsets
namespace: default
---
apiVersion: v1
kind: Service
metadata:
name: native-svc
namespace: default
spec:
ports:
- name: web
port: 80
type: ClusterIP
clusterIP: 10.10.0.1

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -261,3 +261,17 @@ apiVersion: v1
metadata:
name: whoamitcp-without-endpoints-subsets
namespace: default
---
apiVersion: v1
kind: Service
metadata:
name: native-svc
namespace: default
spec:
ports:
- name: myapp
port: 8000
type: ClusterIP
clusterIP: 10.10.0.1

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -18,7 +18,7 @@ data:
tls.ca: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0=
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TLSOption
metadata:
name: foo
@ -49,7 +49,7 @@ data:
tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: MiddlewareTCP
metadata:
name: ipallowlist
@ -9,7 +9,7 @@ spec:
- 127.0.0.1/32
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: MiddlewareTCP
metadata:
name: ipallowlist
@ -19,7 +19,7 @@ spec:
sourceRange:
- 127.0.0.1/32
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: MiddlewareTCP
metadata:
name: ipallowlist
@ -9,7 +9,7 @@ spec:
- 127.0.0.1/32
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: MiddlewareTCP
metadata:
name: ipallowlist
@ -19,7 +19,7 @@ spec:
sourceRange:
- 127.0.0.1/32
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: MiddlewareTCP
metadata:
name: multiple---hyphens
@ -9,7 +9,7 @@ spec:
- 127.0.0.1/32
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: MiddlewareTCP
metadata:
name: ipallowlist
@ -9,7 +9,7 @@ spec:
- 127.0.0.1/32
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: MiddlewareTCP
metadata:
name: ipallowlist
@ -19,7 +19,7 @@ spec:
sourceRange:
- 127.0.0.1/32
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -0,0 +1,16 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route
namespace: default
spec:
entryPoints:
- foo
routes:
- match: HostSNI(`foo.com`)
services:
- name: native-svc
port: 8000
nativeLB: true

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -83,7 +83,7 @@ data:
tls.key: VEVTVEtFWTM=
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: ServersTransportTCP
metadata:
name: test
@ -115,7 +115,7 @@ spec:
terminationDelay: 42
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: ServersTransportTCP
metadata:
name: test
@ -126,7 +126,7 @@ spec:
serverName: "test"
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route
@ -17,7 +17,7 @@ spec:
serversTransport: cross-ns-st-cross-ns@kubernetescrd
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: ServersTransportTCP
metadata:
name: st-cross-ns

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -9,7 +9,7 @@ data:
tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -18,7 +18,7 @@ data:
tls.ca: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0=
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TLSOption
metadata:
name: foo
@ -47,7 +47,7 @@ data:
tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -18,7 +18,7 @@ data:
tls.ca: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0=
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TLSOption
metadata:
name: foo
@ -48,7 +48,7 @@ data:
tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route
@ -20,7 +20,7 @@ spec:
namespace: cross-ns
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TLSOption
metadata:
name: tls-options-cn

View file

@ -9,7 +9,7 @@ data:
tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TLSStore
metadata:
name: default
@ -20,7 +20,7 @@ data:
tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,5 +1,5 @@
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TLSOption
metadata:
name: foo
@ -9,7 +9,7 @@ spec:
minVersion: VersionTLS12
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -1,5 +1,5 @@
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TLSOption
metadata:
name: foo
@ -9,7 +9,7 @@ spec:
minVersion: VersionTLS12
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: test.route

View file

@ -220,3 +220,17 @@ apiVersion: v1
metadata:
name: whoamiudp-without-endpoints-subsets
namespace: default
---
apiVersion: v1
kind: Service
metadata:
name: native-svc
namespace: default
spec:
ports:
- name: myapp
port: 8000
type: ClusterIP
clusterIP: 10.10.0.1

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteUDP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteUDP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteUDP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteUDP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteUDP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteUDP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteUDP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteUDP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteUDP
metadata:
name: test.route

View file

@ -0,0 +1,15 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRouteUDP
metadata:
name: test.route
namespace: default
spec:
entryPoints:
- foo
routes:
- services:
- name: native-svc
port: 8000
nativeLB: true

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteUDP
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRouteUDP
metadata:
name: test.route

View file

@ -30,7 +30,7 @@ data:
tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: basicauth
@ -41,7 +41,7 @@ spec:
secret: authsecret
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: digestauth
@ -51,7 +51,7 @@ spec:
digestAuth:
secret: authsecret
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: forwardauth

View file

@ -18,7 +18,7 @@ data:
tls.ca:
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TLSOption
metadata:
name: foo
@ -38,7 +38,7 @@ spec:
clientAuthType: VerifyClientCertIfGiven
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: cross-ns-route
@ -36,7 +36,7 @@ spec:
serversTransport: foo-test@kubernetescrd
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: tr-svc-wrr1
@ -51,7 +51,7 @@ spec:
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: tr-svc-wrr2
@ -65,7 +65,7 @@ spec:
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: tr-svc-mirror1
@ -82,7 +82,7 @@ spec:
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: tr-svc-mirror2
@ -99,7 +99,7 @@ spec:
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: ServersTransport
metadata:
name: test

View file

@ -18,7 +18,7 @@ data:
tls.ca: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0=
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TLSOption
metadata:
name: default
@ -37,7 +37,7 @@ spec:
clientAuthType: VerifyClientCertIfGiven
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -18,7 +18,7 @@ data:
tls.ca: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0=
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TLSOption
metadata:
name: default
@ -37,7 +37,7 @@ spec:
clientAuthType: VerifyClientCertIfGiven
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TLSStore
metadata:
name: default
@ -20,7 +20,7 @@ data:
tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route
@ -21,7 +21,7 @@ spec:
- name: test-errorpage
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: test-weighted
@ -35,7 +35,7 @@ spec:
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: test-mirror
@ -52,7 +52,7 @@ spec:
kind: TraefikService
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: test-errorpage

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: errorpage

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: stripprefix
@ -10,7 +10,7 @@ spec:
- /tobestripped
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: ratelimit
@ -28,7 +28,7 @@ spec:
- 192.168.1.7
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: addprefix
@ -39,7 +39,7 @@ spec:
prefix: /tobeadded
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test2.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test-crossnamespace.route
@ -39,7 +39,7 @@ spec:
- name: cross-ns-stripprefix@kubernetescrd
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: stripprefix
@ -51,7 +51,7 @@ spec:
- /stripit
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: test-errorpage

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: stripprefix
@ -10,7 +10,7 @@ spec:
- /tobestripped
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: addprefix
@ -21,7 +21,7 @@ spec:
prefix: /tobeadded
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test2.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: multiple---hyphens
@ -10,7 +10,7 @@ spec:
- /tobestripped
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test2.route

View file

@ -59,7 +59,7 @@ spec:
task: whoami5
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: mirror1
@ -77,7 +77,7 @@ spec:
port: 8080
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -59,7 +59,7 @@ spec:
task: whoami5
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: wrr2
@ -73,7 +73,7 @@ spec:
port: 8080
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: wrr1
@ -87,7 +87,7 @@ spec:
port: 8080
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: mirror1
@ -103,7 +103,7 @@ spec:
percent: 30
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -89,7 +89,7 @@ spec:
task: whoami4
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: mirror1
@ -111,7 +111,7 @@ spec:
namespace: bar
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: wrr2
@ -126,7 +126,7 @@ spec:
port: 8080
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: mirror2
@ -150,7 +150,7 @@ spec:
namespace: foo
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: mirror3
@ -176,7 +176,7 @@ spec:
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: mirror4
@ -200,7 +200,7 @@ spec:
namespace: foo
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: mirrored
@ -218,7 +218,7 @@ spec:
namespace: foo
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: wrr1
@ -239,7 +239,7 @@ spec:
namespace: bar
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -0,0 +1,17 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route
namespace: default
spec:
entryPoints:
- foo
routes:
- match: Host(`foo.com`)
kind: Rule
services:
- name: native-svc
port: 80
nativeLB: true

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: test.route

View file

@ -8,7 +8,7 @@ data:
key: dGhpc19pc190aGVfdmVyeV9kZWVwX3NlY3JldA==
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: test-secret

View file

@ -9,7 +9,7 @@ data:
key2: dXNlcl9wYXNzd29yZA==
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: test-secret

View file

@ -9,7 +9,7 @@ data:
key2: c2VjcmV0X2RhdGEy
---
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: test-secret

Some files were not shown because too many files have changed in this diff Show more