1/n – Cloud Native Realtime Messaging Using Postgres and MQTT

I am going to build a kubernetes cluster based home lab using Raspberry Pi 5s and experiment on cloud native projects with this. The first of these is to build a lightweight, highly available, easily scalable realtime chat platform that works both on web and on mobile, using postgres as a db and MQTT as a realtime communication protocol.

Building a Kubernetes Cluster

Since I am using a raspberry pi, my options are limited between rancher’s K3s and ubuntu’s microk8s. I tried setting both up, microk8s is more opinionated and was easier to setup. Online reviews also show it as a complete k8s distribution, so microk8s.

  • ssh into the rpi running latest ubuntu server and follow this: https://microk8s.io/docs/install-raspberry-pi
  • I have a cluster with one 8gb rpi5 running the control plane with one rpi4 1G added as a worker. I will eventually get more to create a HA cluster, but till then will continue moving forward with the assumption that whatever can deploy to k8s can be HA

Postgres