Note: this is more a bash/shell script issue than Kubernetes.
So I have one replica of a pod, and so kubectl get pods
will only return one active replica.
Conceptually what I want to do is simple. I want to do a kubectl logs my-pod-nnn1
with a watcher, HOWEVER when that pod terminates I want to stream a message "my-pod-nnn1 terminated, now logging my-pod-nnn2", and then stream the new logs. This is a fairly complex process (for me) and I'm wondering what approach I could take, and if this is possible (or perhaps not necessary) with multi-threading of some kind (which I have not done). Thanks