API Gateway Dashboard
The dashboard is the central place that shows you the current active routes.
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
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.
There are 2 ways to configure and access the dashboard:
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.
Secure Mode
This is the recommended method.
Field | Description | Default | Required |
---|---|---|---|
dashboard | Enable the dashboard. | False | No |
First, save the default configuration.
The following command will save it to a file with the name values.yaml in your working directory.
helm show values traefik/traefik-hub > values.yaml
Second, adjust the file.
ingressRoute:
dashboard:
enabled: true
Install the Traefik Hub API Gateway with Your Custom Settings
Once you have the configuration adjusted to your needs, use Helm to deploy the Traefik Hub API Gateway with the new values:
helm upgrade --install --namespace traefik-hub traefik-hub traefik/traefik-hub --values values.yaml
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
As underlined in the documentation for the api.dashboard
option,
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
Insecure Mode
This mode is not recommended because it does not allow the use of security features.
To enable the "insecure mode", adjust the default configuration.
The following command will save it to a file with the name values.yaml in your working directory.
Second, adjust the file.
additionalArguments:
- --api.insecure=true
Install the Traefik Hub API Gateway with Your Custom Settings
Once you have the configuration adjusted to your needs, use Helm to deploy the Traefik Hub API Gateway with the new values:
helm upgrade --install --namespace traefik-hub traefik-hub traefik/traefik-hub --values values.yaml
You can now access the dashboard on the port 8080
of the Traefik Hub API Gateway instance,
at the following URL: http://<Traefik Hub Cluster IP>:8080/dashboard/
(the trailing slash is mandatory).