Skip to content

Incomplete Route List in ns8-traefik Module #7334

@Amygos

Description

@Amygos

The ns8-traefik module reports an incomplete list of routes. This issue
becomes apparent in nodes with a large number of HTTP routes created and
certificates requested.

Steps to reproduce

  1. Run the command api-cli run module/traefik1/list-routes to retrieve the
    list of routes.
  2. Compare the number of routes reported by the module with the actual number
    of configuration files in /home/traefik1/.config/state/configs/.
  3. Use find and wc commands to count the number of configuration files,
    excluding files starting with _ and certificate-.

Expected behavior

The ns8-traefik module should report a complete and accurate list of routes.

Actual behavior

The module reports an incomplete list of routes, with the number of routes
limited by the default pagination setting of the Traefik API.

Components

  • ns8-traefik module version <= 2.2.5

See also:

  • Example output of api-cli run module/traefik1/list-routes | jq '. | length':
    [root@cb1 ~]# api-cli run module/traefik1/list-routes | jq '. | length'
    Warning: using user "cluster" credentials from the environment
    46
    
  • Example output of find /home/traefik1/.config/state/configs/ -type f -not -name "_*" -not -name "certificate-*" | wc -l:
    [root@cb1 ~]# find /home/traefik1/.config/state/configs/ -type f -not -name "_*" -not -name "certificate-*" | wc -l
    74
    
  • Example output of curl commands demonstrating the effect of pagination:
    [root@cb1 ~]# curl -s http://127.0.0.1/1223d634-069c-4a23-b96c-d3045473231e/api/http/routers | jq '. | length'
    100
    [root@cb1 ~]# curl -s http://127.0.0.1/1223d634-069c-4a23-b96c-d3045473231e/api/http/routers?per_page=200 | jq '. | length'
    155
    
  • Traefik documentation: https://doc.traefik.io/traefik/operations/api/#endpoints

Metadata

Metadata

Assignees

No one assigned

    Labels

    verifiedAll test cases were verified successfully

    Type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions