How to Install Kubernetes Ingress on a Raspberry Pi Cluster
By: Richard Youngkin
Tags: Programming, Kubernetes, Microservices, Raspberry Pi, Engineering

Setting Up Traefik

Installing the Traefik Ingress controller is relatively simple.

Note: This is different than the “Kubernetes & Traefik 101” reference.

helm install stable/traefik --name <your-name-here> --set dashboard.enabled=true,serviceType=NodePort,dashboard.domain=dashboard.traefik,rbac.enabled=true,externalIP=<pi-router-IP>,imageTag=1.7.12 --namespace kube-system

This is a relatively common way of installing Traefik. Here’s what the various parts of the above command mean:

stable/traefik is a Helm chart that describes how to deploy Traefik. The interesting thing about this is it references a multiarch Docker image, so we don’t have to worry about finding an arm image to install.

is a Helm chart that describes how to deploy Traefik. The interesting thing about this is it references a multiarch Docker image, so we don’t have to worry about finding an image to install. <your-name-here> is the name Helm will give to the deployment and will also be part of the Kubernetes resource names (e.g., the deployment name). On my cluster, I used the relatively boring name of my-traefik-release .

is the name Helm will give to the deployment and will also be part of the Kubernetes resource names (e.g., the deployment name). On my cluster, I used the relatively boring name of . dashboard.enabled=true indicates that the Traefik dashboard should be available.

indicates that the Traefik dashboard should be available. serviceType=NodePort indicates that external access to the dashboard is via a NodePort . More on this later.

indicates that external access to the dashboard is via a . More on this later. dashboard.domain=dashboard.traefik specifies that the Traefik dashboard is configured to be reachable using dashboard.traefik as the host name (e.g., http://dashboard.traefik . We’ll be using this later to confirm the installation.

specifies that the Traefik dashboard is configured to be reachable using as the host name (e.g., . We’ll be using this later to confirm the installation. rbac.enabled means that Traefik is being configured for extended Kubernetes permissions. To be frank, I’m not quite sure why this is required, but it is.

means that Traefik is being configured for extended Kubernetes permissions. To be frank, I’m not quite sure why this is required, but it is. externalIP=<pi-router-IP> is needed to expose the external address Traefik will be listening on. pi-router-IP references the external network IP address for our Pi Router. In “Setup a Raspberry Pi Cluster,” this is the kubemaster host at 10.0.0.100 .

is needed to expose the external address Traefik will be listening on. references the external network IP address for our Pi Router. In “Setup a Raspberry Pi Cluster,” this is the host at . imageTag=1.7.12 installs a specific version of Traefik. If this isn’t specified, the latest image of Traefik will be installed. Traefik just released a new major version 2.x. Since this series was started before 2.x was released, and uses v1.7.12, I thought it best to stick with that version.

installs a specific version of Traefik. If this isn’t specified, the latest image of Traefik will be installed. Traefik just released a new major version 2.x. Since this series was started before 2.x was released, and uses v1.7.12, I thought it best to stick with that version. --namespace kube-system installs Traefik into the kube-system namespace. This is somewhat arbitrary — you can change it if you like.

Here’s the output from my environment:

You can verify the installation by checking the deployment:

Note that the service my-traefik-release ’s EXTERNAL-IP value is what we specified in the helm install ... command.

A final way of verifying the installation is to open the Traefik dashboard. Note that the service my-traefik-release has a type of NodePort . The service’s port(s) are 80:31214/TCP,443:30308/TCP . The port information is needed to create the URL for the dashboard. Per the port information, it’s located at http://dashboard.traefik:31214/dashboard/ . Port 31214 comes from the HTTP external port as specified in 80:31214 .

Note that 443:30308/TCP refers to HTTPS endpoints. It’s likely the ports from your installation will be different. To access the dashboard from curl or a browser, you’ll need to add the dashboard’s hostname to /etc/hosts . If you used a different IP address for your PI router, use that instead of 10.0.0.100 .

10.0.0.100 dashboard.traefik

This is needed because Traefik is routing on the host name dashboard.traefik . An /etc/hosts entry is needed so the host name used in any requests can be resolved correctly. Here’s what the Traefik dashboard looks like on my cluster:

My Traefik dashboard at http://dashboard.traefik:31214