Very new to the Kubernetes world I just installed K3S. All good and running.
As I see, Traefik was already installed. Got my first Ingress rule running.
But for hours I am not able to figure out, what steps need to be done to get the Traefik Dashboard running. Too many different guidelines that might not fit here.
with
kubectl -n kube-system edit configmap traefik
I found the configuration file and after “traefik.toml:” I added “dashboard = true”
Is this the correct location? What else needs to be done? Do I need to set Ingress rule? Kind of some “steps needed” guide would be great.
I usually edit the Helm chart directly on the master by SSH-ing into it as user rancher:
sudo vi /var/lib/rancher/k3s/server/manifests/traefik.yaml
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: traefik
namespace: kube-system
spec:
chart: https://%{KUBERNETES_API}%/static/charts/traefik-1.81.0.tgz
set:
rbac.enabled: "true"
ssl.enabled: "true"
metrics.prometheus.enabled: "true"
kubernetes.ingressEndpoint.useDefaultPublishedService: "true"
image: "rancher/library-traefik"
dashboard.enabled: "true" # <-- add this line
dashboard.domain: "traefik.internal" # <-- and this one with a resolvable DNS name
Helm will pick up the changes automagically and the dashboard will be available under http://traefik.internal/dashboard/.
Keep in mind that after a reboot of the master the file will be restored without the added lines.
I did it the different way and did not use Rancher Traefik manifests at all. Regular Traefik installation into Kubernetes. This will survive reboot, BUT (in my case) only accessible via localhost (ssh tunnel to local machine). This works for me well enough.
Wolfram
@hbokh editing the traefik.yaml file didn’t work for me. I manually started the k3s server using the “–disable traefik” flag and deployed your yaml above and still no luck. Anything else I could try?
It worked for me. After adding dashboard enabled:true, you can use kubectl apply -f /var/lib/rancher/k3s/server/manifests/traefik.yaml to get the dashboard up n running
Help? I’m not sure what path to take here. I don’t see the traefik configmap in use anymore and posted this question to StackOverflow. I want to be able to configure enabling the dashboard outside of the cluster itself, because I am automating the setup, so modifying files in a pod isn’t a solution. I’ve heard reference to k3s configuration manifests under “/var/…rancher/k3s/…” directory, but I’m using k3d and can’t find any such directory.
I updated the SO question with additional details. I don’t want to disable the default traefik installation and install my own, because 1) k3d/k3s already upgraded to Traefik 2 and 2) I don’t want to have to manage “yet another thing”. There has to be a simple way to expose the dashboard…
I found a solution and hopefully someone find a better one soon
you need to control your k3s cluster from your pc and not to ssh into master node, so add /etc/rancher/k3s/k3s.yaml into your local ~/.kube/config (in order to port forward in last step into your pc)
now get your pod name as follows:
kubectl get pod -n kube-system
and seach for traefik-something-somethingElse mine was traefik-97b44b794-bsvjn
Being Traefik is an ingress router, all I did was create an Ingress rule to access the Dashboard in name space “kube-system”. I used entrypoint websecure since I already have LetsEncrypt working, you can change to just web.