<p>I'm moving my project to Kubernetes using Traefik for routing and MetalLB as my load balancer.</p>
<p>I've deployed several apps and I'd like to make use of official <a href="https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/" rel="nofollow noreferrer">Kubernetes-Dashboard</a>. So I deployed the Kubernetes-Dashboard using recommended config and created IngressRoute:</p>
<pre class="lang-yaml prettyprint-override"><code># dashboard.yaml
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: kubernetes-dashboard
  namespace: kubernetes-dashboard
spec:
  entryPoints:
    - websecure
  routes:
    - match: Host(`k8s.example.com`, `www.k8s.example.com`)
      kind: Rule
      middlewares:
        # - name: https-redirectscheme
        # - name: nginx-basic-auth
      services:
        - kind: Service
          name: kubernetes-dashboard
          # namespace: kubernetes-dashboard
          port: 443
  tls:
    secretName: k8s.example.com-tls
</code></pre>
<p>It shows up in the Traefik Dashboard, but when I try to access k8s.example.com I get <code>Internal Server Error</code>.</p>
<p>Thank you</p>

<p>I had the same problem - which is why I ended on this question. When I find out how to use the <code>IngressRoute</code> I'll update this answer.</p>
<p>This answer describes how to use <code>NodePort</code> instead.</p>
<pre class="lang-bash prettyprint-override"><code>kubectl patch svc kubernetes-dashboard -p '{&quot;spec&quot;: {&quot;type&quot;: &quot;NodePort&quot;}}'
# Confirm
kubectl get svc -n kubernetes-dashboard kubernetes-dashboard -o yaml

# patch the dashboard
tee ~/nodeport_dashboard_patch.yaml&lt;&lt;EOF
spec:
  ports:
  - nodePort: 32000
    port: 443
    protocol: TCP
    targetPort: 8443
EOF

kubectl patch svc kubernetes-dashboard --patch &quot;$(cat ~/nodeport_dashboard_patch.yaml)&quot;
</code></pre>
<hr />
<p>Now the dashboard can be reached on the external IP Traefik gave you - in collaboration with MetalLB - with port :32000.<br />
If you have a website routed to your cluster, you can use:</p>
<pre><code>https://yourwebsite.com:32000
</code></pre>
<p>As described in the link you shared, fetch the token by using:</p>
<pre><code>export SA_NAME= # admin user from the ServiceAccount
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep ${SA_NAME} | awk '{print $1}')
</code></pre>
<p>(I could change this answer for a complete script to do this; If you'd like)</p>
