Traefik Hub Gateway Dashboard and API
The dashboard is the central place that shows you the current active routes handled by Traefik Hub.
- Dashboard Overview
- HTTP Router Overview
- TCP Router Overview
Configuration
The API and the dashboard can be configured:
- In the Helm Chart: You can find the options to customize the Traefik Hub API Gateway installation enabing the dashboard here.
- In the Traefik Hub API Gateway Static Configuration as describe below.
Field | Description | Default | Required |
---|---|---|---|
api | Enable api/dashboard. If the option api.dashboard is set to true, this option is by default set to true too and should not be explicitly set to false . | false | No |
api.dashboard | Enable dashboard | false | No |
api.debug | Enable additional endpoints for debugging and profiling. | false | No |
api.disabledashboardad | Disable the advertisement from the dashboard. | false | No |
api.insecure | Enable the API and the dashboard on the entryPoint named traefik. | false | No |
Endpoints
All the following endpoints must be accessed with a GET
HTTP request.
Path | Description |
---|---|
/api/http/routers | Lists all the HTTP routers information. |
/api/http/routers/{name} | Returns the information of the HTTP router specified by name . |
/api/http/services | Lists all the HTTP services information. |
/api/http/services/{name} | Returns the information of the HTTP service specified by name . |
/api/http/middlewares | Lists all the HTTP middlewares information. |
/api/http/middlewares/{name} | Returns the information of the HTTP middleware specified by name . |
/api/tcp/routers | Lists all the TCP routers information. |
/api/tcp/routers/{name} | Returns the information of the TCP router specified by name . |
/api/tcp/services | Lists all the TCP services information. |
/api/tcp/services/{name} | Returns the information of the TCP service specified by name . |
/api/tcp/middlewares | Lists all the TCP middlewares information. |
/api/tcp/middlewares/{name} | Returns the information of the TCP middleware specified by name . |
/api/udp/routers | Lists all the UDP routers information. |
/api/udp/routers/{name} | Returns the information of the UDP router specified by name . |
/api/udp/services | Lists all the UDP services information. |
/api/udp/services/{name} | Returns the information of the UDP service specified by name . |
/api/entrypoints | Lists all the entry points information. |
/api/entrypoints/{name} | Returns the information of the entry point specified by name . |
/api/overview | Returns statistic information about HHTP, TCP and about enabled features and providers. |
/api/rawdata | Returns information about dynamic configurations, errors, status and dependency relations. |
/api/version | Returns information about Traefik version. |
/debug/vars | See the expvar Go documentation. |
/debug/pprof/ | See the pprof Index Go documentation. |
/debug/pprof/cmdline | See the pprof Cmdline Go documentation. |
/debug/pprof/profile | See the pprof Profile Go documentation. |
/debug/pprof/symbol | See the pprof Symbol Go documentation. |
/debug/pprof/trace | See the pprof Trace Go documentation. |
More Information
The dashboard is available at the same location as the API but on the path /dashboard/
by default.
The trailing slash /
in /dashboard/
is mandatory.
This limitation can be mitigated using the RedirectRegex Middleware
There is also a redirect of the path /
to the path /dashboard/
,
but one should not rely on that property as it is bound to change,
and it might make for confusing routing rules anyway.
Then define a routing configuration on Traefik Hub itself, with a router attached to the service api@internal
to allow defining:
-
One or more security features through middlewares like authentication (basicAuth, OIDC) or IP allow listing.
-
A router rule for accessing the dashboard, through Traefik Hub itself (sometimes referred to as "Traefik-ception").
Dashboard Router Rule
The router rule defined for Traefik Hub must match the path prefixes /api
and /dashboard
.
We recommend using a Host Based rule to match everything on the host domain, or to make sure that the defined rule captures both prefixes:
- Host Rule
- Path Prefix Rule
- Combination of Rules
# The dashboard can be accessed on http://dev.example.com/dashboard/
rule = "Host(`dev.example.com`)"
# The dashboard can be accessed on http://example.com/dashboard/ or http://dev.example.com/dashboard/
rule = "PathPrefix(`/api`) || PathPrefix(`/dashboard`)"
# The dashboard can be accessed on http://dev.example.com/dashboard/
rule = "Host(`dev.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
Dashboard Configuration
Example of an deployment file:
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: traefik-dashboard
spec:
routes:
- match: Host(`dev.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))
kind: Rule
services:
- name: api@internal
kind: TraefikService
middlewares:
- name: auth-oidc
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: auth-oidc
spec:
plugin:
oidc:
issuer: "https://tenant.auth0.com/realms/myrealm"
redirectUrl: "/callback"
clientID: my-oidc-client-name
clientSecret: mysecret