This is the second part of Building a kubernetes cluster on Raspberry Pi and low-end equipment article. In this part, I’ll create an Internet-facing network for the kubernetes cluster.

In part 1, I provisioned kubernetes nodes, set up the cluster, and ran test application.

The main goal is to create an infrastructure that allows accessing applications in kubernetes using the Internet.

Eventually, it will serve the same purposes as AWS Elastic Load Balancer, GCP Load Balancer, Azure Load Balancer, and any load balancer in cloud infrastructures.

It’s not possible to solve that issue with only one component, so several things will be used: an internet gateway, dynamic DNS, content delivery network.

Introducing the Internet Gateway

An Internet Gateway term could mean anything. To make things clear I need to give it a definition that would perfectly fit this article.

Internet Gateway — hardware and software system intended to provide network connectivity from the public internet segment to a private network at the Transport Layer(OSI model Layer 4).

There are several ways to do that: Network address translation(NAT), different proxy servers(such as HAProxy, nginx, envoy and many others).

Using a proxy server would require dedicated network equipment that accepts connections from the Internet and proxy to kubernetes nodes. The spirit of the article to use low-end equipment only and utilize existing components as much as possible. Thus using NAT is my choice.

Luckily I use a feature-rich Mikrotik Router and it would be relatively easy to set it up even for a complex scenario.

The next section will use Mikrotik Router configuration. It is possible to achieve that on many other routers. I purposely skip NAT and Mikrotik specific details and just provide general information. The reader can always learn the topic and replicate on different hardware.

If you are interested in learning Mikrotik — here’s a link to the official documentation: Manual:IP/Firewall/NAT.