Giter Club home page Giter Club logo

Comments (6)

juliens avatar juliens commented on July 20, 2024 1

I made some tests.
In docker (on linux), if you mount a file, events are trigger on the file but not on the directory and for other problem we only watch the directory.

To address this, I implemented a solution. If you require a temporary workaround, consider mounting the directory in the docker-compose file instead of the individual file. This should help mitigate the observed issues.

from traefik.

ldez avatar ldez commented on July 20, 2024

Hello,

The documentation explains this inside the Limitations section: https://doc.traefik.io/traefik/providers/file/#provider-configuration

It's recommended to use directory instead of filename because filename can have issues with some filesystems.

from traefik.

darkweak avatar darkweak commented on July 20, 2024

@kevinpollet @ldez it still doesn't work using

providers:
  file:
    directory: /etc/traefik/dynamic
    watch: true

from traefik.

rtribotte avatar rtribotte commented on July 20, 2024

Hello @darkweak,

This is unexpected.
By looking at the config you have shared, I can see that the routers are using a middleware named souin but you didn’t share the definition of it nor the static part if it is indeed the souin plugin.
Can you please provide the full configuration needed to be able to try to reproduce the problem?

from traefik.

darkweak avatar darkweak commented on July 20, 2024

@rtribotte here is the minimal reproducible example

# ./dynamic-configuration.yml
http:
  routers:
    whoami-one:
      entrypoints:
        - http
      service: whoami1
      rule: Host(`whoami1.domain.com`)
    whoami-two:
      entrypoints:
        - http
      service: whoami2
      rule: Host(`whoami2.domain.com`)

  services:
    whoami1:
      loadBalancer:
        servers:
          - url: http://whoami1
        passHostHeader: false
    whoami2:
      loadBalancer:
        servers:
          - url: http://whoami2
        passHostHeader: false
# ./traefik.yml
providers:
  file:
    directory: /etc/traefik/dynamic
    watch: true

api:
  dashboard: true
  debug: true
  insecure: true

log:
  level: DEBUG

accessLog: {}
# ./compose.yml
version: '3'

services:
  traefik:
    image: traefik:v3.0
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./traefik.yml:/traefik.yml
      - ./dynamic-configuration.yml:/etc/traefik/dynamic/traefik-dynamic.yml
    ports:
      - 80:80
      - 8080:8080

  whoami1:
    image: traefik/whoami

  whoami2:
    image: traefik/whoami

If I update the ./dynamic-configuration.yml file (remove the whom-two router declaration and the whoami2 service declaration) and save the file changes nothing get reloaded in Træfik but I set the watch: true on the directory I put my dynamic configuration. Even without middlewares it doesn't get reloaded.
If I restart træfik, the new configuration get loaded well with only the whoami-one router and the whoami1 service.

from traefik.

traefiker avatar traefiker commented on July 20, 2024

Closed by #10420.

from traefik.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.