Configuring Kubernetes Træfik Ingress Controller, DNS, Dashboard – Part 5

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

Adding Ingress, DNS and or Dashboard to Kubernetes

In the previous post I went through how to finalize the kubelet configuration to use RKT and Flannel/CNI. below are examples on how to configure and use Træfik as an Ingress Controller, as well as Kube-dns and Kube-dashboard configuration(coming soon).

I divided the configuration into parts outlined below (still working progress).

Note: An up-to-date example is available on my GitHub project page, or generate your own Kubernetes configuration with the Kubernetes generator available here on my GitHub page.

This is part 5 Optional – configure Ingress, Kube-dns and Kube-dashboard

The Kube-dashboard examples is still in the works therefor missing from the below configuration, I hope to updated once I get a chance.

Simple Kubernetes kube-dns Configuration

To create your DNS pod just run the below using the kube-dns.yaml(below).

To scale to additional nodes, run the below.

To remove the DNS pod, run the below.

To troubleshot the kube-dns pod logs, just run something like the below.

I struggled with the below error for a while.

Till I noticed that the PodCIDR is being wrongly created causing bad iptable rules on the worker node. redoing the cluster cleared the bad PodCIDR creation.
An example of a bad (or good entry is below) depending on your network, watch for the right Pod CIDR.

Kube DNS configuration files

cat /etc/kubernetes/ssl/worker-kubeconfig.yaml

Note: Make sure to append the ca.pem at the end of the worker.pem. an example if below.

cat kube-dns.yaml
Note: Replace with your domain and IP Address.

Below is a quick simple example on how to use Træfik / Nginx as an Ingres Controller. Once I get around I hope to update the below configuration with a more complex/useful example.

Simple Kubernetes Træfik Ingress Configuration

You will need to create the below pod configuration files.

This creates two Nginx instances(replicas).
cat nginx-deployment.yaml

cat nginx-ingres.yaml

cat nginx-svc.yaml

A very simple Traefik example is below, another example is available here using Docker

cat traefik.toml

Download Traefik version 1.4.2 was the latest at time of this writing.

To Create the configuration, run the below.

Note: Ideally, Traefik itself should run in a pod. I hope to update the example soon with such an example.

Tip: To scale from 2 to 3 pods.

To quick test

To access the Traefik dashboard.

To verify the service

To remove / destroy the configuration.

Adding Kube-DNS

How-to coming soon.

Check out the next part – Part 6 – Automate the Kubernetes deployment(coming soon).

You might also like – Other articles related to Docker Kubernetes / micro-service.

Like what you’re reading? please provide feedback, any feedback is appreciated.

Leave a Reply

2 Comment threads
2 Thread replies
Most reacted comment
Hottest comment thread
3 Comment authors
Eli KleinmanZainal AbidinJoakim Recent comment authors
newest oldest most voted
Notify of

Thanks for the guide. However traefik is not suited as ingress controller in Kubernetes due to it not having propper TLS cert handling for the ingress resources

for more info

Zainal Abidin
Zainal Abidin

Please provide kube-dashboard example