<p><em>*Cross-posted to <a href="https://github.com/rancher/k3d/discussions/691" rel="noreferrer">k3d github discussions</a>, to a thread in <a href="https://forums.rancher.com/t/k3s-traefik-dashboard-activation/17142/11?u=iseric" rel="noreferrer">Rancher forums</a>, and to <a href="https://community.traefik.io/t/exposing-the-traefik-dashboard-in-k3d-k3s/11340" rel="noreferrer">traefik's community discussion board</a></em></p>
<p><a href="https://www.youtube.com/watch?v=12taKl5iCpA&amp;pp=sAQA" rel="noreferrer">Tutorials from 2020</a> refer to editing the traefik configmap. Where did it go?</p>
<p>The <a href="https://doc.traefik.io/traefik/getting-started/install-traefik/#exposing-the-traefik-dashboard" rel="noreferrer">traefik installation instructions</a> refer to a couple of ways to expose the dashboard:</p>
<ol>
<li><p>This works, but isn't persistent: Using a 1-time command <code>kubectl -n kube-system port-forward $(kubectl -n kube-system get pods --selector &quot;app.kubernetes.io/name=traefik&quot; --output=name) 9000:9000</code></p>
</li>
<li><p>I cannot get this to work: Creating an &quot;IngressRoute&quot; yaml file and applying it to the cluster. This might be due to the Klipper LB and/or my ignorance.</p>
</li>
</ol>
<h3>No configmap in use by traefik deployment</h3>
<p>For a 2-server, 2-agent cluster... <code>kubectl -n kube-system describe deploy traefik</code> does not show any configmap:</p>
<pre><code>  Volumes:
   data:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  &lt;unset&gt;
   tmp:
    Type:               EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:             
    SizeLimit:          &lt;unset&gt;
  Priority Class Name:  system-cluster-critical
</code></pre>
<h3>No &quot;traefik&quot; configmap</h3>
<p>And, <code>kubectl get -n kube-system cm</code> shows:</p>
<pre><code>NAME                                 DATA   AGE
chart-content-traefik                0      28m
chart-content-traefik-crd            0      28m
chart-values-traefik                 1      28m
chart-values-traefik-crd             0      28m
cluster-dns                          2      28m
coredns                              2      28m
extension-apiserver-authentication   6      28m
k3s                                  0      28m
k3s-etcd-snapshots                   0      28m
kube-root-ca.crt                     1      27m
local-path-config                    4      28m
</code></pre>
<h3>No configmap in use by traefik pods</h3>
<p>Describing the pod doesn't turn up anything either. <code>kubectl -n kube-system describe pod traefik-....</code> results in no configmap too.</p>
<h3>Traefik ports in use, but not responding</h3>
<p>However, I did see arguments to the traefik pod with ports in use:</p>
<pre><code>      --entryPoints.traefik.address=:9000/tcp
      --entryPoints.web.address=:8000/tcp
      --entryPoints.websecure.address=:8443/tcp
</code></pre>
<p>However, these ports are not exposed. So, I tried port-forward with <code>kubectl port-forward pods/traefik-97b44b794-r9srz 9000:9000 8000:8000 8443:8443 -n kube-system --address 0.0.0.0</code>, but when I <code>curl -v localhost:9000</code> (or 8000 or 8443) and <code>curl -v localhost:9000/dashboard</code>, I get &quot;404 Not Found&quot;.</p>
<p>After getting a terminal to traefik, I discovered the local ports that are open, but it seems nothing is responding:</p>
<pre><code>/ $ netstat -lntu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       
tcp        0      0 :::8443                 :::*                    LISTEN      
tcp        0      0 :::8000                 :::*                    LISTEN      
tcp        0      0 :::9000                 :::*                    LISTEN      
/ $ wget localhost:9000
Connecting to localhost:9000 ([::1]:9000)
wget: server returned error: HTTP/1.1 404 Not Found
/ $ wget localhost:8000
Connecting to localhost:8000 ([::1]:8000)
wget: server returned error: HTTP/1.1 404 Not Found
/ $ wget localhost:8443
Connecting to localhost:8443 ([::1]:8443)
wget: server returned error: HTTP/1.1 404 Not Found
</code></pre>
<h3>Versions</h3>
<pre><code>k3d version v4.4.7
k3s version v1.21.2-k3s1 (default)
</code></pre>

<p>I found a solution and hopefully someone find a better one soon</p>
<ol>
<li>you need to control your k3s cluster from your pc and not to ssh into master node, so add <code>/etc/rancher/k3s/k3s.yaml</code> into your local <code>~/.kube/config</code> (in order to port forward in last step into your pc)</li>
<li>now get your pod name as follows:</li>
</ol>
<blockquote>
<p><code>kubectl get pod -n kube-system</code></p>
</blockquote>
<p>and seach for <code>traefik-something-somethingElse</code>
mine was <code>traefik-97b44b794-bsvjn</code></p>
<ol start="3">
<li>now this part is needed from your local pc</li>
</ol>
<blockquote>
<p><code>kubectl port-forward traefik-97b44b794-bsvjn -n kube-system 9000:9000</code></p>
</blockquote>
<ol start="4">
<li>get <code>http://localhost:9000/dashboard/</code> in your favorite browser and <strong>don't forget the second slash</strong></li>
<li>enjoy the dashboard</li>
</ol>
<p>please note you have to enable the dashboard first in <code>/var/lib/rancher/k3s/server/manifests/traefik.yaml</code> by adding</p>
<pre><code>dashboard:
  enabled: true
</code></pre>
