Cannot get Traefik to work on Centos 7.5 with Kubernetes

7/30/2018
  • Centos 7.5

I am trying to get Traefik installed in Kubernetes using the guide from here.

I performed the following:

kubectl apply -f https://raw.githubusercontent.com/containous/traefik/master/examples/k8s/traefik-rbac.yaml
kubectl apply -f https://raw.githubusercontent.com/containous/traefik/master/examples/k8s/traefik-ds.yaml

and then checked my pods receiving the following:

kubectl --namespace=kube-system get pods

coredns-78fcdf6894-5bslk                      0/1       CrashLoopBackOff   626        2d
coredns-78fcdf6894-fxr28                      1/1       Running            627        2d
etcd-nw-h-cos7-n1.natiki                      1/1       Running            0          2d
kube-apiserver-nw-h-cos7-n1.natiki            1/1       Running            0          2d
kube-controller-manager-nw-h-cos7-n1.natiki   1/1       Running            0          2d
kube-flannel-ds-amd64-6t2j6                   1/1       Running            0          2d
kube-flannel-ds-amd64-gxpg5                   1/1       Running            0          2d
kube-flannel-ds-amd64-nf6bv                   1/1       Running            0          2d
kube-proxy-5n9lm                              1/1       Running            0          2d
kube-proxy-62kkp                              1/1       Running            0          2d
kube-proxy-t7dfq                              1/1       Running            0          2d
kube-scheduler-nw-h-cos7-n1.natiki            1/1       Running            0          2d
traefik-ingress-controller-7vbkz              1/1       Running            0          41m
traefik-ingress-controller-9qld7              1/1       Running            0          41m

Now as I understand it I should be able to do a basic http connection on the master node as: http://localhost and get to the Traefik dashboard however I get a page not found. Same if I try http://localhost:8001/api/v1/proxy/namespaces/default/services/traefik

I also tried to proxy the ingress as:

kubectl --namespace=kube-system port-forward traefik-ingress-controller-7vbkz 8080:8001

but when I access it that returns:

Handling connection for 8080
E0801 19:26:49.332072   12575 portforward.go:331] an error occurred forwarding 8080 -> 8001: error forwarding port 8001 to pod 46a5574cef4397d0d58c453883c91fc1df5eff94e68234587077f9a1c65d83b5, uid : exit status 1: 2018/08/01 19:26:49 socat[17624] E connect(5, AF=2 127.0.0.1:8001, 16): Connection refused

My topology is as follows:

Master 10.99.99.101
Slave1 10.99.99.102
Slagve2 10.99.99.103

When I look at the ingress logs I see:

E0730 22:02:57.030684       1 reflector.go:205] github.com/containous/traefik/vendor/k8s.io/client-go/informers/factory.go:86: Failed to list *v1beta1.Ingress: Get https://10.96.0.1:443/apis/extensions/v1beta1/ingresses?limit=500&resourceVersion=0: dial tcp 10.96.0.1:443: i/o timeout

It appears that traefik is trying to connect to 10.96.0.1? No idea why. Perhaps the CoreDNS is the issue because looking at the logs for that pod I see:

kubectl --namespace=kube-system logs coredns-78fcdf6894-5bslk

E0801 09:32:21.267810       1 reflector.go:205] github.com/coredns/coredns/plugin/kubernetes/controller.go:313: Failed to list *v1.Service: Get https://10.96.0.1:443/api/v1/services?limit=500&resourceVersion=0: dial tcp 10.96.0.1:443: i/o timeout
E0801 09:32:21.267943       1 reflector.go:205] github.com/coredns/coredns/plugin/kubernetes/controller.go:320: Failed to list *v1.Namespace: Get https://10.96.0.1:443/api/v1/namespaces?limit=500&resourceVersion=0: dial tcp 10.96.0.1:443: i/o timeout
E0801 09:32:21.268219       1 reflector.go:205] github.com/coredns/coredns/plugin/kubernetes/controller.go:315: Failed to list *v1.Endpoints: Get https://10.96.0.1:443/api/v1/endpoints?limit=500&resourceVersion=0: dial tcp 10.96.0.1:443: i/o timeout

I am wondering if this has to do with my use of Flannel or something else? Can someone please help me as to how I get to the dashboard to display?

-- TheEdge
centos
kubernetes
traefik

0 Answers