On-Demand Namespace Error Log Watcher in a Locked-Down Kubernetes Environment
During a large-scale stress test, the last thing you want is to be hunting errors across 150 pods manually. So I built an on-demand error log watcher for a complex Kubernetes namespace under real-world constraints, without touching anything outside the namespace, and without installing a single binary on the server. What we are building: a Kubernetes Deployment, scaled to zero by default, that runs Stern as a container inside the cluster. It watches all pods in a target namespace, filters output to errors only, and can be started or stopped with a single kubectl scale command. The entire setup RBAC, ServiceAccount, and Deployment lives within the targeted namespace it monitors and leaves no trace when removed. ...