Go Graceful Shutdown

Graceful shutdown is a technique used to smoothly terminate an app. It allows the clients to receive data from the app. Also it gives time for the load balancer to deregister it and not send a traffic to it. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 // this is not an app with graceful shutdown package main import ( "fmt" "log" "net/http" "time" ) // this request takes long time to complete func indexHandler(w http....

Healthchecks - two most important Pod endpoints - Readiness & Liveness Check with Go examples

Every application should contain at least two endpoints: readiness check, health check. Readiness check should indicate when the app is ready to serve traffic. It should allow traffic when the app is correctly initialized. For example it should wait for the database connection to be established. The connection to cache or external API as well. This probe allows to cut off the traffic in case the app is unable to handle it....

Deploying Unifi Controller to Kubernetes

Deploying Unifi Controller to Kubernetes

I would like to share with you my manifest to deploy Unifi Controller to my homelab k8s cluster. The config is based on this thread on unifi community forum I wanted to deploy Unifi Controller, this way to easily control config.gateway.json which can persist the non-standard config for router. Without config.gateway.json, the BGP configuration is lost after the router restart. I wanted the BGP config for MetalLB This manifest has several assumptions:...