I integrate traefik with k8scrd, and i start the source code with traefik.go with this config.
providers:
kubernetesCRD:
endpoint: "https://127.0.0.1:6443"
# namespaces:
# - "default"
certAuthFilePath: "/Users/user/develop/k8s-auth.crt"
the endpoint and certAuthFilePath is related to ~/.kube/config server url and certificate-authority-data base64 decode.
and I had add crd resource
# Install Traefik Resource Definitions:
kubectl apply -f https://raw.githubusercontent.com/traefik/traefik/v2.10/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml
# Install RBAC for Traefik:
kubectl apply -f https://raw.githubusercontent.com/traefik/traefik/v2.10/docs/content/reference/dynamic-configuration/kubernetes-crd-rbac.yml
then i got this error:
W0606 17:58:56.456544 67318 reflector.go:424] pkg/mod/k8s.io/client-go@v0.26.3/tools/cache/reflector.go:169: failed to list *v1alpha1.IngressRouteTCP: ingressroutetcps.traefik.io is forbidden: User "system:anonymous" cannot list resource "ingressroutetcps" in API group "traefik.io" at the cluster scope
W0606 17:58:56.456545 67318 reflector.go:424] pkg/mod/k8s.io/client-go@v0.26.3/tools/cache/reflector.go:169: failed to list *v1alpha1.TLSOption: tlsoptions.traefik.io is forbidden: User "system:anonymous" cannot list resource "tlsoptions" in API group "traefik.io" at the cluster scope
W0606 17:58:56.456576 67318 reflector.go:424] pkg/mod/k8s.io/client-go@v0.26.3/tools/cache/reflector.go:169: failed to list *v1alpha1.MiddlewareTCP: middlewaretcps.traefik.io is forbidden: User "system:anonymous" cannot list resource "middlewaretcps" in API group "traefik.io" at the cluster scope
what is the problem?