<p>I have installed Traefik on Kubernetes and followed allong the official tutorial.
I have a cluster of 4 machines for Kubernetes.</p>

<p>When I run <code>kubectl --namespace=kube-system get pods</code> I see <code>traefik-ingress-controller-678226159-eqseo</code>, so all fine.</p>

<p>Then I executed:</p>

<pre><code>kubectl apply -f https://raw.githubusercontent.com/containous/traefik/master/examples/k8s/ui.yaml
</code></pre>

<p>and then ran:</p>

<pre><code>echo "$(my master node ip) traefik-ui.minikube" | sudo tee -a /etc/hosts
</code></pre>

<p>which resulted in:
<code>http://192.168.178.31 traefik-ui.minikube</code> in <code>/etc/hosts</code></p>

<p>I further edited <code>kubectl -n kube-system edit service traefik-web-ui</code> service and changed
the type to <code>NodePort</code>.</p>

<p>When I finally run <code>$ curl http://192.168.178.31:31107</code> I get:</p>

<pre><code>curl: (7) Failed to connect to 192.168.178.31 port 31107: Connection refused
</code></pre>

<p>Does anyone know, why I am getting the Connection refused?</p>

<p><strong>EDIT 1:</strong></p>

<p>Log from <code>kubectl logs -f traefik-ingress-controller-68994b879-5z2xr -n kube-system</code>:</p>

<pre><code>time="2018-05-13T09:55:48Z" level=info msg="Traefik version v1.6.0 built on 2018-04-30_09:28:44PM"
time="2018-05-13T09:55:48Z" level=info msg="\nStats collection is disabled.\nHelp us improve Traefik by turning this feature on :)\nMore details on: https://docs.traefik.io/basics/#collected-data\n"
time="2018-05-13T09:55:48Z" level=info msg="Preparing server http &amp;{Address::80 TLS:&lt;nil&gt; Redirect:&lt;nil&gt; Auth:&lt;nil&gt; WhitelistSourceRange:[] WhiteList:&lt;nil&gt; Compress:false ProxyProtocol:&lt;nil&gt; ForwardedHeaders:0x14ed5e50} with readTimeout=0s writeTimeout=0s idleTimeout=3m0s"
time="2018-05-13T09:55:48Z" level=info msg="Preparing server traefik &amp;{Address::8080 TLS:&lt;nil&gt; Redirect:&lt;nil&gt; Auth:&lt;nil&gt; WhitelistSourceRange:[] WhiteList:&lt;nil&gt; Compress:false ProxyProtocol:&lt;nil&gt; ForwardedHeaders:0x14ed5e60} with readTimeout=0s writeTimeout=0s idleTimeout=3m0s"
time="2018-05-13T09:55:48Z" level=info msg="Starting server on :80"
time="2018-05-13T09:55:48Z" level=info msg="Starting provider *kubernetes.Provider {\"Watch\":true,\"Filename\":\"\",\"Constraints\":[],\"Trace\":false,\"TemplateVersion\":0,\"DebugLogGeneratedTemplate\":false,\"Endpoint\":\"\",\"Token\":\"\",\"CertAuthFilePath\":\"\",\"DisablePassHostHeaders\":false,\"EnablePassTLSCert\":false,\"Namespaces\":null,\"LabelSelector\":\"\",\"IngressClass\":\"\"}"
time="2018-05-13T09:55:48Z" level=info msg="Starting server on :8080"
time="2018-05-13T09:55:48Z" level=info msg="ingress label selector is: \"\""
time="2018-05-13T09:55:48Z" level=info msg="Creating in-cluster Provider client"
time="2018-05-13T09:55:48Z" level=info msg="Server configuration reloaded on :80"
time="2018-05-13T09:55:48Z" level=info msg="Server configuration reloaded on :8080"
time="2018-05-13T09:55:53Z" level=info msg="Server configuration reloaded on :80"
time="2018-05-13T09:55:53Z" level=info msg="Server configuration reloaded on :8080"
time="2018-05-13T09:55:55Z" level=info msg="Server configuration reloaded on :80"
time="2018-05-13T09:55:55Z" level=info msg="Server configuration reloaded on :8080"
</code></pre>

<p>in <a href="https://raw.githubusercontent.com/containous/traefik/master/examples/k8s/ui.yaml" rel="nofollow noreferrer">https://raw.githubusercontent.com/containous/traefik/master/examples/k8s/ui.yaml</a> there is following ingress definition:</p>

<pre><code>---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: traefik-web-ui
  namespace: kube-system
spec:
  rules:
  - host: traefik-ui.minikube
    http:
      paths:
      - path: /
        backend:
          serviceName: traefik-web-ui
          servicePort: web
</code></pre>

<p>This mean you should access traefik-web-ui via ingress service.</p>

<p>If you deployed traefik as Deployment (<a href="https://raw.githubusercontent.com/containous/traefik/master/examples/k8s/traefik-deployment.yaml" rel="nofollow noreferrer">https://raw.githubusercontent.com/containous/traefik/master/examples/k8s/traefik-deployment.yaml</a>), you should check the NodePort returned by <code>kubectl describe svc traefik-ingress-service -n kube-system</code> and use it as your url (<a href="http://traefik-ui.minikube:xxx" rel="nofollow noreferrer">http://traefik-ui.minikube:xxx</a>)</p>

<p>(you don't have to change traefik-web-ui to NodePort)</p>

<p>If you used DeamonSet (<a href="https://raw.githubusercontent.com/containous/traefik/master/examples/k8s/traefik-ds.yaml" rel="nofollow noreferrer">https://raw.githubusercontent.com/containous/traefik/master/examples/k8s/traefik-ds.yaml</a>) just use <code>http://traefik-ui.minikube</code>.</p>

<p>If you would like to access <code>traefik-web-ui</code> directly the easiest way would be:
<code>minikube service traefik-web-ui --url</code></p>
