Kubernetes has made handling persistent storage remarkably flexible thanks to the broad support it offers for Container Storage Interface (CSI) drivers. In this post, I want to share how I set up the NFS CSI driver on my own homelab cluster, which relies on an NFS server packing a roomy 12TB of storage. If you are interested in getting your persistent volumes reliably served from an NFS backend, read on. I will use Terraform throughout because I believe infrastructure as code is the surest path to repeatability, transparency, and peace of mind.
This is where I document my journey through DevOps, infrastructure, and engineering life. Expect Kubernetes tips, homelab experiments, and the occasional detour into electronics tinkering. Whether you’re a fellow engineer or just curious about how things work under the hood, I hope you find something useful (or at least mildly interesting) here.
Automatic WAN Failover in MikroTik Routers (Using Netwatch)
Today, I want to share a practical approach to configuring automatic WAN failover on MikroTik routers using Netwatch. If you have ever experienced internet downtime because of a failure in your primary WAN connection, you know how disruptive it can be. While there are several ways to implement failover, my method gives more certainty by verifying true connectivity to the wider internet, not just a reachable gateway.
How Netwatch-Based Failover Differs
Previously, I posted about using static routes with check-gateway enabled to handle WAN failover. That approach is functional, but it only checks connectivity to your gateway. In contrast, using Netwatch lets us monitor a specific external IP address. This ensures your WAN connection is actually passing traffic to the internet, not just able to ping the next router upstream. It feels like a more robust solution for most real-world use cases.
DHCP-Integrated DNS on MikroTik Routers (Just Like dnsmasq)
If you’re like me and enjoy the seamless integration of DHCP and DNS that dnsmasq provides, you may have wondered how to replicate this on MikroTik-based routers. While MikroTik offers great flexibility and power, their out-of-the-box DNS integration with DHCP isn’t quite as straightforward. But with a bit of scripting and the right approach, you can get dynamic DNS updates for your DHCP leases.
Let me walk you through the steps I used, so you can achieve the same effortless experience in your own network.
Automatic Failover Between WAN Connections on a MikroTik Router
UPDATE: See this post for an improved solution to the same problem.
Having a reliable internet connection is important to me, especially since I work remotely. Downtime can be incredibly frustrating and potentially costly. That’s why I decided to set up auto failover between my two WAN connections on my MikroTik router. Here, I’ll walk you through how I accomplished it using the router’s built-in scripting capabilities.
Getting Started in the Web UI
To automate the failover between WAN connections, I used MikroTik’s scripting feature. Here’s how I set it up:
Exposing cert-manager Certificates Directly to Pods
One of the challenges when running applications that require TLS in Kubernetes is handling certificate management safely and efficiently. If you are using cert-manager, you are already automating much of the certificate lifecycle. However, a common question I encounter is how to expose those certificates directly to a pod and ensure your application can seamlessly reload them as they are renewed. In this post, I want to walk through a practical approach using the nginx Docker image as an example.