How to Enable the Traefik Dashboard
The Traefik ingress controller is included out-of-the-box with Rancher k3s. It deploys into the kube-system namespace. Take a moment to have a look at the kube-system namespace.
1
kubectl -n kube-system get all
While the service, “service/traefik,” is running, the dashboard is not. To enable the dashboard, edit the config map. The name of the config map is specified in the Traefik deployment at Volumes → config → name.
1
kubectl -n kube.system describe deploy traefik
Edit the “traefik” config map and add a section named “api” with an attribute of “dashboard” equal to true.
1
kubectl -n kube-system edit cm traefik
Bounce Traefik to pick up the updated config map by scaling it down to zero, then back up to one.
1
2
kubectl -n kube-system scale deploy traefik --replicas 0
kubectl -n kube-system scale deploy traefik --replicas 1
Start port forwarding to the Traefik service.
1
2
3
export KUBECONFIG=~/kubeconfig
kubectl -n kube-system port-forward deployment/traefik 8080 &
kubectl proxy &
Finally, open the dashboard at http://localhost:8080/dashboard.