Ceph Dashboard behind Traefik

I have a Ceph cluster that I access it's dashboard behind Traefik. The normal behaviour of the dashboard is running in the node with the active manager and if the node is down you need to access the dashboard by any other of the hostnames until the original manager came back online. After the original node is back up. When the user try to access, it would proceed to redirect the user to the new active manager. So even if the original node is back online, it keeps the dashboard in the new active node until this new mgr fails. But this behaviour is messing with the route I had set up in the config file of traefik. Is there any way to fix this problem.

Example:

http:
  routers:
    ceph:
      rule: Host(`ceph.domain.tld`)
      service: ceph
      entryPoints:
        - "websecure"
      tls:
        certResolver: myresolver
  services:
    ceph:
      loadBalancer:
        servers:
          - url: "https://10.10.10.165:8443"

The IPs of the others nodes that have a mgr in standby as a failover are:
10.10.10.166:8443
10.10.10.167:8443

Check failover service (doc).

Already tried with multiple failovers in secuence. It fails to keep the route to the new mgr when then original mgr is back online. So the redirect start taking place.

http:
  routers:
    ceph:
      rule: Host(`ceph.domain.tld`)
      service: ceph-main
      entryPoints:
        - "websecure"
      tls:
        certResolver: myresolver
  services:
    ceph-main:
      failover:
        healthCheck: {}
        service: ceph-01
        fallback: ceph-failover
    ceph-failover:
      failover:
        healthCheck: {}
        service: ceph-02
        fallback: ceph-03
    ceph-01:
      loadBalancer:
        healthCheck:
          path: /#/login
          interval: 10s
          timeout: 3s
        servers:
          - url: "https://10.10.10.165:8443"
    ceph-02:
      loadBalancer:
        healthCheck:
          path: /#/login
          interval: 10s
          timeout: 3s
        servers:
          - url: "https://10.10.10.166:8443"
    ceph-03:
      loadBalancer:
        healthCheck:
          path: /#/login
          interval: 10s
          timeout: 3s
        servers:
          - url: "https://10.10.10.167:8443"

So the target service dashboard is on server A. When that fails, target service dashboard moves to server B. But when A is back in-line, you want the target to still be B?

How should Traefik know about that? The only option I see is that you can create a generic health check that not only checks health but if the dashboard is the active one - if that is even possible.

This cmd in Ceph ceph config set mgr mgr/dashboard/standby_behaviour "error" and a secuence of failovers like this:

http:
  routers:
    ceph:
      rule: Host(`ceph.domain.tld`)
      service: ceph-main
      entryPoints:
        - "websecure"
      tls:
        certResolver: myresolver
  services:
    ceph-main:
      failover:
        healthCheck: {}
        service: ceph-01
        fallback: ceph-failover
    ceph-failover:
      failover:
        healthCheck: {}
        service: ceph-02
        fallback: ceph-03
    ceph-01:
      loadBalancer:
        healthCheck:
          path: /#/login
          interval: 10s
          timeout: 3s
        servers:
          - url: "https://10.10.10.165:8443"
    ceph-02:
      loadBalancer:
        healthCheck:
          path: /#/login
          interval: 10s
          timeout: 3s
        servers:
          - url: "https://10.10.10.166:8443"
    ceph-03:
      loadBalancer:
        healthCheck:
          path: /#/login
          interval: 10s
          timeout: 3s
        servers:
          - url: "https://10.10.10.167:8443"

Don't know if there is a more elegant or more optimized solution.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.