Steve mitchell in Side notes 5 minutes

How to Enable the Traefik Dashboard

Traefik Dashboard
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
Traefik System Namespace
Traefik System Namespace

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
Section of the Traefik Deployment YAML
Section of the Traefik Deployment YAML

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
Enable the Traefik Dashboard
Enable the Traefik Dashboard

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
Bounce the Traefik Pods
Bounce the Traefik Pods

Start port forwarding to the Traefik service.

Forward to the Traefik Service
Forward to the Traefik Service
1
2
3
export KUBECONFIG=~/kubeconfig
kubectl -n kube-system port-forward deployment/traefik 8080 &
kubectl proxy &
Port Forwarding
Port Forwarding

Finally, open the dashboard at http://localhost:8080/dashboard.

Traefik Dashboard
Traefik Dashboard

References

Rancher K3S Ingress Demo with Traefik