obeyler
February 20, 2020, 9:00am
1
Could you give me a tip?
I try to migrate Ingress to IngressRoute. I use the migrate tools.
Ingress works but IngressRoute doesn't work.
I suspect the config.toml
[global]
checkNewVersion = true
sendAnonymousUsage = false
[log]
level = "WARNING"
[api]
dashboard = true
[providers]
[providers.kubernetesingress]
[providers.kubernetescrd]
[entrypoints]
[entrypoints.web]
address = ":80"
[entryPoints.web.proxyProtocol]
insecure = false
[entryPoints.web.forwardedHeaders]
insecure = true
[entrypoints.https]
address = ":443"
[entryPoints.mysql]
address = ":3306"
[entryPoints.mongodb]
address = ":27017"
[entryPoints.postgres]
address = ":5432"
[tcp] # YAY!
[tcp.routers]
[tcp.routers.to-db-1]
entrypoints = ["mongodb"]
rule = "HostSNI(`*`)"
service = "db-1"
[ping]
[accesslog]
[metrics]
[metrics.prometheus]
entryPoint = "traefik"
buckets=[0.1,0.3,1.2,5.0]
or the arg of my daemonset:
args:
- --api
- --providers.kubernetesingress
- --providers.kubernetescrd
- --configfile=/config/traefik.toml
ldez
February 20, 2020, 1:13pm
2
Note that --configfile
and other flag cannot be mixed.
Either you use a file (with or without --configfile
) or you use flags.
Could you provide your ingress, ingresstoute, logs, ...
obeyler
February 20, 2020, 2:43pm
3
this by example this ingressroute doesn't work
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: k8sdash-ingressroute
namespace: kube-system
spec:
entryPoints:
- web
routes:
- match: Host(`k8sdash.k8s-master`) && PathPrefix(`/`)
kind: Rule
priority: 0
services:
- kind: Service
name: k8sdash
namespace: kube-system
port: 80
versus this ingress works fine:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: traefik
name: k8sdash-ingress
namespace: kube-system
spec:
rules:
- host: k8sdash.k8s-master
http:
paths:
- backend:
serviceName: k8dash
servicePort: 80
path: /
obeyler
February 20, 2020, 3:17pm
4
kubectl logs -n traefik traefik-ingress-controller-28xpq
time="2020-02-20T15:09:17Z" level=info msg="Configuration loaded from file: /config/traefik.toml"
time="2020-02-20T15:09:17Z" level=info msg="Traefik version 2.1.4 built on 2020-02-06T17:10:06Z"
time="2020-02-20T15:09:17Z" level=info msg="Starting provider aggregator.ProviderAggregator {}"
time="2020-02-20T15:09:17Z" level=info msg="Starting provider *ingress.Provider {}"
time="2020-02-20T15:09:17Z" level=info msg="ingress label selector is: \"\"" providerName=kubernetes
time="2020-02-20T15:09:17Z" level=info msg="Creating in-cluster Provider client" providerName=kubernetes
time="2020-02-20T15:09:17Z" level=info msg="Starting provider *traefik.Provider {}"
time="2020-02-20T15:09:17Z" level=info msg="Starting provider *crd.Provider {}"
time="2020-02-20T15:09:17Z" level=info msg="label selector is: \"\"" providerName=kubernetescrd
time="2020-02-20T15:09:17Z" level=info msg="Creating in-cluster Provider client" providerName=kubernetescrd
time="2020-02-20T15:09:18Z" level=error msg="Error while reading basic auth middleware: failed to load auth credentials: secret 'traefik/traefik' not found" middlewareName=traefik-auth providerName=kubernetescrd
time="2020-02-20T15:09:18Z" level=error msg="middleware \"traefik-auth@kubernetescrd\" does not exist" entryPointName=mongodb routerName=traefik-traefik-86717a050e7497cf6af6@kubernetescrd
time="2020-02-20T15:09:18Z" level=error msg="middleware \"traefik-auth@kubernetescrd\" does not exist" entryPointName=mysql routerName=traefik-traefik-86717a050e7497cf6af6@kubernetescrd
time="2020-02-20T15:09:18Z" level=error msg="middleware \"traefik-auth@kubernetescrd\" does not exist" entryPointName=postgres routerName=traefik-traefik-86717a050e7497cf6af6@kubernetescrd
time="2020-02-20T15:09:18Z" level=error msg="middleware \"traefik-auth@kubernetescrd\" does not exist" entryPointName=web routerName=traefik-traefik-86717a050e7497cf6af6@kubernetescrd
time="2020-02-20T15:09:18Z" level=error msg="middleware \"traefik-auth@kubernetescrd\" does not exist" entryPointName=https routerName=traefik-traefik-86717a050e7497cf6af6@kubernetescrd
time="2020-02-20T15:09:18Z" level=error msg="middleware \"traefik-auth@kubernetescrd\" does not exist" entryPointName=traefik routerName=traefik-traefik-86717a050e7497cf6af6@kubernetescrd
192.168.245.205 - admin [20/Feb/2020:15:09:55 +0000] "GET /api/overview HTTP/1.1" 200 372 "-" "-" 1 "traefik-traefik-86717a050e7497cf6af6@kubernetescrd" - 0ms
192.168.245.205 - admin [20/Feb/2020:15:10:15 +0000] "GET /api/overview HTTP/1.1" 200 372 "-" "-" 2 "traefik-traefik-86717a050e7497cf6af6@kubernetescrd" - 0ms
obeyler
February 21, 2020, 12:32pm
5
@ldez I've also created an issue (https://github.com/containous/traefik/issues/6349 ) about the log of Error while reading basic auth middleware: failed to load auth credentials