kubectl-external-forward
kubectl-external-forward copied to clipboard
Add option to automatically delete the created proxy pod when it has been idle for more than n hours
Hi,
I'd love to be able to also use the kubectl external-forward plugin as follows:
kubectl external-forward localhost:5432:<my-remote-db-host>:5432 &> /dev/null &
Note how the above command sends the external-forward process to the background. I find this useful when having to connect to many remote hosts via the kubernetes cluster where I don't really care about the logs and where I want to use my shell afterwards to type in other commands.
With this use-case, however, I might forget about my lingering process and it might get killed only when my laptop shuts down. And this then may not kill the created proxy pod inside the Kubernetes cluster.
Therefore, I'd find it useful if the external-forward plugin also allowed a parameter like (e.g.) --delete-idle-proxy-pod-after 3h
. This option would then instruct the external-forward plugin to also delete the created proxy pod inside the Kubernetes cluster if it has been idle (i.e., not serving any traffic) for more than 3 hours.
Do you think such a feature request would make sense for the external-forward plugin?