How to Use the Open Source Tool Traefik to Direct Kubernetes Traffic

This tutorial will show you how to ingress traffic from external sources into a Kubernetes-Raspberry Pi cluster by using the open-source cloud-native edge router, Traefik. I’ll then detail how you can clean up Kubernetes resources afterward.

First things first, you’ll need a k3s Raspberry Pi cluster like the one I've detailed here. Your cluster will also need internet connectivity in order to access online images. All of the sample configuration and HTML files used below are available for download from GitLab.

Manage Configurable Data In Kubernetes

When doing containerization, often there is a need to have some configurations manageable from outside the container. After a container has booted with certain pre-configured data, it is necessary to have a way by which this data can be modified at runtime, if needed. For instance, we may have different configurations for different deployment environments and we may want to use the correct set of configurations for a target environment without re-creating the container.

Kubernetes provides ConfigMap to help configure data externally. This follows the design paradigm - "separation of config from code." The ConfigMap API makes the application portable. The configuration can be changed without redeploying the application.