-
Coloured Diff With Python
TL; DR: my simple Python code to output a result of text comparison in git-diff style Here’s the code snippet in Python. 🙂
-
How to Use Pod Anti-Affinity in Kubernetes
By default the Kubernetes scheduler distributes pods of a replica set evenly to all nodes, if no taints are present of course. So why or when do we need pod anti-affinity? 1 scenario I can think of is like this: Without any advanced tuning such as pod anti-affinity, the replicas can possibly be scheduled like…
-
Monitoring MySQL with mysqld-exporter
TL; DR: I use mysqld-exporter with Prometheus to monitor my MySQL server. The mysqld-exporter runs as a container in my Kubernetes cluster. A sample manifest looks like: 🙂
-
4 Years Since Working From Home Started
Although the COVID-19 pandemic made countless things worse, it still had a silver-lining: working from home(or remote jobs) as a norm. 2020 It still feels like a fresh memory when I recall how the working from home transition started. Before 2020, it was a blessing if one could work from home 1 day a week.…
-
How to Upgrade a Kubernetes Cluster with `kubeadm` in 2024
TL; DR: I upgraded my Garage Kubernetes Lab cluster from 1.28 to 1.29 recently. Here’s how I did it. Upgrading the Control Plane First, the Linux package repository needs to be updated to include kubeadm 1.29. This can be done like this(My cluster is built with Ubuntu 22.04, for other Linux distributions please refer to…
-
How to Upgrade Istio the Git-Ops Way
Istio 1.17 has been running really well in my Garage Kubernetes lab, but I thought it’s time to give it an upgrade. It was installed and configured using istioctl utility last time when I bootstrapped the cluster. Since I’ve automated a lot of Kubernetes resources using ArgoCD I would like to upgrade Istio the git-ops…
-
How to Calculate Proportions Using 2 Metrics in Prometheus
Recently I needed to improve an alert defined using Prometheus Alert Manager to trigger when less than half of the minimum replicas are up, eg. I had a look at existing metrics collected by kube-state-metrics in my Kubernetes cluster, the number of replicas running well could be queried with the kube_pod_status_ready metric and the number…
-
An Easy Way to Build GitHub Actions Workflows
TL; DR: I found it not so convenient to look up GitHub’s official docs when traversing objects in GHA(GitHub Actions), ie. what’s in github.event object? So using a few steps now all the data structures are available to me. 🙂