pglogical setup

In certain cases, you can’t do a full postgres replication to another instance, or you prefer a fine-grained control on what to replicate, pglogical is one way to achieve partial replication, albeit this requires more manual setup. Below are steps I used to do a pglogical replication from AWS RDS to on-premise database. Note: If a subscriber (from the above example, the on-premise database) is offline, postgres WAL would balloon up....

July 20, 2023 · 2 min · Karn Wong

Hassle-free Kubernetes monitoring with Coroot

Successfully deploying services are not the end, maintenance is coming to town! When you want to see how your system works, usually people rely on SaaS like Datadog or New Relic to do the heavy lifting. Also a lot of $$$ is required. Also with SaaS like these, usually you have to config your application to forward metrics/logs to your monitoring provider, this could mean a few months of engineering man-days....

June 9, 2023 · 2 min · Karn Wong

The mythical ChatOps in action

Imagine having multiple services running, each has its own logs. Most people don’t read them, and they shouldn’t, because services emit a lot of logs! But we need them, because it’s the only way to diagnose and troubleshoot system errors. But you might say “my service is not a system! It’s only doing tiny stuff!” Gotta break it to you, your small part is a piece in a large system networks stitched together!...

April 18, 2023 · 3 min · Karn Wong

Kubernetes with Grafana Cloud

Kubernetes is awesome, I think this is obvious if you have more than a handful of services to manage. If you use cloud, either VM or container-based runtime, it would provide you a dashboard to see the metrics. But what about kubernetes? Since you would have multiple services inside a single cluster, in which it’s backed by VMs, at best you would only see into your VMs’ metrics, but doesn’t provide separate metrics per each service....

April 1, 2023 · 2 min · Karn Wong

Cost optimization with kubernetes

Correction 2023-07-02: fix homelab specs and corresponding AWS EC2 instance class (it’s actually 32GB RAM, not 64GB) Congratulations, you managed to successfully deployed a few services on kubernetes! But this is not the end 👀. Unfortunately money doesn’t grow on trees, and if you can’t justify your infra expenses, finance department won’t be happy. If you’re using Terraform, you can use Infracost to create a cost report. Pretty nifty. But what about kubernetes?...

April 1, 2023 · 2 min · Karn Wong