Routes with both Kubernetes Ingress and File provider

Hi,

I have several Kubernetes "IngressRoute" which already works great. Then I am trying to add more Routes but using "File Provider" instead ( dynamic configuration ). However, looks like the "Routes" I have defined at the "File Provider" one looks like not working. When I am looking at Traefik Dashboard, it is even not showing at all. I can only see the "Service" which I have defined at "File provider" too.

Based on the situation above, I have an assumption that, when I have one or more "IngressRoute" defined, then routes defined at "File Provider" will be ignored.

Following is my Questions:

  • Is my assumption right?
  • If it wrong, what is the possibility of mistakes I have made?
  • is "Routes" defined at "File Provider" should be visible at Traefik dashboard?

Following is my "Dynamic configuration" writting as YAML which loaded as "File provider"

http:
  routers:
    Router0:
      entryPoints:
        - websecure
      service: android-grpc
      rule: Host(`grpc-android.kitaon.xyz`)
  #I can see following "services" named "android-grpc@file" at dashboard, but not the Router definition above
  services:
    android-grpc:
      loadBalancer:
        servers:
          - url: https://android-service.mai.svc.cluster.local:5000

I hope someone here can help me solve or understanding Traefik Router problem. Thanks in advance.

Regards,
Bayu.

Hello,

The dynamic configuration can be:

  • labels (docker provider, rancher provider, ...)
  • files (file provider)
  • CRD (ingressRoute)
  • ...

https://docs.traefik.io/v2.1/getting-started/configuration-overview/#the-dynamic-configuration

If you are using files, the dynamic configuration and the static configuration must be defined in separated files.

Also the file provider need to be enable: https://docs.traefik.io/v2.1/providers/file/

Hi Idez,

Thanks for your prompt of reply. Will dig in to this further.

Regards,
Bayu.

apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: traefik
  namespace: kube-system
spec:
  valuesContent: |-
    additionalArguments:
      - --accesslog=true
      - --global.checknewversion
      - --providers.file.directory=/file
      - --entryPoints.vpn.address=:51820/udp
      - --entrypoints.web.http.redirections.entryPoint.to=:443
      - --entrypoints.web.http.redirections.entryPoint.scheme=https
    volumes:
      - name: config-file
        mountPath: file/
        type: configMap

enable provider

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-file
  namespace: kube-system
data:
  red.yaml: |-
    http:
      routers:
        red-router:
          entryPoints:
            - websecure
          service: red-service
          rule: Host(`domen.ru`)
      services:
        red-service:
          loadBalancer:
            servers:
            - url: http://192.168.88.3:1880

and config

it's on k3s

the provider is working - http is working

but I couldn't make udp - I don't know why