Traefik Log Dashboard

Kubernetes

Deploy on Kubernetes with plain manifests or Helm

Prerequisites

  • Kubernetes 1.24+
  • kubectl configured for your cluster
  • Traefik running as your ingress controller (for IngressRoute support)
  • Traefik writing access logs to a known path on the node

Architecture

┌─────────────────────────────────────────────────┐
│ Kubernetes Cluster                              │
│                                                 │
│  ┌──────────────┐      ┌───────────────────┐   │
│  │    Agent      │◄─────│    Dashboard      │   │
│  │  (Go, :5000)  │      │  (Node.js, :3000) │   │
│  │               │      │                   │   │
│  │  HostPath:    │      │  PVC:             │   │
│  │  /var/log/    │      │  /data (SQLite)   │   │
│  │  traefik      │      │                   │   │
│  │  (read-only)  │      │                   │   │
│  └──────────────┘      └───────────────────┘   │
│         │                        │              │
│    ClusterIP               ClusterIP            │
│    svc:5000                svc:3000              │
│                                  │              │
│                          IngressRoute           │
│                     (traefik.example.com)        │
└─────────────────────────────────────────────────┘

The agent is internal-only (ClusterIP). The dashboard is exposed via a Traefik IngressRoute. The dashboard proxies all API calls to the agent.

Deployment

Clone and configure

git clone https://github.com/hhftechnology/traefik-log-dashboard.git
cd traefik-log-dashboard/k8s

Edit secret.yaml with your auth token:

# Generate a token
openssl rand -hex 32

Edit ingressroute.yaml with your domain and cert resolver.

If Traefik logs are not at /var/log/traefik, edit the hostPath in agent-deployment.yaml.

Apply all manifests

kubectl apply -k .

This creates:

  • traefik-dashboard namespace
  • Secret with auth token
  • ConfigMaps for agent and dashboard
  • PVCs for position tracking and SQLite
  • Agent Deployment + ClusterIP Service
  • Dashboard Deployment + ClusterIP Service
  • Traefik IngressRoute

Verify

kubectl -n traefik-dashboard get pods -w
kubectl -n traefik-dashboard logs -f deploy/traefik-agent
kubectl -n traefik-dashboard logs -f deploy/traefik-dashboard

Install with Helm

helm install traefik-log-dashboard charts/traefik-log-dashboard \
  --set auth.token=$(openssl rand -hex 32) \
  --set ingress.host=dashboard.yourdomain.com \
  --set agent.logHostPath=/var/log/traefik

Custom values

Create a my-values.yaml for your environment:

auth:
  token: "your-secret-token"

agent:
  logHostPath: /var/log/traefik
  resources:
    requests:
      cpu: 100m
      memory: 128Mi
    limits:
      cpu: 1000m
      memory: 1Gi

dashboard:
  config:
    agentName: "Production"
    maxLogsDisplay: "2000"

ingress:
  host: dashboard.example.com
  tls:
    certResolver: letsencrypt
helm install traefik-log-dashboard charts/traefik-log-dashboard -f my-values.yaml

Verify

kubectl -n traefik-dashboard get pods -w

Key Configuration

HostPath Volume

The agent reads Traefik logs via a hostPath volume mount. Set this to the directory where Traefik writes its access logs:

MethodConfiguration
Plain manifestsEdit hostPath.path in agent-deployment.yaml
Helm--set agent.logHostPath=/your/traefik/log/path

The agent pod must run on a node where Traefik writes logs. If Traefik runs as a DaemonSet, consider changing the agent from a Deployment to a DaemonSet as well.

Authentication

Both the agent and dashboard use the same shared token for API authentication. The token is stored in a Kubernetes Secret (traefik-dashboard-auth) and injected via environment variables.

# Generate a secure token
openssl rand -hex 32

Persistence

ComponentMount PathPurposeDefault Size
Agent/dataPosition file tracking64Mi
Dashboard/dataSQLite database1Gi

Multi-Agent

To monitor multiple Traefik instances, add additional agent environment variables in the dashboard ConfigMap:

data:
  AGENT_1_NAME: "Production"
  AGENT_1_URL: "http://traefik-agent:5000"
  AGENT_2_NAME: "Staging"
  AGENT_2_URL: "http://staging-agent.other-namespace:5000"

Port Forwarding (Quick Access)

For testing without an IngressRoute:

kubectl -n traefik-dashboard port-forward svc/traefik-dashboard 3000:3000
# Open http://localhost:3000

Troubleshooting

SymptomCheck
Agent pod CrashLoopBackOffVerify hostPath exists on the node and contains log files
Dashboard init container stuckAgent not healthy — check agent logs
No logs showingVerify Traefik is writing JSON logs to the configured path
IngressRoute not workingEnsure Traefik CRDs are installed (kubectl get crd ingressroutes.traefik.io)

Next Steps

On this page