Skip to main content

Traefik Dashboard

The Traefik deployment used by K3s has the capability to show a dashboard, to give you a visual indication of what services you have configured. But it needs to be enabled -

Step 1 - Enable the Dashboard

On one of nodes, edit the file /var/lib/rancher/k3s/server/manifests/traefik.yaml, and add the following at the bottom of the valuesContent: section.

dashboard.enabled: "true"
dashboard.domain: "traefik.internal" <-- this should be the DNS name you want to use for the dashboard.

Next, apply the config -

kubectl apply -f /var/lib/rancher/k3s/server/manifests/traefik.yaml
note

This change is not permanent, and will revert after the cluster reboots.

Step 2 - Create the Service & Ingress Route

Create a yaml file called traefik-dashboard.yaml.

kind: Service
apiVersion: v1
metadata:
name: traefik-dashboard
namespace: kube-system
spec:
type: ClusterIP
selector:
app.kubernetes.io/instance: traefik
app.kubernetes.io/name: traefik
ports:
- name: http
port: 9000
protocol: TCP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: traefik-dashboard-ingress
namespace: kube-system
annotations:
kubernetes.io/ingress.class: traefik
spec:
rules:
- host: "traefik.domain.com"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: traefik-dashboard
port:
number: 9000

As before, change out the host address for a DNS name you have configured on your local network.

Step 3 - Browse to the dashboard

Using the hostname you picked, browse to it, and add /dashboard/ to the URL.
Example: https://traefik.domain.com/dashboard/

info

The trailing slash is not a typo, its needed.

Next Step

Next, go to the next step, Dashboard - K8s.
Or,
Go back to the index page.