Traefik on k8s: dashboard unreacheable

6/19/2021

Versions:

$ k3d version
k3d version v4.4.6
k3s version v1.21.1-k3s1 (default)
---
Helm chart:
$ helm search repo traefik/traefik
NAME           	CHART VERSION	APP VERSION	DESCRIPTION                                  
traefik/traefik	9.1.1        	2.2.8      	A Traefik based Kubernetes ingress controller

I've created this cluster:

$ k3d cluster create default \
  --k3s-server-arg "--no-deploy=traefik" \
  --port 32080:80@loadbalancer \
  --port 32443:443@loadbalancer \
  --port 32900:9000@loadbalancer

My containers:

CONTAINER ID   IMAGE                      COMMAND                  CREATED         STATUS         PORTS                                                                                             NAMES
d060f40535a4   rancher/k3d-proxy:v4.4.6   "/bin/sh -c nginx-pr…"   2 minutes ago   Up 2 minutes   0.0.0.0:32080->80/tcp, 0.0.0.0:32443->443/tcp, 0.0.0.0:43063->6443/tcp, 0.0.0.0:32900->9000/tcp   k3d-default-serverlb
f8c97a5a02d0   rancher/k3s:v1.21.1-k3s1   "/bin/k3s server --n…"   2 minutes ago   Up 2 minutes                                                                                                     k3d-default-server-0

As you can see, port mapping for @loadbalancer node is:

0.0.0.0:32080->80/tcp, 0.0.0.0:32443->443/tcp, 0.0.0.0:43063->6443/tcp, 0.0.0.0:32900->9000/tcp

After that, I'm installed traefik using helm chart:

$ helm install traefik traefik/traefik --namespace kube-system --set ports.traefik.expose=true

My services:

NAME             TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)                                     AGE
kube-dns         ClusterIP      10.43.0.10     <none>        53/UDP,53/TCP,9153/TCP                      4m30s
metrics-server   ClusterIP      10.43.24.120   <none>        443/TCP                                     4m30s
traefik          LoadBalancer   10.43.52.100   172.20.0.2    9000:31185/TCP,80:31884/TCP,443:32718/TCP   3m48s

dashboard route is exposed as well:

Name:         traefik-dashboard
Namespace:    kube-system
Labels:       app.kubernetes.io/instance=traefik
              app.kubernetes.io/managed-by=Helm
              app.kubernetes.io/name=traefik
              helm.sh/chart=traefik-9.1.1
Annotations:  helm.sh/hook: post-install,post-upgrade
API Version:  traefik.containo.us/v1alpha1
Kind:         IngressRoute
Spec:
  Entry Points:
    traefik
  Routes:
    Kind:   Rule
    Match:  PathPrefix(`/dashboard`) || PathPrefix(`/api`)
    Services:
      Kind:  TraefikService
      Name:  api@internal

However, I'm trying to reach dashboard using http:localhost:32900/dashboard, but I'm getting an 404 Not found:

HTTP/1.1 404 Not Found
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Sat, 19 Jun 2021 20:44:57 GMT
Content-Length: 19

404 page not found

Any ideas?

-- Jordi
kubernetes
traefik
traefik-ingress

0 Answers