-
-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stops watching when pods restart #67
Comments
Hack / proof of concept fix for johanhaleby#67. Wrap the follow of an individual pod in a "while true" loop to keep monitoring a pod after it crashes and restarts. Probably breaks horribly if you try and use kubetail without follow.
+1 to this issue. It is not only when a pod is killed that it becomes a problem. A very common use case for me is to watch the pods as they dynamically scale up and down. Kubetail only grabs a "snapshot" as it were of the pods that are running at the time the command is ran. This makes it pretty useless for monitoring the logs from pods as they come up and down - which is a shame! 'Stern' looks like it supports this feature, although I haven't tried it:
Let's add this functionality to Kubetail, it's totally worth it. |
Yes this is something that I've been trying to achieve several times in the past, but I've failed so far. Have a look at the comment here. See this issue as well. |
Yes please, my use case is a development environment with pods getting restarted all the time. I've written a script to pick back up, but have to manually restart kubetail. Copying here for folks to use as a workaround for a single pod anyway:
|
@lknite Maybe this should be integrated into kubetail if it works well. Looks simple enough :) |
Above, generate temp file used to restart tail if a watched pod restarts
To raise the event that a pod log has exited:
Start the end tail command in the background with '&' (but still write to this shell's stdout):
Now that we can catch and restart, just need to implement an algorithm to restart things... |
@lknite Could you turn this into a PR? It would be the PR of year!!! (and possibly the entire project :)) |
Pull request submitted: #147 The PR adds an idle processing loop where decisions can be made run time. Someone will still need to write an algorithm to respond to a pod being restarted, but seems like a good step in the right direction. For now if it detects that a pod was deleted it exits. |
If a pod crashes and gets restarted kubetail stops tailing the pod, and any logs from the newly restarted pod are not seen. And since monitoring these types of crashes and the clusters response to them is my main purpose for trying to use kubetail...
The text was updated successfully, but these errors were encountered: