To enable traefik Dashboard in K3s Kubernetes I use:
$ cat is-enabled-traefik-dashboard.yaml
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
name: is-enabled-traefik-dashboard
namespace: kube-system # Or your Traefik namespace
spec:
valuesContent: |-
# Enable the Traefik API and Dashboard
api:
dashboard: true
insecure: false # Set to true for development, false for production
The next is to set the login page credentials:
$ cat traefik-dashboard-auth-middleware.yaml
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: traefik-dashboard-auth-middleware
namespace: kube-system
spec:
basicAuth:
secret: traefik-dashboard-auth-secret # Reference to a Kubernetes Secret containing credentials
To get to the Traefik Dashboard my ingress looks as:
$ cat ingress_specs.yaml
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: traefik-routes
namespace: kube-system
spec:
entryPoints:
- websecure
routes:
- kind: Rule
match: Host(`k3s-apache-php.cn.lan`)
services:
- kind: Service
namespace: kube-system
name: apache-php-service
port: 8080
passHostHeader: true
- kind: Rule
match: Host(`k3ssv1.cn.lan`)
services:
- name: api@internal
middlewares:
- name: traefik-dashboard-auth-middleware
tls:
secretName: kube-system-tls-secret
These settings can be deployed. However, I can not find the dashboard using any of:
k3ssv1.cn.lan
k3ssv1.cn.lan/dashboard
k3ssv1.cn.lan/api/dashboard
k3ssv1.cn.lan/api/
I tried to follow the "identify the needed service and create an ingress controller" methodology for the dashboard but it seems my process is missing something...
I am also using self signed certificates…
Any suggestions please?
Thanks in advance