Error on traefik plugin install configuration in kubernetes

Hi Team,

I able to install the traefik plugins, But after installation getting below error.

helm chart : traefik-26.0.0 and traefik version: 2.10.6

traefik plugins: dkijkuit/checkheadersplugin version: v0.3.0

error :
failed to list and watch Provider connection error: could not retrieve server version

time="2024-01-23T12:03:31Z" level=error msg="Provider connection error: could not retrieve server version: Get "https://192.168.64.1:443/version\": Forbidden; retrying in 685.511192ms" providerName=kubernetes
W0123 12:03:31.575784 1 reflector.go:424] k8s.io/client-go@v0.26.3/tools/cache/reflector.go:169: failed to list *v1alpha1.IngressRoute: Get "https://192.168.64.1:443/apis/traefik.containo.us/v1alpha1/ingressroutes?limit=500&resourceVersion=0": Forbidden
E0123 12:03:31.575853 1 reflector.go:140] k8s.io/client-go@v0.26.3/tools/cache/reflector.go:169: Failed to watch *v1alpha1.IngressRoute: failed to list *v1alpha1.IngressRoute: Get "https://192.168.64.1:443/apis/traefik.containo.us/v1alpha1/ingressroutes?limit=500&resourceVersion=0": Forbidden
time="2024-01-23T12:03:31Z" level=error msg="Error watching kubernetes events: could not retrieve server version: Get "https://192.168.64.1:443/version\": Forbidden" providerName=kubernetes

time="2024-01-23T12:03:31Z" level=error msg="Provider connection error: could not retrieve server version: Get "https://192.168.64.1:443/version\": Forbidden; retrying in 685.511192ms" providerName=kubernetes

Hi ,

Any update on this.

Hi Team,

I couldnt find solution for this. Once plugin install im getting this error.


Hi Team,
Can you please update..

you need to apply the CRD, your POD didn't find the API applied by CRD

# Install Traefik Resource Definitions:
kubectl apply -f https://raw.githubusercontent.com/traefik/traefik/v2.11/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml

# Install RBAC for Traefik:
kubectl apply -f https://raw.githubusercontent.com/traefik/traefik/v2.11/docs/content/reference/dynamic-configuration/kubernetes-crd-rbac.yml

#Update after that with the Helm
helm upgrade traefik traefik/traefik --namespace=traefik --values=./traefik/traefik-chart-values.yaml

dont forget to change the namespace and the values path of your traefik if you have one, otherwise skip the upgrade and remove the pod and it will be created back by the deployment.

can you share you traefik values file

Hi ,

helm.sh/chart: traefik-26.0.0 - v2.10.6 Both RBAC, and cluster role permission is already configured. i didnt face issue before this plugins and its was working well.

Values.yaml i have enabled this.

experimental:

-- Enable traefik experimental plugins

plugins:
enabled: true
checkheadersplugin:
modulename: GitHub - dkijkuit/checkheadersplugin: This plugin checks the incoming request for specific headers and their values to be present and matching the configuration.
version: v0.3.0

container args as

in deployment file add this for proxy to install plugins.
envFrom:
- secretRef:
name: proxy-pass

After installation of this plugins only im getting all this failed error.

You need to add this section in your file

  - --providers.kubernetesingress.ingressclass=traefik-external
providers:
  kubernetesCRD:
    enabled: true
    namespaces: []
  kubernetesIngress:
    enabled: true
    namespaces: []
    publishedService:
      enabled: true

except the publishedservice others are already there.

      - --providers.kubernetescrd
      - --providers.kubernetesingress
      - --entrypoints.websecure.http.tls=true
      - --providers.kubernetesIngress.ingressClass=traefik-internal

@rivolity
Any update on this. to resolve this issue.