A dynamic docker->redis->traefik discovery agent

traefik-kop

A dynamic docker->redis->traefik discovery agent.

Solves the problem of running a non-Swarm/Kubernetes multi-host cluster with a single public-facing traefik instance. For example:

                        +---------------------+          +---------------------+
                        |                     |          |                     |
+---------+     :443    |  +---------+        |   :8088  |  +------------+     |
|   WAN   |--------------->| traefik |<-------------------->| svc-nginx  |     |
+---------+             |  +---------+        |          |  +------------+     |
                        |       |             |          |                     |
                        |  +---------+        |          |  +-------------+    |
                        |  |  redis  |<-------------------->| traefik-kop |    |
                        |  +---------+        |          |  +-------------+    |
                        |             docker1 |          |             docker2 |
                        +---------------------+          +---------------------+

traefik-kop solves this problem by using the same traefik docker-provider logic. It reads the container labels from the local docker node and publishes them to a given redis instance. Simply configure your traefik node with a redis provider and point it to the same instance, as in the diagram above.

Usage

Configure traefik to use the redis provider:

providers:
  providersThrottleDuration: 2s
  docker:
    watch: true
    endpoint: unix:///var/run/docker.sock
    swarmModeRefreshSeconds: 15s
    exposedByDefault: false
  redis:
    endpoints:
      # assumes a redis link with this service name running on the same
      # docker host as traefik
      - "redis:6379"

Run traefik-kop on your other nodes via docker-compose:

version: "3"
services:
  nginx:
    image: "ghcr.io/jittering/traefik-kop:latest"
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - "REDIS_ADDR=192.168.1.50:6379"
      - "BIND_IP=192.168.1.75"

Configuration

traefik-kop can be configured via either CLI flags are environment variables.

USAGE:
   traefik-kop [global options] command [command options] [arguments...]

GLOBAL OPTIONS:
   --hostname value    Hostname to identify this node in redis (default: "culture.local") [$KOP_HOSTNAME]
   --bind-ip value     IP address to bind services to (default: "192.168.80.99") [$BIND_IP]
   --redis-addr value  Redis address (default: "127.0.0.1:6379") [$REDIS_ADDR]
   --redis-pass value  Redis password (if needed) [$REDIS_PASS]
   --redis-db value    Redis DB number (default: 0) [$REDIS_DB]
   --verbose           Enable debug logging (default: false) [$VERBOSE, $DEBUG]
   --help, -h          show help (default: false)

Most important are the bind-ip and redis-addr flags.

bind-ip

Since your upstream docker nodes are external to your primary traefik server, traefik needs to connect to these services via the server's public IP rather than the usual method of using the internal docker-network IPs (by default 172.20.0.x or similar).

When using host networking this can be auto-detected, however it is advisable in the majority of cases to manually set this to the desired IP address. This can be done using the docker image by exporting the BIND_IP environment variable.

License

traefik-kop: MIT, (c) 2021, Pixelcop Research, Inc.

traefik: MIT, (c) 2016-2020 Containous SAS; 2020-2021 Traefik Labs

Comments
  • Not working with containers that have healthchecks

    Not working with containers that have healthchecks

    traefik-kop works very well in my self-hosted setup. Many thanks for this tool.

    However recently I started adding healthchecks to my containers and traefik-kop doesn't seem to play well with that.

    With debug enabled I see the log events

    time="2022-04-25T14:56:29Z" level=debug msg="Provider event received {Status:start ID:000c8368443c4b636486602894299be6ac6db31cc19e3df91f76521c6a8ef235 From:docker.io/photostructure/server:beta Type:container Action:start Actor:{ID:000c8368443c4b636486602894299be6ac6db31cc19e3df91f76521c6a8ef235 Attributes:map[containerExitCode:0 image:docker.io/photostructure/server:beta <LABELS OMITTED>]} Scope:local Time:1650898589 TimeNano:1650898589195815495}" providerName=docker
    
    time="2022-04-25T14:56:29Z" level=debug msg="Filtering unhealthy or starting container" providerName=docker container=photostructure-000c8368443c4b636486602894299be6ac6db31cc19e3df91f76521c6a8ef235
    

    Basically it seems traefik-kop is detecting the container start, but at the beginning the container is in the starting state, and after some seconds gets promoted to the healthy state. But traefik-kop is never picking up the state transition from starting -> healthy.

    If I restart traefik-kop after the container is healthy, traefik-kop detects it just fine.

    FWIW I am running this with podman, not docker (by mounting the podman socket into the container as you would with docker). This has worked fine thus far.

  • setting port for tcp service does not work

    setting port for tcp service does not work

    Hey :)

    I have this configuration

    version: "3"
    
    services:
      gitea:
        image: gitea/gitea
        ports:
          - "20080:3000"
          - "20022:22"
        labels:
          traefik.enable: true
          traefik.http.routers.gitea.rule: "Host(`git.domain`)"
          traefik.http.routers.gitea.entrypoints: webs
          traefik.http.routers.gitea.service: gitea@redis
          traefik.http.services.gitea.loadbalancer.server.port: 20080
    
          traefik.tcp.routers.gitea-ssh.rule: "HostSNI(`*`)"
          traefik.tcp.routers.gitea-ssh.entrypoints: ssh
          traefik.tcp.routers.gitea-ssh.service: gitea-ssh@redis
          traefik.tcp.services.gitea-ssh.loadbalancer.server.port: 20022
    

    The port of the gitea-ssh service is not detected correctly: image

    And this is the log:

    traefik-kop-traefik-kop-1  | time="2022-09-28T12:37:14Z" level=warning msg="found more than one host-port binding for container '/gitea-gitea-1' (20022:22, 20080:3000)" service-type=tcp service=gitea-ssh@docker
    
  • Default Rule

    Default Rule

    Is it possible to add a defaultRule? Like the docker provider:

    defaultRule: "Host(`srv-{{ index .Labels \"com.docker.compose.service\"}}.example.com`)"
    

    Would be very helpfull.

  • Provide IP for each docker via label

    Provide IP for each docker via label

    It would be nice to add for each docker a own "bind_ip". Maybe via label. So that you can multiple IPs. example:

    labels:
        kop.bind.ip: 10.10.10.16
        ...
    

    If you don't have this feature you need a second reverse-proxy, or not?

  • Docker automatic port map not recognized

    Docker automatic port map not recognized

    When a port is automatically assigned by the docker, Traefik Kop does not recognize the port and uses the image port

    Option "Publish all exposed network ports to random host ports"

    test | healthy |   | - | registry.domain.cz/webcore:latest | 2022-02-03 23:26:20 | 172.20.1.8 | 49157:80 traefik.enable | true traefik.http.routers.test.rule | host(test.domain.cz)

    test2 | healthy |   | - | registry.domain.cz/webcore:latest | 2022-02-06 14:29:25 | 172.20.1.9 | 49159:80 traefik.enable | true traefik.http.routers.test2.rule | host(test2.domain.cz)

    Test is manualy set, Test2 is set by docker traefik/http/services/test/loadBalancer/servers/0/urls: http://10.0.10.20:49154 traefik/http/services/test2/loadBalancer/servers/0/url: http://10.0.10.20:80

  • Go Crash in hostedtoolcache

    Go Crash in hostedtoolcache

    I'm getting the following crash:

    time="2022-09-09T04:17:55Z" level=info msg="creating new redis store at 10.0.0.1:6379 for hostname solarflare"
    time="2022-09-09T04:17:55Z" level=info msg="Starting provider aggregator *traefikkop.MultiProvider"
    time="2022-09-09T04:17:55Z" level=info msg="starting polling provider with 15s interval"
    time="2022-09-09T04:17:55Z" level=info msg="Starting provider *docker.Provider"
    time="2022-09-09T04:17:55Z" level=error msg="Undefined rule" providerName=docker routerName=jellyfin
    time="2022-09-09T04:17:55Z" level=info msg="refreshing traefik-kop configuration"
    time="2022-09-09T04:17:55Z" level=warning msg="found more than one host-port binding for container '/jellyfin'"
    time="2022-09-09T04:18:10Z" level=error msg="Error in Go routine: runtime error: invalid memory address or nil pointer dereference"
    time="2022-09-09T04:18:10Z" level=error msg="Stack: goroutine 51 [running]:\nruntime/debug.Stack()\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/debug/stack.go:24 +0x65\ngithub.com/traefik/traefik/v2/pkg/safe.defaultRecoverGoroutine({0x22e8360, 0x3f34520})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:66 +0xa5\ngithub.com/traefik/traefik/v2/pkg/safe.OperationWithRecover.func1.1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:74 +0x35\npanic({0x22e8360, 0x3f34520})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/panic.go:1038 +0x215\ntext/template.errRecover(0xc0005672c0)\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:163 +0x15b\npanic({0x22e8360, 0x3f34520})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/panic.go:1038 +0x215\ntext/template.(*Template).execute(0x0, {0x2b022e0, 0xc000c4acc0}, {0x239f960, 0xc000c47500})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:214 +0x239\ntext/template.(*Template).Execute(...)\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:200\ngithub.com/traefik/traefik/v2/pkg/provider.BuildRouterConfiguration({0x2b4c9e8, 0xc000c35f80}, 0xc000c4aab0, {0xc000c36978, 0xc000c3db80}, 0x9, {0x239f960, 0xc000c47500})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/configuration.go:404 +0x2d1\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).buildConfiguration(0xc00034e000, {0x2b4c9e8, 0xc000c35f80}, {0xc000c507e0, 0x2, 0xc000c3d860})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/config.go:83 +0x7a5\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).Provide.func1.1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/docker.go:230 +0x69a\ngithub.com/traefik/traefik/v2/pkg/safe.OperationWithRecover.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:78 +0x63\ngithub.com/cenkalti/backoff/v4.RetryNotifyWithTimer(0xc000412890, {0x7fad5b3e2258, 0xc000092200}, 0xc000567f20, {0x0, 0x0})\n\t/home/runner/go/pkg/mod/github.com/cenkalti/backoff/[email protected]/retry.go:55 +0x12a\ngithub.com/cenkalti/backoff/v4.RetryNotify(...)\n\t/home/runner/go/pkg/mod/github.com/cenkalti/backoff/[email protected]/retry.go:34\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).Provide.func1({0x2b4c940, 0xc0000585c0})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/docker.go:330 +0x305\ngithub.com/traefik/traefik/v2/pkg/safe.(*Pool).GoCtx.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:36 +0x66\ngithub.com/traefik/traefik/v2/pkg/safe.GoWithRecover.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:59 +0x5b\ncreated by github.com/traefik/traefik/v2/pkg/safe.GoWithRecover\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:53 +0x77\n"
    time="2022-09-09T04:18:10Z" level=error msg="Provider connection error panic in operation: %!w(<nil>), retrying in 688.725732ms" providerName=docker
    time="2022-09-09T04:18:11Z" level=error msg="Error in Go routine: runtime error: invalid memory address or nil pointer dereference"
    time="2022-09-09T04:18:11Z" level=error msg="Stack: goroutine 51 [running]:\nruntime/debug.Stack()\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/debug/stack.go:24 +0x65\ngithub.com/traefik/traefik/v2/pkg/safe.defaultRecoverGoroutine({0x22e8360, 0x3f34520})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:66 +0xa5\ngithub.com/traefik/traefik/v2/pkg/safe.OperationWithRecover.func1.1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:74 +0x35\npanic({0x22e8360, 0x3f34520})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/panic.go:1038 +0x215\ntext/template.errRecover(0xc0005672c0)\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:163 +0x15b\npanic({0x22e8360, 0x3f34520})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/panic.go:1038 +0x215\ntext/template.(*Template).execute(0x0, {0x2b022e0, 0xc000c4b890}, {0x239f960, 0xc000c76498})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:214 +0x239\ntext/template.(*Template).Execute(...)\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:200\ngithub.com/traefik/traefik/v2/pkg/provider.BuildRouterConfiguration({0x2b4c9e8, 0xc000c35f80}, 0xc000c4b680, {0xc000c36e58, 0xc000c5c6b5}, 0x9, {0x239f960, 0xc000c76498})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/configuration.go:404 +0x2d1\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).buildConfiguration(0xc00034e000, {0x2b4c9e8, 0xc000c35f80}, {0xc000c7a000, 0x2, 0xc00081bd40})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/config.go:83 +0x7a5\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).Provide.func1.1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/docker.go:230 +0x69a\ngithub.com/traefik/traefik/v2/pkg/safe.OperationWithRecover.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:78 +0x63\ngithub.com/cenkalti/backoff/v4.RetryNotifyWithTimer(0xc000412890, {0x7fad5b3e2258, 0xc000092200}, 0xc000567f20, {0x0, 0x0})\n\t/home/runner/go/pkg/mod/github.com/cenkalti/backoff/[email protected]/retry.go:55 +0x12a\ngithub.com/cenkalti/backoff/v4.RetryNotify(...)\n\t/home/runner/go/pkg/mod/github.com/cenkalti/backoff/[email protected]/retry.go:34\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).Provide.func1({0x2b4c940, 0xc0000585c0})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/docker.go:330 +0x305\ngithub.com/traefik/traefik/v2/pkg/safe.(*Pool).GoCtx.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:36 +0x66\ngithub.com/traefik/traefik/v2/pkg/safe.GoWithRecover.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:59 +0x5b\ncreated by github.com/traefik/traefik/v2/pkg/safe.GoWithRecover\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:53 +0x77\n"
    time="2022-09-09T04:18:11Z" level=error msg="Provider connection error panic in operation: %!w(<nil>), retrying in 428.49889ms" providerName=docker
    time="2022-09-09T04:18:11Z" level=error msg="Error in Go routine: runtime error: invalid memory address or nil pointer dereference"
    time="2022-09-09T04:18:11Z" level=error msg="Stack: goroutine 51 [running]:\nruntime/debug.Stack()\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/debug/stack.go:24 +0x65\ngithub.com/traefik/traefik/v2/pkg/safe.defaultRecoverGoroutine({0x22e8360, 0x3f34520})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:66 +0xa5\ngithub.com/traefik/traefik/v2/pkg/safe.OperationWithRecover.func1.1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:74 +0x35\npanic({0x22e8360, 0x3f34520})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/panic.go:1038 +0x215\ntext/template.errRecover(0xc0005672c0)\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:163 +0x15b\npanic({0x22e8360, 0x3f34520})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/panic.go:1038 +0x215\ntext/template.(*Template).execute(0x0, {0x2b022e0, 0xc000c8c6f0}, {0x239f960, 0xc000c77380})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:214 +0x239\ntext/template.(*Template).Execute(...)\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:200\ngithub.com/traefik/traefik/v2/pkg/provider.BuildRouterConfiguration({0x2b4c9e8, 0xc000c35f80}, 0xc000c8c4e0, {0xc000c37428, 0xc000c5d1f0}, 0x9, {0x239f960, 0xc000c77380})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/configuration.go:404 +0x2d1\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).buildConfiguration(0xc00034e000, {0x2b4c9e8, 0xc000c35f80}, {0xc000c7bc20, 0x2, 0xc000c5ced0})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/config.go:83 +0x7a5\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).Provide.func1.1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/docker.go:230 +0x69a\ngithub.com/traefik/traefik/v2/pkg/safe.OperationWithRecover.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:78 +0x63\ngithub.com/cenkalti/backoff/v4.RetryNotifyWithTimer(0xc000412890, {0x7fad5b3e2258, 0xc000092200}, 0xc000567f20, {0x0, 0x0})\n\t/home/runner/go/pkg/mod/github.com/cenkalti/backoff/[email protected]/retry.go:55 +0x12a\ngithub.com/cenkalti/backoff/v4.RetryNotify(...)\n\t/home/runner/go/pkg/mod/github.com/cenkalti/backoff/[email protected]/retry.go:34\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).Provide.func1({0x2b4c940, 0xc0000585c0})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/docker.go:330 +0x305\ngithub.com/traefik/traefik/v2/pkg/safe.(*Pool).GoCtx.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:36 +0x66\ngithub.com/traefik/traefik/v2/pkg/safe.GoWithRecover.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:59 +0x5b\ncreated by github.com/traefik/traefik/v2/pkg/safe.GoWithRecover\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:53 +0x77\n"
    time="2022-09-09T04:18:11Z" level=error msg="Provider connection error panic in operation: %!w(<nil>), retrying in 1.26916156s" providerName=docker
    time="2022-09-09T04:18:12Z" level=error msg="Error in Go routine: runtime error: invalid memory address or nil pointer dereference"
    time="2022-09-09T04:18:12Z" level=error msg="Stack: goroutine 51 [running]:\nruntime/debug.Stack()\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/debug/stack.go:24 +0x65\ngithub.com/traefik/traefik/v2/pkg/safe.defaultRecoverGoroutine({0x22e8360, 0x3f34520})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:66 +0xa5\ngithub.com/traefik/traefik/v2/pkg/safe.OperationWithRecover.func1.1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:74 +0x35\npanic({0x22e8360, 0x3f34520})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/panic.go:1038 +0x215\ntext/template.errRecover(0xc0005672c0)\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:163 +0x15b\npanic({0x22e8360, 0x3f34520})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/panic.go:1038 +0x215\ntext/template.(*Template).execute(0x0, {0x2b022e0, 0xc000c8d530}, {0x239f960, 0xc000cb8270})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:214 +0x239\ntext/template.(*Template).Execute(...)\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:200\ngithub.com/traefik/traefik/v2/pkg/provider.BuildRouterConfiguration({0x2b4c9e8, 0xc000c35f80}, 0xc000c8d320, {0xc000c379f8, 0xc000c5dd20}, 0x9, {0x239f960, 0xc000cb8270})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/configuration.go:404 +0x2d1\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).buildConfiguration(0xc00034e000, {0x2b4c9e8, 0xc000c35f80}, {0xc000c957a0, 0x2, 0xc000c5da00})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/config.go:83 +0x7a5\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).Provide.func1.1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/docker.go:230 +0x69a\ngithub.com/traefik/traefik/v2/pkg/safe.OperationWithRecover.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:78 +0x63\ngithub.com/cenkalti/backoff/v4.RetryNotifyWithTimer(0xc000412890, {0x7fad5b3e2258, 0xc000092200}, 0xc000567f20, {0x0, 0x0})\n\t/home/runner/go/pkg/mod/github.com/cenkalti/backoff/[email protected]/retry.go:55 +0x12a\ngithub.com/cenkalti/backoff/v4.RetryNotify(...)\n\t/home/runner/go/pkg/mod/github.com/cenkalti/backoff/[email protected]/retry.go:34\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).Provide.func1({0x2b4c940, 0xc0000585c0})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/docker.go:330 +0x305\ngithub.com/traefik/traefik/v2/pkg/safe.(*Pool).GoCtx.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:36 +0x66\ngithub.com/traefik/traefik/v2/pkg/safe.GoWithRecover.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:59 +0x5b\ncreated by github.com/traefik/traefik/v2/pkg/safe.GoWithRecover\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:53 +0x77\n"
    time="2022-09-09T04:18:12Z" level=error msg="Provider connection error panic in operation: %!w(<nil>), retrying in 1.094560521s" providerName=docker
    time="2022-09-09T04:18:14Z" level=error msg="Error in Go routine: runtime error: invalid memory address or nil pointer dereference"
    time="2022-09-09T04:18:14Z" level=error msg="Stack: goroutine 51 [running]:\nruntime/debug.Stack()\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/debug/stack.go:24 +0x65\ngithub.com/traefik/traefik/v2/pkg/safe.defaultRecoverGoroutine({0x22e8360, 0x3f34520})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:66 +0xa5\ngithub.com/traefik/traefik/v2/pkg/safe.OperationWithRecover.func1.1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:74 +0x35\npanic({0x22e8360, 0x3f34520})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/panic.go:1038 +0x215\ntext/template.errRecover(0xc0005672c0)\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:163 +0x15b\npanic({0x22e8360, 0x3f34520})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/panic.go:1038 +0x215\ntext/template.(*Template).execute(0x0, {0x2b022e0, 0xc000cc8390}, {0x239f960, 0xc000cb9158})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:214 +0x239\ntext/template.(*Template).Execute(...)\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:200\ngithub.com/traefik/traefik/v2/pkg/provider.BuildRouterConfiguration({0x2b4c9e8, 0xc000c35f80}, 0xc000cc8180, {0xc000c37fc8, 0xc000cb6870}, 0x9, {0x239f960, 0xc000cb9158})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/configuration.go:404 +0x2d1\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).buildConfiguration(0xc00034e000, {0x2b4c9e8, 0xc000c35f80}, {0xc000cbb440, 0x2, 0xc000cb6550})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/config.go:83 +0x7a5\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).Provide.func1.1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/docker.go:230 +0x69a\ngithub.com/traefik/traefik/v2/pkg/safe.OperationWithRecover.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:78 +0x63\ngithub.com/cenkalti/backoff/v4.RetryNotifyWithTimer(0xc000412890, {0x7fad5b3e2258, 0xc000092200}, 0xc000567f20, {0x0, 0x0})\n\t/home/runner/go/pkg/mod/github.com/cenkalti/backoff/[email protected]/retry.go:55 +0x12a\ngithub.com/cenkalti/backoff/v4.RetryNotify(...)\n\t/home/runner/go/pkg/mod/github.com/cenkalti/backoff/[email protected]/retry.go:34\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).Provide.func1({0x2b4c940, 0xc0000585c0})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/docker.go:330 +0x305\ngithub.com/traefik/traefik/v2/pkg/safe.(*Pool).GoCtx.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:36 +0x66\ngithub.com/traefik/traefik/v2/pkg/safe.GoWithRecover.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:59 +0x5b\ncreated by github.com/traefik/traefik/v2/pkg/safe.GoWithRecover\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:53 +0x77\n"
    time="2022-09-09T04:18:14Z" level=error msg="Provider connection error panic in operation: %!w(<nil>), retrying in 2.887338751s" providerName=docker
    time="2022-09-09T04:18:16Z" level=error msg="Error in Go routine: runtime error: invalid memory address or nil pointer dereference"
    time="2022-09-09T04:18:16Z" level=error msg="Stack: goroutine 51 [running]:\nruntime/debug.Stack()\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/debug/stack.go:24 +0x65\ngithub.com/traefik/traefik/v2/pkg/safe.defaultRecoverGoroutine({0x22e8360, 0x3f34520})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:66 +0xa5\ngithub.com/traefik/traefik/v2/pkg/safe.OperationWithRecover.func1.1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:74 +0x35\npanic({0x22e8360, 0x3f34520})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/panic.go:1038 +0x215\ntext/template.errRecover(0xc0005672c0)\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:163 +0x15b\npanic({0x22e8360, 0x3f34520})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/runtime/panic.go:1038 +0x215\ntext/template.(*Template).execute(0x0, {0x2b022e0, 0xc000d0a630}, {0x239f960, 0xc0008d9b48})\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:214 +0x239\ntext/template.(*Template).Execute(...)\n\t/opt/hostedtoolcache/go/1.17.11/x64/src/text/template/exec.go:200\ngithub.com/traefik/traefik/v2/pkg/provider.BuildRouterConfiguration({0x2b4c9e8, 0xc000c35f80}, 0xc000d0a420, {0xc000133b90, 0xc0008f4935}, 0x9, {0x239f960, 0xc0008d9b48})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/configuration.go:404 +0x2d1\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).buildConfiguration(0xc00034e000, {0x2b4c9e8, 0xc000c35f80}, {0xc000d14240, 0x2, 0xc000918d10})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/config.go:83 +0x7a5\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).Provide.func1.1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/docker.go:230 +0x69a\ngithub.com/traefik/traefik/v2/pkg/safe.OperationWithRecover.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:78 +0x63\ngithub.com/cenkalti/backoff/v4.RetryNotifyWithTimer(0xc000412890, {0x7fad5b3e2258, 0xc000092200}, 0xc000567f20, {0x0, 0x0})\n\t/home/runner/go/pkg/mod/github.com/cenkalti/backoff/[email protected]/retry.go:55 +0x12a\ngithub.com/cenkalti/backoff/v4.RetryNotify(...)\n\t/home/runner/go/pkg/mod/github.com/cenkalti/backoff/[email protected]/retry.go:34\ngithub.com/traefik/traefik/v2/pkg/provider/docker.(*Provider).Provide.func1({0x2b4c940, 0xc0000585c0})\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/provider/docker/docker.go:330 +0x305\ngithub.com/traefik/traefik/v2/pkg/safe.(*Pool).GoCtx.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:36 +0x66\ngithub.com/traefik/traefik/v2/pkg/safe.GoWithRecover.func1()\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:59 +0x5b\ncreated by github.com/traefik/traefik/v2/pkg/safe.GoWithRecover\n\t/home/runner/go/pkg/mod/github.com/traefik/traefik/[email protected]/pkg/safe/routine.go:53 +0x77\n"
    time="2022-09-09T04:18:16Z" level=error msg="Provider connection error panic in operation: %!w(<nil>), retrying in 2.881082061s" providerName=docker
    
  • Error invalid syntax providerName=docker

    Error invalid syntax providerName=docker

    Hello,

    I have a problem. I have Traefik running in my HomeLab on a Docker Swarm cluster. Traefik of course uses the Docker provider for this.

    For this I then did the configuration as described for traefik-kop. Redis with on the Docker cluster.

    The container mut the docker-kop runs on my Synology NAS. Now when I start another container with NGINX and traefik label on the Synology NAS, I get the following error message.

    Any idea what can be wrong? You can't really do much wrong with the syntax.

    time="2022-04-30T22:52:32Z" level=info msg="Starting provider aggregator.ProviderAggregator {}"
    time="2022-04-30T22:52:32Z" level=info msg="Starting provider *docker.Provider {\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"swarmModeRefreshSeconds\":\"15s\"}"
    time="2022-04-30T22:52:32Z" level=error msg="Skip container nginx-traefik-central: strconv.ParseBool: parsing \"true\\\"\": invalid syntax" providerName=docker
    time="2022-04-30T22:52:32Z" level=info msg="refreshing configuration"
    time="2022-04-30T22:54:54Z" level=info msg="Skipping same configuration" providerName=docker
    time="2022-04-30T22:56:55Z" level=error msg="Skip container nginx01-traefik-central: strconv.ParseBool: parsing \"true\\\"\": invalid syntax" providerName=docker
    time="2022-04-30T22:56:55Z" level=info msg="Skipping same configuration" providerName=docker
    time="2022-04-30T23:03:15Z" level=error msg="Skip container nginx01-traefik-central: strconv.ParseBool: parsing \"true\\\"\": invalid syntax" providerName=docker
    time="2022-04-30T23:03:19Z" level=info msg="Skipping same configuration" providerName=docker
    time="2022-04-30T23:04:31Z" level=info msg="Skipping same configuration" providerName=docker
    time="2022-04-30T23:05:18Z" level=error msg="Skip container nginx01-test: strconv.ParseBool: parsing \"true\\\"\": invalid syntax" providerName=docker
    time="2022-04-30T23:05:18Z" level=info msg="Skipping same configuration" providerName=docker
    

    Thank you

    best regards

  • Troubleshooting Setup

    Troubleshooting Setup

    Hi Cheten,

    Thank you for creating this agent!

    I've attempted to install and use Traefik-kop but so far I've been unable to make Traefik detect the remote service. I suspect a configuration issue somewhere so I've copied below my setup in case you can spot an issue. Could you suggest any methods to test connectivity between the hosts please?

    So far I have two physical Docker hosts - dnuca with Traefik and dnucb with a Firefox container.

    dnuca has the following Traefik and redis conatainer config (I use labels for Traefik configuration) (Host IP: 192.168.1.107)

    version: "3.8"
    
    networks:
      t2_proxy:
        external:
          name: t2_proxy
      default:
        driver: bridge
      socket_proxy:
        external:
          name: socket_proxy
    
     traefik:
        container_name: traefik
        image: traefik
        restart: unless-stopped
        command: # CLI arguments
          - --global.checkNewVersion=true
          - --global.sendAnonymousUsage=true
          - --entryPoints.http.address=:80
          - --entryPoints.https.address=:443
            # Allow these IPs to set the X-Forwarded-* headers - Cloudflare IPs: https://www.cloudflare.com/ips/
          - --entrypoints.https.forwardedHeaders.trustedIPs=173.245.48.0/20,103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,141.101.64.0/18,108.162.192.0/18,190.93.240.0/20,188.114.96.0/20,197.234.240.0/22,198.41.128.0/17,162.158.0.0/15,104.16.0.0/13,104.24.0.0/14,172.64.0.0/13,131.0.72.0/22
          - --entryPoints.traefik.address=:8080
          - --api=true
          - --api.dashboard=true
          - --log=true
          - --log.level=INFO # (Default: error) DEBUG, INFO, WARN, ERROR, FATAL, PANIC
          - --accessLog=true
          - --accessLog.filePath=/traefik.log
          - --accessLog.bufferingSize=100 # Configuring a buffer of 100 lines
          - --accessLog.filters.statusCodes=400-499
          - --providers.docker=true
          - --providers.docker.endpoint=tcp://socket-proxy:2375
          - --providers.docker.exposedByDefault=false
          - --providers.docker.network=t2_proxy
          - --providers.docker.swarmMode=false
          - --providers.file.directory=/rules # Load dynamic configuration from one or more .toml or .yml files in a directory
          - --providers.file.watch=true # Only works on top level files in the rules folder
          - --providers.providersThrottleDuration=2s
          - --providers.redis.endpoints=redis:6379
          - --entrypoints.https.http.tls.options=tls-opts@file
          - --entrypoints.https.http.tls.certresolver=dns-cloudflare
          - --entrypoints.https.http.tls.domains[0].main=$DOMAINNAME # Pulls main cert for second domain
          - --entrypoints.https.http.tls.domains[0].sans=*.$DOMAINNAME # Pulls wildcard cert for second domain
          # - --certificatesResolvers.dns-cloudflare.acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory # LetsEncrypt Staging Server - uncomment when testing
          - --certificatesResolvers.dns-cloudflare.acme.email=$CLOUDFLARE_EMAIL
          - --certificatesResolvers.dns-cloudflare.acme.storage=/acme.json
          - --certificatesResolvers.dns-cloudflare.acme.dnsChallenge.provider=cloudflare
          - --certificatesResolvers.dns-cloudflare.acme.dnsChallenge.resolvers=1.1.1.1:53,1.0.0.1:53
          - --certificatesResolvers.dns-cloudflare.acme.dnsChallenge.delayBeforeCheck=90 # To delay DNS check and reduce LE hitrate
        networks:
          t2_proxy:
            ipv4_address: 192.168.90.254 # You can specify a static IP
          socket_proxy:
        depends_on:
          - socket-proxy
          - oauth
        security_opt:
          - no-new-privileges:true
        ports:
          - target: 80
            published: 80
            protocol: tcp
            mode: host
          - target: 443
            published: 443
            protocol: tcp
            mode: host
        volumes:
          - $DOCKERDIR/traefik2/rules:/rules # file provider directory
          # - /var/run/docker.sock:/var/run/docker.sock:ro # Use Docker Socket Proxy instead for improved security
          - $DOCKERDIR/traefik2/acme/acme.json:/acme.json # cert location - you must touch this file and change permissions to 600
          - $DOCKERDIR/traefik2/traefik.log:/traefik.log # for fail2ban - make sure to touch file before starting container
          - $DOCKERDIR/shared:/shared
        environment:
          - CF_API_EMAIL_FILE=/run/secrets/cloudflare_email
          - CF_API_KEY_FILE=/run/secrets/cloudflare_api_key
        secrets:
          - cloudflare_email
          - cloudflare_api_key
        labels:
          - "com.centurylinklabs.watchtower.enable=true"
          - "traefik.enable=true"
          # HTTP-to-HTTPS Redirect
          - "traefik.http.routers.http-catchall.entrypoints=http"
          - "traefik.http.routers.http-catchall.rule=HostRegexp(`{host:.+}`)"
          - "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
          - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
          # HTTP Routers
          - "traefik.http.routers.traefik-rtr.entrypoints=https"
          - "traefik.http.routers.traefik-rtr.rule=Host(`traefik.$DOMAINNAME`)"
          - "traefik.http.routers.traefik-rtr.tls=true"
          ## Services - API
          - "traefik.http.routers.traefik-rtr.service=api@internal"
          ## Middlewares
          - "traefik.http.routers.traefik-rtr.middlewares=chain-authelia@file"
    
      redis:
        image: redis
        container_name: redis
        restart: always
        ports:
          - "6379:6379"
        environment:
          - REDIS_REPLICATION_MODE=master
        volumes:
          - $DOCKERDIR/redis:/data
        networks:
          t2_proxy:
    

    dnucb host (Host IP 192.168.1.32):

    version: "3.8"
    
    networks:
      t2_proxy:
        external:
          name: t2_proxy
      default:
        driver: bridge
    
    services:
      firefox:
        image: jlesage/firefox:latest
        container_name: firefox
        restart: unless-stopped
        networks:
          - t2_proxy
        security_opt:
          - no-new-privileges:true
          - seccomp:unconfined 
        ports:
          - "9007:5800"
        volumes:
          - $DOCKERDIR/firefox:/config
          - /dev/shm:/dev/shm
          - $DOCKERDIR/shared:/shared
        environment:
          USER_ID: $PUID
          GROUP_ID: $PGID
          TZ: $TZ
          UMASK: 002
          KEEP_APP_RUNNING: 1
          CLEAN_TMP_DIR: 1
          DISPLAY_WIDTH: 1440
          DISPLAY_HEIGHT: 900
          VNC_PASSWD: $FIREFOX_VNC_PASSWD
        labels:
          - "com.centurylinklabs.watchtower.enable=true"
          - "traefik.enable=true"
          ## HTTP Routers
          - "traefik.http.routers.firefox-rtr.entrypoints=https"
          - "traefik.http.routers.firefox-rtr.rule=Host(`firefox.$DOMAINNAME`)"
          - "traefik.http.routers.firefox-rtr.tls=true"
          ## Middlewares
          - "traefik.http.routers.firefox-rtr.middlewares=chain-authelia@file"
          ## HTTP Services
          - "traefik.http.routers.firefox-rtr.service=firefox-svc"
          - "traefik.http.services.firefox-svc.loadbalancer.server.port=9007"
    
      traefik-kop:
        image: "ghcr.io/jittering/traefik-kop:latest"
        container_name: traefik-kop
        restart: unless-stopped
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock
        environment:
          - "REDIS_ADDR=192.168.1.107:6379"
          - "BIND_IP=192.168.1.32"
    

    Verbose logs from Traefik-top:

    today at 19:23:50time="2022-01-23T19:23:50Z" level=info msg="Starting provider aggregator.ProviderAggregator {}"
    today at 19:23:50time="2022-01-23T19:23:50Z" level=info msg="Starting provider *docker.Provider {\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"swarmModeRefreshSeconds\":\"15s\"}"
    today at 19:23:50time="2022-01-23T19:23:50Z" level=debug msg="Provider connection established with docker 20.10.12 (API 1.41)" providerName=docker
    today at 19:23:50time="2022-01-23T19:23:50Z" level=debug msg="Filtering disabled container" container=traefik-kop-docker-c51df9724828ba18f2add6b70644cf8f5781f6da7272c0e5eb459a0bde83032b providerName=docker
    today at 19:23:50time="2022-01-23T19:23:50Z" level=debug msg="Filtering disabled container" providerName=docker container=dozzle-docker-422c096b8822c83fbb62785969680a64c31a071dd1a6f701e66b83bb26182b44
    today at 19:23:50time="2022-01-23T19:23:50Z" level=debug msg="Configuration received from provider docker: {\"http\":{\"routers\":{\"firefox-rtr\":{\"entryPoints\":[\"https\"],\"middlewares\":[\"chain-authelia@file\"],\"service\":\"firefox-svc\",\"rule\":\"Host(`firefox.mydomain.com`)\",\"tls\":{}}},\"services\":{\"firefox-svc\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.18.0.2:9007\"}],\"passHostHeader\":true}}}},\"tcp\":{},\"udp\":{}}" providerName=docker
    today at 19:23:50time="2022-01-23T19:23:50Z" level=info msg="refreshing configuration"
    today at 19:23:50time="2022-01-23T19:23:50Z" level=debug msg="found http service: firefox-svc@docker"
    today at 19:23:50time="2022-01-23T19:23:50Z" level=debug msg="found router firefox-rtr for service firefox-svc"
    today at 19:23:50time="2022-01-23T19:23:50Z" level=debug msg="found container '/firefoxdsrv2' (d8f4504b5cb862c596eb54a0004d2cc4a8174b2c303f15f38812969f61e11fa1) for service 'firefox-svc'"
    today at 19:23:50time="2022-01-23T19:23:50Z" level=debug msg="using explicitly set port 9007 for firefox-svc"
    today at 19:23:50time="2022-01-23T19:23:50Z" level=debug msg="writing traefik/http/routers/firefox-rtr/service = firefox-svc"
    today at 19:23:50time="2022-01-23T19:23:50Z" level=debug msg="writing traefik/http/routers/firefox-rtr/rule = Host(`firefox.mydomain.com`)"
    today at 19:23:50time="2022-01-23T19:23:50Z" level=debug msg="writing traefik/http/services/firefox-svc/loadBalancer/servers/0/url = http://192.168.1.32:9007"
    today at 19:23:50time="2022-01-23T19:23:50Z" level=debug msg="writing traefik/http/services/firefox-svc/loadBalancer/passHostHeader = true"
    today at 19:23:50time="2022-01-23T19:23:50Z" level=debug msg="writing traefik/http/routers/firefox-rtr/entryPoints/0 = https"
    today at 19:23:50time="2022-01-23T19:23:50Z" level=debug msg="writing traefik/http/routers/firefox-rtr/middlewares/0 = chain-authelia@file"
    

    Logs from Redis:

    yesterday at 19:28:591:C 22 Jan 2022 19:28:59.763 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
    yesterday at 19:28:591:C 22 Jan 2022 19:28:59.763 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started
    yesterday at 19:28:591:C 22 Jan 2022 19:28:59.763 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
    yesterday at 19:28:591:M 22 Jan 2022 19:28:59.763 * monotonic clock: POSIX clock_gettime
    yesterday at 19:28:591:M 22 Jan 2022 19:28:59.764 * Running mode=standalone, port=6379.
    yesterday at 19:28:591:M 22 Jan 2022 19:28:59.764 # Server initialized
    yesterday at 19:28:591:M 22 Jan 2022 19:28:59.764 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
    yesterday at 19:28:591:M 22 Jan 2022 19:28:59.764 * Ready to accept connections
    yesterday at 20:29:001:M 22 Jan 2022 20:29:00.029 * 1 changes in 3600 seconds. Saving...
    yesterday at 20:29:001:M 22 Jan 2022 20:29:00.029 * Background saving started by pid 20
    yesterday at 20:29:0020:C 22 Jan 2022 20:29:00.034 * DB saved on disk
    yesterday at 20:29:0020:C 22 Jan 2022 20:29:00.034 * RDB: 0 MB of memory used by copy-on-write
    yesterday at 20:29:001:M 22 Jan 2022 20:29:00.130 * Background saving terminated with success
    today at 18:41:031:M 23 Jan 2022 18:41:03.620 * 1 changes in 3600 seconds. Saving...
    today at 18:41:031:M 23 Jan 2022 18:41:03.620 * Background saving started by pid 21
    today at 18:41:0321:C 23 Jan 2022 18:41:03.630 * DB saved on disk
    today at 18:41:0321:C 23 Jan 2022 18:41:03.631 * RDB: 0 MB of memory used by copy-on-write
    today at 18:41:031:M 23 Jan 2022 18:41:03.722 * Background saving terminated with success
    today at 18:41:031:M 23 Jan 2022 18:41:03.722 * Background saving terminated with success
    today at 18:41:031:M 23 Jan 2022 18:41:03.722 * Background saving terminated with success
    today at 18:41:031:M 23 Jan 2022 18:41:03.722 * Background saving terminated with success
    

    Traefik logs gave an error saying "Key not found in store" - is this part of the problem?

    yesterday at 19:46:35time="2022-01-22T19:46:35Z" level=info msg="Configuration loaded from flags."
    yesterday at 19:46:35time="2022-01-22T19:46:35Z" level=info msg="Traefik version 2.5.7 built on 2022-01-20T16:16:23Z"
    yesterday at 19:46:35time="2022-01-22T19:46:35Z" level=info msg="Stats collection is enabled."
    yesterday at 19:46:35time="2022-01-22T19:46:35Z" level=info msg="Many thanks for contributing to Traefik's improvement by allowing us to receive anonymous information from your configuration."
    yesterday at 19:46:35time="2022-01-22T19:46:35Z" level=info msg="Help us improve Traefik by leaving this feature on :)"
    yesterday at 19:46:35time="2022-01-22T19:46:35Z" level=info msg="More details on: https://doc.traefik.io/traefik/contributing/data-collection/"
    yesterday at 19:46:35time="2022-01-22T19:46:35Z" level=info msg="Starting provider aggregator.ProviderAggregator {}"
    yesterday at 19:46:35time="2022-01-22T19:46:35Z" level=info msg="Starting provider *file.Provider {\"directory\":\"/rules\",\"watch\":true}"
    yesterday at 19:46:35time="2022-01-22T19:46:35Z" level=info msg="Starting provider *traefik.Provider {}"
    yesterday at 19:46:35time="2022-01-22T19:46:35Z" level=info msg="Starting provider *acme.Provider {\"email\":\"[email protected]\",\"caServer\":\"https://acme-v02.api.letsencrypt.org/directory\",\"storage\":\"/acme.json\",\"keyType\":\"RSA4096\",\"dnsChallenge\":{\"provider\":\"cloudflare\",\"delayBeforeCheck\":\"1m30s\",\"resolvers\":[\"1.1.1.1:53\",\"1.0.0.1:53\"]},\"ResolverName\":\"dns-cloudflare\",\"store\":{},\"TLSChallengeProvider\":{\"Timeout\":4000000000},\"HTTPChallengeProvider\":{}}"
    yesterday at 19:46:35time="2022-01-22T19:46:35Z" level=info msg="Starting provider *docker.Provider {\"watch\":true,\"endpoint\":\"tcp://socket-proxy:2375\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"network\":\"t2_proxy\",\"swarmModeRefreshSeconds\":\"15s\"}"
    yesterday at 19:46:35time="2022-01-22T19:46:35Z" level=info msg="Testing certificate renew..." providerName=dns-cloudflare.acme
    yesterday at 19:46:35time="2022-01-22T19:46:35Z" level=info msg="Starting provider *redis.Provider {\"rootKey\":\"traefik\",\"endpoints\":[\"redis:6379\"]}"
    yesterday at 19:46:35time="2022-01-22T19:46:35Z" level=info msg="Starting provider *acme.ChallengeTLSALPN {\"Timeout\":4000000000}"
    yesterday at 19:46:35time="2022-01-22T19:46:35Z" level=error msg="Cannot build the configuration: Key not found in store" providerName=redis
    yesterday at 19:46:352022/01/22 19:46:35 redis.go:310: watchLoop in WatchTree err:Key not found in store
    

    Thanks.

  • Doesn't work with multiple services on one container

    Doesn't work with multiple services on one container

    Currently, there is a problem when configuring multiple routers on one container. For example:

    minio:
      image: quay.io/minio/minio
      volumes:
        - ./minio:/data
      ports:
        - 9000:9000
        - 9001:9001
      command:
        - server
        - /data
        - --console-address
        - ":9001"
      environment:
        MINIO_ROOT_USER: root
        MINIO_ROOT_PASSWORD: root
      labels:
        traefik.enable: true
        traefik.http.routers.s3.rule: "Host(`s3.example.com`)"
        traefik.http.routers.s3.entrypoints: webs
        traefik.http.services.s3.loadbalancer.server.port: 9000
    
        traefik.http.routers.minio.rule: "Host(`minio.example.com`)"
        traefik.http.routers.minio.entrypoints: webs
        traefik.http.services.minio.loadbalancer.server.port: 9001
    

    It would be really nice to get this working, as it is a bit annoying to put the second one into a different config file :)

    Regards, Dorian

  • Handle containers with static IPs

    Handle containers with static IPs

    I Just came across your very handy service. I have several containers that use a macvlan type network and statically defined IPs on the same vlan as the docker host(s). Example, a docker host has an IP of 192.168.1.10, the pihole container on that host is using 192.168.1.50:80|53. In this case, your service is reporting the pihole admin web service is at http://192.168.1.10:80 (docker host) instead of the container static IP of http://192.168.1.50:80. It seems that there my be additional information that needs to be parsed to account for containers that use static, bridge, and external DHCP container networks.

    Thanks!

  • Choose default port

    Choose default port

    Hey there,

    Thank you so much for creating this! It is exactly what I've been looking for :D

    I just have one small feature request: When there is only one exposed port on a container, could you automatically assign that port as the bind port?

    Regards, Dorian

  • Multiple instances?

    Multiple instances?

    I'd like to have this running on 2 different servers (A & B), feeding data to a traefik instance running on a third (C). It seems. however, that whenever I publish a container to "B" it blats all of the "A" configuration currently registered on "C" (and vice-versa). I'm sharing the redis instance, is this the issue ? Can traefik support multiple redis sources in any case? Thoughts?

  • --health-cmd ?

    --health-cmd ?

    I (wherever possible) monitor my containers with the excellent willfarrell/autoheal docker container. What would be a suitable --health-cmd for traefik-cop to test it's state of health?

Igo Agent is the agent of Igo, a command-line tool, through which you can quickly start Igo

igo agent 英文 | 中文 Igo Agent is the agent of Igo, a command-line tool, through which you can quickly start Igo, and other capabilities may be added lat

Dec 22, 2021
Shoes-agent - Framework for myshoes provider using agent
Shoes-agent - Framework for myshoes provider using agent

shoes-agent Framework for myshoes provider using agent. agent: agent for shoes-a

Jan 8, 2022
Feb 17, 2022
Integrated ssh-agent for windows. (pageant compatible. openSSH ssh-agent etc ..)
Integrated ssh-agent for windows. (pageant compatible. openSSH ssh-agent etc ..)

OmniSSHAgent About The chaotic windows ssh-agent has been integrated into one program. Chaos Map of SSH-Agent on Windows There are several different c

Dec 19, 2022
Traefik-redirect-operator is created to substitute manual effort of creating an ingress and service type External.
Traefik-redirect-operator is created to substitute manual effort of creating an ingress and service type External.

Overview Traefik Redirect Operator is used to help creating a combination of Ingress of Traefik controller along with Service's ExternalName type. The

Sep 22, 2021
Traefik plugin that whitelists or blacklists requests from specific countries

traefik-plugin-geoblock traefik-plugin-geoblock is a traefik plugin to whitelist requests based on geolocation This projects includes IP2Location LITE

Oct 10, 2022
A middleware plugin for Traefik which replace a header in the response

Rewrite Header Rewrite header is a middleware plugin for Traefik which replace a header in the response Configuration Static pilot: token: "xxxx" e

Feb 11, 2022
Docker LNMP (Nginx, PHP7/PHP5, MySQL, Redis)

DNMP(Docker + Nginx + MySQL + PHP7/5 + Redis)是一款全功能的LNMP一键安装程序。 使用前最好提前阅读一遍目录,以便快速上手,遇到问题也能及时排除。

Jan 1, 2023
A docker image for test redis HA

Guide 测试集群模式(Test Redis Cluster) redis-test --arch cluster 127.0.0.1:6379 127.0.0.1:6380 127.0.0.1:6381 测试哨兵模式(TEST Redis Sentinel) redis-test --arc

Nov 30, 2021
Explore Docker registries and manipulate Docker images!
Explore Docker registries and manipulate Docker images!

L/S tags Utility and API to manipulate (analyze, synchronize and aggregate) images across different Docker registries. Example invocation $ lstags alp

Nov 25, 2022
Docker-based remote code runner / 基于 Docker 的远程代码运行器
Docker-based remote code runner / 基于 Docker 的远程代码运行器

Docker-based remote code runner / 基于 Docker 的远程代码运行器

Nov 9, 2022
ecsk is a CLI tool to interactively use frequently used functions of docker command in Amazon ECS. (docker run, exec, cp, logs, stop)
ecsk is a CLI tool to interactively use frequently used functions of docker command in Amazon ECS. (docker run, exec, cp, logs, stop)

English / 日本語 ecsk ECS + Task = ecsk ?? ecsk is a CLI tool to interactively use frequently used functions of docker command in Amazon ECS. (docker run

Dec 13, 2022
Hassle-free minimal CI/CD for git repositories with docker or docker-compose projects.
Hassle-free minimal CI/CD for git repositories with docker or docker-compose projects.

GIT-PIPE Hassle-free minimal CI/CD for git repos for docker-based projects. Features: zero configuration for repos by default automatic encrypted back

Sep 23, 2022
Tool to convert docker-compose files to set of simple docker commands

docker-decompose Tool to convert docker-compose files to set of simple docker commands. Install Use go get to install the latest version of the librar

Apr 12, 2022
Go-http-server-docker - Simple sample server using docker and go

go-http-server-docker Simple sample webserver using docker and go.

Jan 8, 2022
Docker-hub-rate-limit - Show pulling rate status of Docker-hub

Docker-Hub Pull Rate Status This tool shows current status of docker hub pull ra

Jan 28, 2022
Dotnet-appsettings-env - Convert .NET appsettings.json file to Kubernetes, Docker and Docker-Compose environment variables

dotnet-appsettings-env Convert .NET appsettings.json file to Kubernetes, Docker

Dec 30, 2022
Dotnet-appsettings-env - Convert .NET appsettings.json file to Kubernetes, Docker and Docker-Compose environment variables

dotnet-appsettings-env Convert .NET appsettings.json file to Kubernetes, Docker

Feb 16, 2022
The mec platform for service register/discovery/subscribe and other functions.roject main repo.

EdgeGallery MEP project Introduction Edgegallery MEP is an open source implementation of MEC platform according to ETSI MEC 003 [1] and 011 [2] docume

Nov 15, 2022