Drop traefik from default entry points.
This commit is contained in:
parent
5adf74e6ce
commit
af58faafae
4 changed files with 10 additions and 12 deletions
|
@ -200,7 +200,7 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
|
|||
log.WithoutContext().Errorf("Invalid protocol: %v", err)
|
||||
}
|
||||
|
||||
if protocol != "udp" {
|
||||
if protocol != "udp" && name != static.DefaultInternalEntryPointName {
|
||||
defaultEntryPoints = append(defaultEntryPoints, name)
|
||||
}
|
||||
}
|
||||
|
|
4
integration/testdata/rawdata-ingress.json
vendored
4
integration/testdata/rawdata-ingress.json
vendored
|
@ -30,20 +30,17 @@
|
|||
},
|
||||
"test-ingress-default-whoami-test-whoami@kubernetes": {
|
||||
"entryPoints": [
|
||||
"traefik",
|
||||
"web"
|
||||
],
|
||||
"service": "default-whoami-http",
|
||||
"rule": "Host(`whoami.test`) \u0026\u0026 PathPrefix(`/whoami`)",
|
||||
"status": "enabled",
|
||||
"using": [
|
||||
"traefik",
|
||||
"web"
|
||||
]
|
||||
},
|
||||
"test-ingress-https-default-whoami-test-https-whoami@kubernetes": {
|
||||
"entryPoints": [
|
||||
"traefik",
|
||||
"web"
|
||||
],
|
||||
"service": "default-whoami-http",
|
||||
|
@ -51,7 +48,6 @@
|
|||
"tls": {},
|
||||
"status": "enabled",
|
||||
"using": [
|
||||
"traefik",
|
||||
"web"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -180,14 +180,14 @@ type Providers struct {
|
|||
// SetEffectiveConfiguration adds missing configuration parameters derived from existing ones.
|
||||
// It also takes care of maintaining backwards compatibility.
|
||||
func (c *Configuration) SetEffectiveConfiguration() {
|
||||
// Creates the default entry point if needed
|
||||
if len(c.EntryPoints) == 0 {
|
||||
ep := &EntryPoint{Address: ":80"}
|
||||
ep.SetDefaults()
|
||||
c.EntryPoints = EntryPoints{
|
||||
"http": ep,
|
||||
}
|
||||
c.EntryPoints = EntryPoints{"http": ep}
|
||||
}
|
||||
|
||||
// Creates the internal traefik entry point if needed
|
||||
if (c.API != nil && c.API.Insecure) ||
|
||||
(c.Ping != nil && !c.Ping.ManualRouting && c.Ping.EntryPoint == DefaultInternalEntryPointName) ||
|
||||
(c.Metrics != nil && c.Metrics.Prometheus != nil && !c.Metrics.Prometheus.ManualRouting && c.Metrics.Prometheus.EntryPoint == DefaultInternalEntryPointName) ||
|
||||
|
|
|
@ -14,6 +14,8 @@ import (
|
|||
"github.com/containous/traefik/v2/pkg/tls"
|
||||
)
|
||||
|
||||
const defaultInternalEntryPointName = "traefik"
|
||||
|
||||
var _ provider.Provider = (*Provider)(nil)
|
||||
|
||||
// Provider is a provider.Provider implementation that provides the internal routers.
|
||||
|
@ -137,7 +139,7 @@ func (i *Provider) apiConfiguration(cfg *dynamic.Configuration) {
|
|||
|
||||
if i.staticCfg.API.Insecure {
|
||||
cfg.HTTP.Routers["api"] = &dynamic.Router{
|
||||
EntryPoints: []string{"traefik"},
|
||||
EntryPoints: []string{defaultInternalEntryPointName},
|
||||
Service: "api@internal",
|
||||
Priority: math.MaxInt32 - 1,
|
||||
Rule: "PathPrefix(`/api`)",
|
||||
|
@ -145,7 +147,7 @@ func (i *Provider) apiConfiguration(cfg *dynamic.Configuration) {
|
|||
|
||||
if i.staticCfg.API.Dashboard {
|
||||
cfg.HTTP.Routers["dashboard"] = &dynamic.Router{
|
||||
EntryPoints: []string{"traefik"},
|
||||
EntryPoints: []string{defaultInternalEntryPointName},
|
||||
Service: "dashboard@internal",
|
||||
Priority: math.MaxInt32 - 2,
|
||||
Rule: "PathPrefix(`/`)",
|
||||
|
@ -166,7 +168,7 @@ func (i *Provider) apiConfiguration(cfg *dynamic.Configuration) {
|
|||
|
||||
if i.staticCfg.API.Debug {
|
||||
cfg.HTTP.Routers["debug"] = &dynamic.Router{
|
||||
EntryPoints: []string{"traefik"},
|
||||
EntryPoints: []string{defaultInternalEntryPointName},
|
||||
Service: "api@internal",
|
||||
Priority: math.MaxInt32 - 1,
|
||||
Rule: "PathPrefix(`/debug`)",
|
||||
|
@ -205,7 +207,7 @@ func (i *Provider) restConfiguration(cfg *dynamic.Configuration) {
|
|||
|
||||
if i.staticCfg.Providers.Rest.Insecure {
|
||||
cfg.HTTP.Routers["rest"] = &dynamic.Router{
|
||||
EntryPoints: []string{"traefik"},
|
||||
EntryPoints: []string{defaultInternalEntryPointName},
|
||||
Service: "rest@internal",
|
||||
Priority: math.MaxInt32,
|
||||
Rule: "PathPrefix(`/api/providers`)",
|
||||
|
|
Loading…
Reference in a new issue