Automatically restart port-forwarding in Kubernetes or OpenShift

When you set up a port-forward to a Kubernetes or OpenShift pod, the connection will disconnect automatically with the message “lost connection to pod” when the pod completes or you reach the port-forward time limit. It could be a few minutes or a few hours. The automatic disconnection is a useful feature for security and to save resources, but the closed connection will interrupt your flow of thought and force you to restart port forwarding....

May 15, 2023 · 3 min

Query SQLite databases on pods directly

If you work with SQLite databases in Kubernetes or OpenShift, you’re probably familiar with using the remote shell (rsh) feature to access the database and run queries on the pod directly. The remote shell is great for one-off tasks with a table or exploratory work, but it will break your workflow and chain of thought when working with automation or running tasks on your local system. But you can use the exec command in oc and kubectl to query the database and return results directly int to your local environment, making tasks faster, easier, and more fluid....

May 13, 2023 · 7 min