Middleware auth creates bad logs : Even with the secret I always have the log
level=error msg="Error while reading basic auth middleware: failed to load auth credentials: secret 'traefik/traefik' not found" middlewareName=traefik-auth providerName=kubernetescrd
level=error msg="middleware \"traefik-auth@kubernetescrd\" does not exist" routerName=traefik-traefik-86717a050e7497cf6af6@kubernetescrd entryPointName=traefik
level=error msg="middleware \"traefik-auth@kubernetescrd\" does not exist" entryPointName=web routerName=traefik-traefik-86717a050e7497cf6af6@kubernetescrd
level=error msg="Error while reading basic auth middleware: failed to load auth credentials: secret 'traefik/traefik' not found" providerName=kubernetescrd middlewareName=traefik-auth
see full log at the end of this issue
What did you do?
this is my Middleware:
kubectl get middleware -n traefik auth -o yaml
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: auth
namespace: traefik
spec:
basicAuth:
secret: traefik
this is my secret
kubectl get secret -n traefik traefik -o yaml
apiVersion: v1
data:
users: YWRtaW46JGFwcjEkS1JhemRoMkokcDN2NW03aWJ6MTJLMGlFeGIuZ05NMA==
kind: Secret
metadata:
name: traefik
namespace: traefik
type: Opaque
this is my ingressroute
kubectl get ingressroute -n traefik traefik -o yaml
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: traefik
namespace: traefik
spec:
routes:
- kind: Rule
match: Host(`traefik-ui.k8s-serv.nd-int-ops-paas.itn`) && (PathPrefix(`/api`)
||PathPrefix(`/dashboard`))
middlewares:
- name: auth
namespace: traefik
priority: 1
services:
- kind: TraefikService
What did you expect to see?
no log error
What did you see instead?
log error
and IngressRoute doesn't works
Output of traefik version
: (What version of Traefik are you using?)
traefik:v2.1
What is your environment & configuration (arguments, toml, provider, platform, ...)?
- args:
- --api=true
- --api.dashboard=true
- --global.sendanonymoususage=true
- --log.level=INFO
- --providers.kubernetescrd=true
- --entrypoints.web=true
- --entryPoints.web.address=:80
- --metrics.prometheus=true
If applicable, please paste the log output in DEBUG level (--log.level=DEBUG
switch)
kubectl logs -n traefik traefik-ingress-controller-sczr7
time="2020-02-21T09:20:43Z" level=info msg="Configuration loaded from flags."
time="2020-02-21T09:20:43Z" level=info msg="Traefik version 2.1.4 built on 2020-02-06T17:10:06Z"
time="2020-02-21T09:20:43Z" level=info msg="Stats collection is enabled."
time="2020-02-21T09:20:43Z" level=info msg="Many thanks for contributing to Traefik's improvement by allowing us to receive anonymous information from your configuration."
time="2020-02-21T09:20:43Z" level=info msg="Help us improve Traefik by leaving this feature on :)"
time="2020-02-21T09:20:43Z" level=info msg="More details on: https://docs.traefik.io/v2.0/contributing/data-collection/"
time="2020-02-21T09:20:43Z" level=info msg="Starting provider aggregator.ProviderAggregator {}"
time="2020-02-21T09:20:43Z" level=info msg="Starting provider *traefik.Provider {}"
time="2020-02-21T09:20:43Z" level=info msg="Starting provider *crd.Provider {}"
time="2020-02-21T09:20:43Z" level=info msg="label selector is: \"\"" providerName=kubernetescrd
time="2020-02-21T09:20:43Z" level=info msg="Creating in-cluster Provider client" providerName=kubernetescrd
time="2020-02-21T09:20:43Z" 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-21T09:20:43Z" level=error msg="middleware \"traefik-auth@kubernetescrd\" does not exist" routerName=traefik-traefik-86717a050e7497cf6af6@kubernetescrd entryPointName=traefik
time="2020-02-21T09:20:43Z" level=error msg="middleware \"traefik-auth@kubernetescrd\" does not exist" entryPointName=web routerName=traefik-traefik-86717a050e7497cf6af6@kubernetescrd
time="2020-02-21T09:20:43Z" level=error msg="Error while reading basic auth middleware: failed to load auth credentials: secret 'traefik/traefik' not found" providerName=kubernetescrd middlewareName=traefik-auth