Closed ic4-y closed 1 year ago
I have the exact same issue
E0626 21:05:19.476439 1 reflector.go:140] k8s.io/client-go@v0.26.3/tools/cache/reflector.go:169: Failed to watch *v1alpha1.ServersTransportTCP: failed to list *v1alpha1.ServersTransportTCP: serverstransporttcps.traefik.io is forbidden: User "system:serviceaccount:traefik:traefik" cannot list resource "serverstransporttcps" in API group "traefik.io" at the cluster scope
Trafeik was working fine until yesterday. I upgraded helm chart (no values.yaml changes) and issue of SA cannot list resource start occuring
That is interesting, meaning: me misconfiguring it might not be the reason why it isn't working :laughing:
On the flip side, I might solve my issue then by downgrading the chart I suppose. I will try that later. Not ideal, but it should prove the point.
@arana198 @icodeforyou-dot-net This error message:
E0626 21:05:19.476439 1 reflector.go:140] k8s.io/client-go@v0.26.3/tools/cache/reflector.go:169: Failed to watch *v1alpha1.ServersTransportTCP: failed to list *v1alpha1.ServersTransportTCP: serverstransporttcps.traefik.io is forbidden: User "system:serviceaccount:traefik:traefik" cannot list resource "serverstransporttcps" in API group "traefik.io" at the cluster scope
It may means that you haven't upgraded CRDs. See release notes of v23.x or upgrade documentation for more details.
Can you confirm that this solve your issue ?
@mloiseleur
I just tried doing
kubectl apply --server-side --force-conflicts -k https://github.com/traefik/traefik-helm-chart/traefik/crds/
that did not help. I also re-deployed traefik after running the command above just to make sure.
Does not change anything in my case. I still get stuff like:
W0627 07:44:06.759950 1 reflector.go:424] k8s.io/client-go@v0.26.3/tools/cache/reflector.go:169: failed to list *v1alpha1.ServersTransport: serverstransports.traefik.io is forbidden: User "system:serviceaccount:traefik:traefik" cannot list resource "serverstransports" in API group "traefik.io" at the cluster scope
E0627 07:44:06.760023 1 reflector.go:140] k8s.io/client-go@v0.26.3/tools/cache/reflector.go:169: Failed to watch *v1alpha1.ServersTransport: failed to list *v1alpha1.ServersTransport: serverstransports.traefik.io is forbidden: User "system:serviceaccount:traefik:traefik" cannot list resource "serverstransports" in API group "traefik.io" at the cluster scope
W0627 07:44:07.096477 1 reflector.go:424] k8s.io/client-go@v0.26.3/tools/cache/reflector.go:169: failed to list *v1.Service: services is forbidden: User "system:serviceaccount:traefik:traefik" cannot list resource "services" in API group "" at the cluster scope
E0627 07:44:07.096549 1 reflector.go:140] k8s.io/client-go@v0.26.3/tools/cache/reflector.go:169: Failed to watch *v1.Service: failed to list *v1.Service: services is forbidden: User "system:serviceaccount:traefik:traefik" cannot list resource "services" in API group "" at the cluster scope
Edit: As mentioned above, my issue appears to be somehow related to clusterroles and clusterrolebindings (or roles and rolebindings respectively when I deploy it accordingly). Since when I promote the Traefik serviceaccount to cluster-admin
the issue goes away.
@arana198 @icodeforyou-dot-net This error message:
E0626 21:05:19.476439 1 reflector.go:140] k8s.io/client-go@v0.26.3/tools/cache/reflector.go:169: Failed to watch *v1alpha1.ServersTransportTCP: failed to list *v1alpha1.ServersTransportTCP: serverstransporttcps.traefik.io is forbidden: User "system:serviceaccount:traefik:traefik" cannot list resource "serverstransporttcps" in API group "traefik.io" at the cluster scope
Means that you haven't upgraded CRDs. See release notes of v23.x or upgrade documentation for more details.
Can you confirm that this solve your issue ?
I saw the documentation last night and updated the CRDs. Unfortunately this hasn't resolved the issue for me
helm search repo traefik/traefik NAME CHART VERSION APP VERSION DESCRIPTION traefik/traefik 9.1.1 2.2.8 A Traefik based Kubernetes ingress controller
Steps taken:
**Update:
I removed old helm repo (https://helm.traefik.io/traefik
) and adding new one to https://traefik.github.io/charts
➜ ~ helm search repo traefik/traefik NAME CHART VERSION APP VERSION DESCRIPTION traefik/traefik 23.1.0 v2.10.1 A Traefik based Kubernetes ingress controller traefik/traefik-mesh 4.1.1 v1.4.8 Traefik Mesh - Simpler Service Mesh traefik/traefikee 1.14.1 v2.10.2 Traefik Enterprise is a unified cloud-native ne...**
Issue still perists
In your values.yaml
, it's specified to not create RBAC:
[...]
# Whether Role Based Access Control objects like roles and rolebindings should be created
rbac:
enabled: false
If you set it to true, it should provide the RBAC needed.
Thanks that solved my issue.
Just so that it is useful for everyone:
@mloiseleur
Excellent, it appears to be working on my end as well!
Thanks for the help!
However one remark. The comments in the defaults values file are misleadning in this case. They state that
# If set to false, installs ClusterRole and ClusterRoleBinding so Traefik can be used across namespaces.
Which appears to not or no longer work.
@icodeforyou-dot-net this comment is for namespaced
.
# If set to false, installs ClusterRole and ClusterRoleBinding so Traefik can be used across namespaces.
# If set to true, installs Role and RoleBinding. Providers will only watch target namespace.
namespaced: false
Feel free to open a PR if you have a good idea on how to help users with those settings.
Welcome!
What version of the Traefik's Helm Chart are you using?
23.1.0
What version of Traefik are you using?
v2.10.1
What did you do?
I installed Traefik via helm in my bare metal RKE2 cluster running version 1.24.14+rke2r1, like so
Since
traefik
was unable to create any Ingress objects, I started to go on a debug mission. And it turned out that the traefik serviceaccount appears to not have any of the permissions it needs. The question is why that happens.What did you see instead?
When checking logs
The following comes up (and more of the same):
In other words,
traefik
, or rather the traefik serviceaccount appears to be unable to access any of its needed resources.However when escalating the traefik serviceaccount to
cluster-admin
for debug purposes, the issue goes away. Hence the permission are clearly not set as they are supposed to be.Doing this:
then gets me this in the logs:
In order to make sure that I had the RBAC permissions correctly set I also manually applied the one in the Traefik documentation which look like this:
But that did not help either.
What is your environment & configuration?
Bare metal RKE2 cluster version 1.24.14+rke2r1.
My rather lengthy
values.yaml
file is attached here. It is mostly copy-paste from the helm chart. The fact that traefik is deployed asClusterIP
with and externalIP and not with aLoadBalancer
is intentional. It also works nicely for the time being. But maybe I introduced some misconfiguration on the way?Additional Information
I am not quite sure if this is a bug related to the helm chart, to traefik, to the combination of traefik with RKE2 in my setup, or something else entirely. I decided to post it here since I used helm as installation method for
traefik
.In case you find this issue is not at the right place here, please let me know as well where I should rather put it.
Thanks anyone!